Closed mtmulch0191 closed 1 day ago
What command are you using to publish?
I am using dotnet publish
and I also tried publishing to a local folder with Visual Studio.
Try specifying a RID when you publish. Else you are publishing a runtime dependent image.
The RuntimeIdentifiers item group doesn't change that.
https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#runtimeidentifiers
The RuntimeIdentifiers property lets you specify a semicolon-delimited list of runtime identifiers (RIDs) for the project. Use this property if you need to publish for multiple runtimes. RuntimeIdentifiers is used at restore time to ensure the right assets are in the graph.
I was able to get this to work locally on my machine with dotnet publish -r win-x64 --self-contained
. I have some runtime dependencies issues that need to be resolve locally but even with --self-contained
my bundle size is drastically smaller due to IKVM targets not being available and the ASP .NET Core runtimes folder.
It would make sense that if I wanted to publish for x86 I would run another publish command for -r win-x86
.
I have the following configuration in my API's main .csproj. So I want to target win-x64 and win-x86 but when I publish the project I get the entire target set from IKVM.
However if I change
<RuntimeIdentifiers>
to<RuntimeIdentifier>
and target a singular RID it will only output the win-x64.I have to confirm our need for x64 and x86 but I believe x64 should sufficient but I wanted to report this for the project.