How to assemble .NET Core project under ubuntu in a single file?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
23 views
On .NET Core is implemented console netcoreapp2.0 app on ubuntu and ubuntu on the same project going.

Publish command
dotnet publish-release c-r ubuntu.16.04-x64

Project going and finished project with all necessary libraries and other dependencies is in the publish folder, which can be transferred to any ubuntu server and there it will work fine, but I would like to Tuscany, not the whole folder with a bunch of libraries, but only a single executable file, well or though as-that to reduce the number of files in the output.

So is it possible and if so how to realize it, and in what ways?
by | 23 views

3 Answers

0 like 0 dislike
There's something about this, but I would say it's not quite something and while it's in pre-alpha state. The end result is one of "bold" Executive file.

UPD. Still have this, but the campaign there will be even more crutches
by
0 like 0 dislike
In theory, you can build deb-package, which will be your app.
Still, it is possible to look here - https://docs.snapcraft.io/build-snaps/your-first-snap
by
0 like 0 dislike
This applies not only to Core Ubuntu. To normal .Net under Windows, too.
Solve this problem by adding all the dependencies of the executable file (for example .exe) in resources of this .exe. Then when you run the application registers an event handler for the AppDomain.AssemblyResolve, which gets the right Assembly of resources, loads it into the domain and returns a reference to her environment. AppDomain.AssemblyResolve is called every time an application needs some kind of dependence.
It's simple and easy implemented, while it does not take much time.
There are also libraries, which are built into the build process and allow this thing to automate. The above has already been mentioned ILMerge, there's also Fody, there are some analogues.
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,187 answers
0 comments
40,796 users