Create one web project from a solution with multiple web projects in Visual Studio Online Build Definition

I had a problem when I need to create only one web project from a solution with two web projects in Visual Studio Online.

  • I did not find how to create only one project using the "Visual Studio Build" step.

It would be great if there was such a way to do this with the "Visual Studio Build" step.

  • I also tried using the "MSBuild" step. Unfortunately, I had a problem restoring packages using Nuget. I got the error: ## [error] No file format header, ## [error] Unexpected exit code 1 returned from the NuGet.exe tool. Immediately after starting: Nuget.exe restore Myproj.csproj .

In summary:

How can I create only one web project from a solution with several web projects in the definition of an online build of a visual studio?

Update

Here is an image of the error when I build. I also get this using the "Visual Studio Build" or "MSBuild" step.

enter image description here

Also

I found a comment from chrisrpatterson on VSO: https://github.com/Microsoft/vso-agent-tasks/issues/571

As he says: you cannot run nuget recovery against everything except the SLN file. You must disable nuget recovery packages in this vsbuild task.

But I need packages, and I don't want to embed my package folder in my repo.

So, how can I restore packages and run only one web project from my solution in the "Visual Studio Build" phase?

+7
c # msbuild vsts vsts-build
source share
3 answers

Instead of choosing a .sln file, you need to select a .proj file.

First, click the ellipsis button next to the Solution box. enter image description here

Then select the .proj file you want to create. For example, the screenshot below shows that the assembly definition is configured to create the ClassLibrary1 project instead of the entire solution (contains the ClassLibrary1 and ClassLibrary4 project) enter image description here

+13
source share

You can add the new Azure Application Service Deployment task to your build definition and set the Package or Folder field to $ (build.artifactstagingdirectory) ** \ YOURPROJECT.zip

0
source share

You might want to create a solution only with the web project that you want to create.

In the visual studio you can create a new project, and in this dialog box select "other types of projects \ solution".

The new solution may be located next to the existing one.

-3
source share

All Articles