I'm facing a problem where I need to build only one web project from a solution with two web projects in Visual Studio Online.
It would be great if exist such a way to do this with "Visual Studio Build" step.
Summarizing:
How can I build only one web project from a solution with multiple web projects in visual studio online build definition?
Here is an image of the error when I'm building. Also i'm getting this using "Visual Studio Build" step or "MSBuild" step.
I found a comment from chrisrpatterson in a VSO issue: https://github.com/Microsoft/vso-agent-tasks/issues/571
Which he says: You can't run nuget restore against anything other than an SLN file. You should uncheck restore nuget packages on that vsbuild task.
But I need the packages, and I don't want to push my packages folder into my repo.
So, how can I restore the packages and run only one web project from my solution in "Visual Studio Build" step?
Solutions are essentially groups of projects. Most software applications involve more than one project, and so virtually every software application has a solution file organizing said projects. Sometimes, solutions have more than one application in them. Or they have lots of unrelated projects in them.
A project is contained within a solution. Despite its name, a solution isn't an "answer". It's simply a container for one or more related projects, along with build information, Visual Studio window settings, and any miscellaneous files that aren't associated with a particular project.
Instead of choosing the .sln file, you need to select the .proj file.
Firstly, click the ellipsis button next to the Solution field.
Then choose the .proj file you want to build. For example, the screenshot below shows that the build definition is configured to build the ClassLibrary1 project, instead of the whole solution (contains ClassLibrary1 and ClassLibrary4 project)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With