When I migrate WPF
Project to .NET CORE 3.0
and try to pack assemblies using Costura
I am getting the following error:
The target process exited without raising a CoreCLR started event. Ensure that the target process is configured to use .NET Core. This may be expected if the target process did not run on .NET Core.
The program '[7980] CryptoBot.exe' has exited with code -2147450740 (0x8000808c).
The program '[7980] CryptoBot.exe: Program Trace' has exited with code 0 (0x0).
I found out that the reason for this behavior is that Costura.Fody
doesn't properly handle *.deps.json
file and that it should be 'removed or modified accordingly' by me.
There are two problems with this approach:
First: I am using database.sqlite
file to store the data, removing *.deps.json
will break references to e_sqlite3.dll
and I don't know how to modify it properly (just add sqlite basic packages using nuget to an empty project if you want to check it out):
Second: Even if it did work it doesn't produce a single .exe
file, but rather small .exe
and big .dll
containing the dependencies.
The desired result: I would like it to work exactly as it worked in .NET Framework
, I want single .exe
containing all the .dll
s produced on DEBUG
after pressing CTRL
+ SHIFT
+ B
.
Alternatively, I also tried this:
dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true
but it didn't seem to pack anything at all, it just placed all the .dll
s in the Release\netcoreapp3.0\win-x64
folder.
I PREFER that the app is packed into SINGLE .exe
by using Costura
and NOT anything else.