简体   繁体   中英

Build Class Library (Package) NuGet Package Projects Without Visual Studio

What do I need to do to build the new 'Class Library (Package)' (.xproj) projects (also used by ASP.NET 5) using MSBUILD without having Visual Studio installed? I currently get the error below:

C:\\Source\\MyProject.xproj(7,3): error MSB4019: The imported project "C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v11.0\\DNX\\Microsoft.DNX.Props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

I am only targeting .NET 4.5.2, I have the Microsoft Build Tools 2015 already installed and want to do this on my build server.

UPDATE

It seems I can do a dnu publish to achieve this but that is only for a single .xproj project. What about if I want to publish several projects in a solution for my build environment? Adding projects individually is not very convenient.

Doing MSBUILD MySolution.sln would do this for standard class libraries. Is there a way to get MSBUILD MySolution.sln to work for this case?

Try using dnu build. (VS2015 also using this) All aspnet repro's can be build with the build.cmd without VS2015.

For an example see asp live or datatables

You can use dnu pack to create a nuget package. Type dnu pack --help for more info

Why do you need msbuild?

All you need is dnvm so you can acquire a dnx . After that you can run dnu pack and produce the packages.

Check dnvm list to ensure the version you intend to build with matches what your projects target. If it doesn't, use dnvm use to set it or dnvm install to install it.

Then cd /your/solution/direcotry and;

dnu restore
dnu build *

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM