Multi-framework NuGet build with symbols for internal dependency management

后端 未结 3 1061
执笔经年
执笔经年 2021-01-31 10:47

Maybe I\'m pushing the envelope here, but I\'m desperate to leverage NuGet to ease the DLL Hell that I\'ve found myself in.

We have 4 main products that all live in inte

3条回答
  •  你的背包
    2021-01-31 11:07

    You know there is a third option? When targeting a csproj file, it will also look for a nuspec file with the same name as your project file (myProject.csproj --> myProject.nuspec). This means that you can add extra metadata to the resulting package by defining it into the nuspec file, whilst still targeting your csproj file. In essence, you'll end up with a package containing the merged metadata from your csproj file and nuspec file.

    In your specific scenario, if you want to package multiple platform builds of the same project, you'll indeed have to build those projects first before packaging using the nuspec.

    I'd advise you to create two projects, one targeting NET35, the other one targeting NET40, and adding the files as links into one of the projects. As such you can build both projects, and package all output in one NuGet package using a nuspec file.

    Now as for symbols, I think you could have a second nuspec file (myProject.symbols.nuspec for instance), where you could add all contents of the project (sources etc) using wildcard characters, similar to what's shown below.

    
    
    
    
    
    

    Hope this helps or at least provides you some info to find a way out :)

    Cheers, Xavier

提交回复
热议问题