3

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).

enter image description here

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):

enter image description here

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 .dlls 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 .dlls 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.

rvnlord
  • 3,487
  • 3
  • 23
  • 32
  • Have you tried to run `dotnet publish` with `--self-contained true` argument? Btw, which version of .net core 3 are you using? – Pavel Anikhouski Oct 08 '19 at 17:24
  • Yes. Newest available non-preview. I would prefer that it is packed by `Costura` if possible though. – rvnlord Oct 08 '19 at 20:52
  • Costura is being deprecated https://github.com/Fody/Costura/issues/442 so you should probably stop using it – Simon Oct 29 '19 at 02:26

0 Answers0