Msbuild v15 can't resolve the variables of metadata of nuspec file

前端 未结 1 1426
长发绾君心
长发绾君心 2021-01-05 01:58

I know Since the release of msbuild 15 (vs 2017) that NuGet is now fully integrated into MSBuild.

I have a nuspec file with defining variables of package properties

1条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-05 02:38

    As has been mentioned in the comments, you no longer need a Nuspec file as most aspects can be controlled via properties in the csproj file or additional metadata on items (e.g. if you need additional content).

    If you do need a nuspec file for some reason, you need to provide the variables for substitution yourself. You can do this in a target inside the csproj file like this:

    
      
        $(NuspecProperties);id=$(AssemblyName)
        $(NuspecProperties);config=$(Configuration)
        $(NuspecProperties);version=$(PackageVersion)
        $(NuspecProperties);description=$(Description)
        $(NuspecProperties);authors=$(Authors)
      
    
    

    0 讨论(0)
提交回复
热议问题