C
Join ServerC#
help
How do i publish an asp.net Core application
Jjohnk10/18/2022
I can't use
dotnet publish
as i use COM references, but i need a release build of my aspnetcore project with the Production appsettingsCCisien10/18/2022
why can't you use dotnet publish?
CCisien10/18/2022
you probably need to set a runtime identifier. <RuntimeIdentifier>win-x64</RuntimeIdentifier> in your csproj, then
dotnet publish -c Release -r win-x64
and maybe --self-contained or whatever else you wantCCisien10/18/2022
@johnk
Jjohnk10/18/2022
Coz it’s got a COMReference and apparently only .NET framework MSBuild supports that
Jjohnk10/18/2022
It builds fine through visual studio
CCisien10/18/2022
dotnet uses msbuild behind the scenes
CCisien10/18/2022
maybe try with dotnet msbuild -t publish (or however you call msbuild steps)
CCisien10/18/2022
-target:Publish
CCisien10/18/2022
CCisien10/18/2022
i guess this, huh? https://github.com/dotnet/msbuild/issues/3986
CCisien10/18/2022
seems the solution is to use msbuild directly, and not through the dotnet cli
CCisien10/18/2022
one comment says
msbuild /property:GenerateFullPaths=true /t:build /consoleloggerparameters:NoSummary
worked for themCCisien10/18/2022
you can probably target publish, or anything else you need