Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using different references in Visual Studio 2010 for different build platforms?

How do I set up a VS2010 project so that it uses different references based on the chosen platform? In practice, I would like to link a 32-bit library when I choose x86 as platform, but the 64-bit version of it when I choose x64.

Any idea on how to get this swap done for a C# VS2010 project?

like image 264
Sklivvz Avatar asked Feb 22 '11 15:02

Sklivvz


People also ask

How do I add references from one project to another in Visual Studio?

You can also right-click the project node and select Add > Project Reference. If you see a References node in Solution Explorer, you can use the right-click context menu to choose Add Reference. Or, right-click the project node and select Add > Reference.

How do I resolve a reference problem in Visual Studio?

To fix a broken project reference by correcting the reference path. In Solution Explorer, right-click your project node, and then select Properties. The Project Designer appears. If you're using Visual Basic, select the References page, and then click the Reference Paths button.


1 Answers

Haven't tried it, but possibly you'll need to edit the project file and hack the Conditions into the ItemGroup with the references.

Here you go, found an SO question here with the answer.

like image 140
Ralf de Kleine Avatar answered Oct 12 '22 15:10

Ralf de Kleine