Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

.NET 6 console builds correctly as exe but when I pack to NuGet I get a DLL

$
0
0

I have an old console.exe app that builds fine on .NET 4.8, and it packages fine as a NuGet.

Maybe this sounds odd, but the console app doubles as a library that I use in other projects. So, the nuget literally has my console.exe file in it, but I reference it as if it were like any other DLL and it all has worked fine for years.

Recently, I upgraded my *.csproj to the newer style SDK project format, so that I could support both .NET 4.8 and .NET 6.0 simultaneously:

<Project Sdk="Microsoft.NET.Sdk"><PropertyGroup><TargetFrameworks>net48;net60-windows</TargetFrameworks><Platforms>AnyCPU;x64</Platforms><OutputType>Exe</OutputType>

The build output appears to be correct, with the .exe showing up in the bin folder, for each targeted framework:

enter image description here

but when I go to pack the project, I notice that the NuGet only features a *.dll instead of the expected *.exe file:

enter image description here

I see this behavior both on my workstation, as well as the Azure CI build server.


Viewing all articles
Browse latest Browse all 3067

Trending Articles