Desktop app deploy

Annoying, there’s no issue on my machine but there’s an SSL error on another Windows machine.

Can you confirm that it works if you don’t host on https?

$ app open spirals -ssl false

Also can you try running:

$ dotnet dev-certs https --trust

Then retry running with ssl:

$ app open spirals

This resolved it for me, not sure why it’s become an issue.

Yes, It works with

app open spirals -ssl false

Confirming that dotnet dev-certs https --trust also resolves issue.

1 Like

I’ve changed the default to not use SSL by default to get around this poor behavior in the latest v0.0.73.

It can be enabled on a per app basis in your app.settings with:

ssl true
1 Like

I’m having rather odd problem which manifests when I’m using dependent dlls (whether my own or third party - NLog, Quartz…). I get error which says that there are dlls missing (error at web Startup.cs in line 2852).
It appears that not all dll’s are loaded, and I dont know where to load them before plugin registration.

Exception log:

# x run Testapp --verbose
args: ''
APP_SOURCE=sharp-apps Sharp Apps
Using '/home/user/.sharp-apps/Testapp/app.settings'
{
	Tool: x,
	Arguments: [],
	WebSettingsPath: /home/user/.sharp-apps/Testapp/app.settings,
	StartUrl: "http://localhost:5000/",
	UseUrls: "http://localhost:5000/",
	AppDir: /home/user/.sharp-apps/Testapp,
	ToolPath: /home/user/.dotnet/tools/.store/x/0.0.73/x/0.0.73/tools/netcoreapp3.1/any/x.dll,
	FavIcon: /home/user/.dotnet/tools/.store/x/0.0.73/x/0.0.73/tools/netcoreapp3.1/any/favicon.ico,
	DebugMode: True
}
Attempting to load plugin 'plugins/TestappClient.ServiceInterface.dll', size: 61952 bytes
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.

Could not load file or assembly 'Quartz, Version=3.0.7.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4'. The system cannot find the file specified.


   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.RuntimeModule.GetTypes()
   at System.Reflection.Assembly.GetTypes()
   at Web.AppLoader.InitAppHost() in C:\src\dotnet-app\src\Web\Startup.cs:line 2852
   at Web.AppLoader.Init(String contentRootPath) in C:\src\dotnet-app\src\Web\Startup.cs:line 2753
   at Web.WebAppContext.Build() in C:\src\dotnet-app\src\Web\Startup.cs:line 62
   at Web.Program.Main(String[] cmdArgs) in C:\src\dotnet-app\src\X\Program.cs:line 33

System.IO.FileNotFoundException: Could not load file or assembly 'Quartz, Version=3.0.7.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4'. The system cannot find the file specified.

File name: 'Quartz, Version=3.0.7.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4'

Help!

This issue is Quartz .dll:

What worked for me was copying 3rd Party .dll’s in the app’s dotnet tool bin folder.

I’ve added a assembly Resolve fallback in this commit which may or may not help. I don’t want to publish new versions unless it works, so can you clone ServiceStack/dotnet-app and run /src/App/install-local-tool.bat to install the dotnet tool in your machine so you can test locally with the app tool to see if it resolves the issue.

I’m using x tool on linux machine and I had this issue even when using only project dll-s.
Example: my test solution consists of TestApp, TestApp.ServiceInterfaces, TestServer, TestServer.ServiceInterfaces and Test.Models projects. Models project is seprated as it is referenced both from TestApp.SI and TestServer.SI.
Plugin is in TestApp.SI project.
When I publish TestApp to Git, I’m placing TestApp.ServiceInterface.dll and Test.Model.dll in plugins folder.
This problem first appeared for Test.Model.dll. I overcome it by linking all needed files from Model project into SI project, thus eliminating Test.Model.dll (interesting thing here was that on two testing machines (same linux distro and version, same dotnet core and x versions) on first machine I had no error and on second machine I had error for same “x open” git, only difference between machines was that first one had regular and second one had ssd disk - not sure if this matters in any way, nor how this could happen).

Then it appeared for Serial.IO.Ports.dll (we wrote about this earlier) and I overcame it by Assembly.Default.LoadFromPath(…) during plugin registration.
However this does not work for other dependent dlls, in this case Quartz.dll (Im trying to register singleton and jobs in servicescollection trough IStartup, but also for example NLog.dll when i comment out any Quartz dependent code and remove package).

Copying to dotnet tool app bin folder may resolves issue on windows (will try tommorow), but I have tried to copy dependent dlls into x tool /any/x.dll folder but it did not help. I’m using x tool and browser for tests since production env. will be browser in kiosk mode on linux.

I will test locally tommorow and let you know the results.
Thanks!

Here is testing report.
Change you made did not show effect in my case, neither did copying dependent dlls into /any folder of x tool on linux.
However I have managed to finer granulate case when I have dll not found exception for System.IO.Ports.dll.
AssemblyLoadContext.Default.LoadFromAssemblyPath(dllPath) during plugin registration only works if dll is deployed in some non-plugins folder (named “libs” in this case). If I leave it in plugins folder I’m getting dll not found exception.
As for Quartz.dll I definitelly have an issue with loading it in any possible way. Final decision is to abandon Quartz and implement functionality needed with hosted service. Project due time is getting close and I have decided not to lose any more time on it.

Thank you for your effort on this issue.

1 Like