1
To generate/publish an application on net-core use the command:
dotnet publish -c Release --self-contained
If you have configured the .csproj
with <RuntimeIdentifier>
, or else use this (example if publishing to windows 10 64bit):
dotnet publish -c Release --self-contained -r windows10-x64
However when publishing I noticed that all dlls are sent, many that I don’t even use in my project, example:
Really the application only uses a few things and the only lib that I added via nuget I’m sure doesn’t use so many things, this really is normal when publishing with --self-contained
, or it is possible to limit only the necessary?
If you publish an application with the option --self-contained will be published next to the application the full run-time of [tag:net-core]. To limit the necessary to self-contained deployment should be passed over in favour of a structure-dependent deployment option...
– Augusto Vasques
... and therefore a comment and not an answer, because an answer would be outside the scope of the question.
– Augusto Vasques
@Augustovasques to tell you the truth, I already know the answer, but I leave it to other people to try to solve, there is way to soften, going only what is necessary, of course including the net-core-Runtime, which is a lot, but saves about 20mb on average in a simple application.
– Guilherme Nascimento
But how so saving memory with full Runtime-time. Are you talking about the warp netcore? If it is I do not know how to use it, but I know that significantly decreases the result.
– Augusto Vasques
@Augustovasques no, dll q really isn’t necessary, it’s just that it saves 20mb of space, or dlls, but depending on what you imported or added in the nuget it doesn’t even have effect, is that I was expecting a reasonable answer, but I’ll answer it myself, I’m just finishing up other open-source stuff here :)
– Guilherme Nascimento