Difference between class library and ASP.NETvNext class library?

What is the difference between Class Library and ASP.NETvNext Class Library projects? From the creation of the project in VS 14 CTP it seems that the class library has not changed at all, while the โ€œASP.NETvNext Class Libraryโ€ includes a new project.json file. However, it is unclear if it has any advantages related to ASP.NETvNext or not?

This link says that compilation is dynamic for this ASP.NETvNext library project. Are there any other differences between the two?

+5
source share
1 answer

Another advantage is that vNext projects output nuget-packages during assembly, while pre-vNext class libraries only output DLLs. If you specify multiple target frameworks in the project.json file, the nuget-package from the building will contain the DLL created for all of these target frameworks.

An example is the .json project:

 { "dependencies": { "Microsoft.Framework.DependencyInjection": "1.0.0-*", "System.Linq": "4.0.0.0", }, "frameworks": { "net45": {}, "aspnetcore50": {} } } 

If you run the kpm build command from the class library project folder, it will output a nuget package containing the following files.

 lib/aspnetcore50/ProjectName.dll lib/aspnetcore50/ProjectName.xml lib/net45/ProjectName.dll lib/net45/ProjectName.xml 

When you reference this class library from other projects, it will use the correct DLL depending on the target structure that it requires.

+7
source

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


All Articles