"OutputPath property is not set for this project" in VS 2010

by mheydt 4. July 2009 16:15 >
Last night I was porting some of my TweetZenn project over to VS2010 and came across this error in the build. It took quite a bit of googling to figure out what caused this as well as how to solve it, and many of the answers I found where also not related to the type of solution I was building (most seemed related to Azure development), so that made it a bit complicated also. But I have reduced this to a very simple scenario and solution, which I'll show here for everyone.

The problem can be reproduced very simply. Take this scenario:

1) Create a new Silverlight solution in 2010. Call it anything, but in this expositionI will call it OutputPathTest.
2) Add a C# windows library to the solution. I calle it "ALibrary" Now build the solution. Everything works fine.
3) Now add a reference to "ALibrary" in your web project and build (not that you didn't even need to add any classes to ALibrary). You now get the OutputPath error message:



4) Remove the reference to ALibrary and build, and it builds properly.

So, this problem seems to be related to the reference to ALibrary causing the problem. But how to solve this?

Well, it appears you need to manually edit the .csproj for ALibrary. Open the file in your favorite text editor; I'm using notepad2, and the following shows the culprits identified with red arrows:



The project is set to target x86 while the web solution is set to AnyCPU. To fix the problem, it is needed to change the mentions of x86 to AnyCPU. Do that, rebuild the solution, and everything will work perfectly.

Tags:

C# | VS2010

blog comments powered by Disqus

about the author

I'm a .NET, XAML, and iOS polyglot that loves playing with new things and making cool and innovative stuff.  I am also a Mac junkie.

I am Principal Technologist for SunGard Global Services in NYC, in their Advanced Technologies practice, and I work extensively with SunGard's energy and financial customers.

Note the the posting on this blog are my own and do not represent the position, strategies or opinions of SGS.

twitter

I can't stop thinking big!
Sunday 1:08AM via WindowsLive
Just watched Moneyball. That's my pick for best movie this year.
Saturday 3:51PM via WindowsLive
@vincebelpiede: Report: Skype For Windows Phone Beta Imminent http://t.co/KYNjgg1L#mhtnd
Wednesday 8:39AM via Twitter for Mac
@mashable: Kinect Fusion Will Turn Gaming (and More) Into a 3D Fun House - http://t.co/Ihrq2fY2#mhtnd
Wednesday 8:39AM via Twitter for Mac
New Kinect SDK: http://t.co/57MvA5L5 #mhtnd
Wednesday 8:39AM via Twitter for Mac
Follow me on Twitter

recent comments

None

month list