Replies: 1 comment 1 reply
-
I'm going to convert this to an issue so that I can move it to NuGet. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
With Visual Studio 2022, I'm trying to automate the building of a Nuget package for a .Net Framework library using MSBuild.
I've followed instructions at https://docs.microsoft.com/en-us/nuget/create-packages/creating-a-package-msbuild
I understand that a .Net Framework project is a non-SDK-Style project, and I added the necessary
PackageOutputPath
and the<PackageReference Include="NuGet.Build.Tasks.Pack" Version="x.x.x"/>
.I'm also using
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
.My problem is the following:
The Nuget Package is created when I'm on Debug, but not when I'm on Release.
My question is:
How to have it built on Release?
For reference here is an expurged version of my .csproj file
I've tried to change the line
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
to
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
But to no avail. I must say that I don't understand the purpose of this line anyway.
It says that if the property
Configuration
is not defined, define it toDebug
, but I fail to understand why this has to be done.[EDIT] I have found the answer to that part here: https://stackoverflow.com/questions/33744624/set-a-default-build-configuration-for-project
Thanks for any input.
Beta Was this translation helpful? Give feedback.
All reactions