Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2013 Solution building not in build order

I am having problems getting my C# Solution to build "Fresh". If I clean the solution and build it again it will not build (I can do it a few times and it will build). It has an error about the azure project getting build before the worker and web projects that it is dependent on. Also about how most of the projects in the solution are looking for

WAT070 : The referenced assembly {...}/Worker.dll was not found.  Please make sure to build the role project that produces this assembly before building this Windows Azure Cloud Service Project. {...}\VisualStudio\v12.0\Windows Azure Tools\2.2\Microsoft.WindowsAzure.targets 1252    5   AzureProjectName 

Now if I build the projects in the order listed in the Project Dependencies -> Build Order everything works. Also, the web and work role are listed before Azure Project.

like image 332
lockwobr Avatar asked Dec 06 '13 15:12

lockwobr


People also ask

How do I change the build order in Visual Studio?

Just right click the Solution node and select "Project Build Order".

How do I change the build order on a project?

When you click Project > Optimize EGL Project Build Order, EGL attempts to move projects that are involved in cycles to a more optimal spot in the build order. You can manually change the build order through the workspace preferences (Window > Preferences > General > Workspace > Build Order).

How do I find the build order in Visual Studio?

In order to set the Build order for your Solution, right-click on the Solution in Solution Explorer and Select Project Build Order: Your Project Dependencies should be set correctly which is used to determine the Build order by Visual Studio.

How do I change the build order in Visual Studio 2017?

The solution I found was to do the following: Open up the . sln file, and change the order in which they projects are listed. Dropping MainProject down to the bottom.


1 Answers

Solution is very simple.

You can set your project build order by right click on 'Project Solution' and select "Select Project Build Order" option.

enter image description here

For Example, I have a WpfFormApplicaiton1 and two class with title "ClassLibrary1" and "ClassLibrary2". By default Visual Studio sets it as follow:

enter image description here

My requirement is such as "ClassLibrary2" will be used by "ClassLibrary1" & "ClassLibrary1" will be used by "WpfFormApplication1". So, in order to fulfill this requirement I have to change the default project build order.

Go to Project Dependencies; Select the "ClassLibrary1" and set the "ClassLibrary2" as its dependency.

enter image description here

Similary, select the "WpfFormApplication1" and set the "ClassLibrary1" as its dependency.

enter image description here

Now, the desired project build order is set; confirmed by Project Build Order's options.

enter image description here

Solution is taken from my blog.

like image 139
Hassan Rahman Avatar answered Oct 04 '22 11:10

Hassan Rahman