简体   繁体   中英

How to build solution projects in VSO for ASP.NET MVC 5?

I want to setup building of my ASP.NET 5 project in VSO. The Solution has several projects:

Solution    
    Project1
    Project2
    WebSite

The problem is dependencies on Project1 and Project2 set in project.json and when I run PowerShell script for resolving all dependencies, projects in solution not found. I skip it, but build of solution failed too, because it can't find these projects.

How to configure building in VSO to build non default projects?

If you work with the vNext build system in VSO, all you need to do is to check the Restore NuGet Packages checkbox in the build definition, and choose the .sln file you would like to build.

在此处输入图片说明

If you work with one XAML build definition , there are some steps (described here ) you need to follow in order to have these NuGet packages restored during the VSO (TFS) build process.

  1. Add following items to the solution. (Content of the nuget.config and .tfignore file can be found here )

在此处输入图片说明

  1. Add one build.proj file under the root path of the solution folder. (Content of the build.proj file can be found here )

  2. Create one folder named tools under the root path of the solution folder. Create NuGet sub-folder under tools folder, download and save nuget.exe under tools\\NuGet path.

  3. Check in nuget.config , .tfignore , build.proj and tools\\NuGet\\nuget.exe into TFS version control.

  4. Modify the build definition to choose to build the build.proj file. 在此处输入图片说明

Then you will have NuGet packages restored successfully during the TFS build process.

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