NuGet: references to assemblies in runtimes folder not added

后端 未结 6 1900
孤独总比滥情好
孤独总比滥情好 2021-01-01 15:23

I have a project that targets two different operating systems/frameworks:

  1. net461 on Windows and
  2. netcoreapp2.0 on OSX
  3. <
6条回答
  •  爱一瞬间的悲伤
    2021-01-01 16:20

    Are you using the new csproj format? If so it has built in support for multiple target frameworks.

    For example running dotnet pack against a .csproj file with this content:

        
      
        net461;netcoreapp2.1;netstandard2.0
          
    
    

    will result in a .nupkg that works for .NET Framework 4.6.1, .NET Core 2.1 and .NET Standard 2.0.

    Various trick can then be used to include specific parts for each framework depending on what's available.

提交回复
热议问题