Home > Blockchain >  Define variables in csproj SDK style
Define variables in csproj SDK style

Time:03-16

I have converted a WPF project to the new csproj SDK format. It shows some properties such as:

Company: $(Authors)

Where do I define the variable $(Authors) and similar such variables? I am building my project both locally and in Azure DevOps.

CodePudding user response:

This is MSBuild specific, it does not depend on SDK project style in particular, see:

Define a tag with the name of the property inside a PropertyGroup.

<Project Sdk="Microsoft.NET.Sdk">

   <!-- ... -->

   <PropertyGroup>
      <Authors>John Doe, Jane Doe</Authors>
   </PropertyGroup>
   
   <!-- ... -->

</Project>

Since you refer to a property named Authors, you probably mean a special property that is used for NuGet packaging, see pack target inputs and Package properties.

  • Related