How to set up Visual Studio 2013 projects to create nuget packages with multiple .Net versions?

We have several different teams creating C # applications with Visual Studio. When we want to share libraries between teams, we create nuget packages for libraries and add them to the local nuget feed.

The process we use to package our libraries is very simple: we create .nuspec for the library, and then run nuget in the .csproj project to create the package.

As a result, a package is created that is specific to the .Net version (4.0, 4.5, 4.5.1) selected for the .csproj project for the project. We standardized quite a lot on 4.5 to handle this.

Many publicly available nuget packages provide simultaneous support for different versions of libraries, and we would like our packages to do the same, so that each of our teams can choose the appropriate version of .Net for them. I know, in principle, how to build a package this way, but it involves moving files to different folders and accessing the nuget package at a lower level. I don’t know how it can be automated so that it can be easily found in our teams.

So my question is: is there a simple / standard way to set up a library project in Visual Studio so that it creates a cross-version compatible Nuget package?

+4
source share
2 answers

Not a direct answer to your question, I know this, but ...

?

NuGet , . , NuGet , , .

, , , . , 3.5, NuGet, , / , 3.5. , , , 4.5 ( , ). .

, , , . / . , - , / Async/Await.

TL; DR: . . , 3,5 4. (, , 2.0...)

+2

, ( .csproj), . "Debug" "Release", "x86_Debug" .. , Release_Fw_40, Release_Fw_45, Release_Fw_451.

Nuget

   -Prop Configuration=Release_Fw_40

, , Nuget. , , .

, , , . , "Fw 4.5.1", Fw 4.0 , Fw 4.0. , .

, , , nuget . , , .

, , , , . " " " nuget " - , . Windows Powershell, , .

+2

Source: https://habr.com/ru/post/1618631/


All Articles