I try to publish a .net Core (WinForms) project, which I upgraded from core3.0 to net5.0, as Single Exe.
I get the following error:
NETSDK1142: Including symbols in a single file bundle is not supported when publishing for .NET5 or higher.
researching NETSDK1142 I do not get any results in google regarding a fix.
With Core3.0 the following command worked:
dotnet publish nameofproject.csproj \
-o bin/Release/core \
-c Release \
-p:Platform=x64 \
-r win-x64 \
--self-contained true
I also tried the following flags for net5.0. Still getting the same error even with DebugSymbols=false
dotnet publish nameofproject.csproj \
-o bin/Release/core \
-c Release \
-p:Platform=x64 \
-p:NoWarn=CS0618 \
-p:NoWarn=NU1605 \
--self-contained true \
-p:PublishSingleFile=true \
-p:IncludeAllContentForSelfExtract=true \
-p:PublishReadyToRun=true \
-p:PublishTrimmed=false \
-p:IncludeNativeLibrariesForSelfExtract=true \
/p:DebugType=None /p:DebugSymbols=false