views:

1455

answers:

2

We get the above error message on our build server, when we build the solution or the specific project that the error refers to.

We can build the solution without any problem using visual studio (also on the build server), however it fails with the above error when running msbuild.

Any Ideas?

+10  A: 

I found the solution.

There is a "bug" in msbuild, that results in it failing when there are not source files in the project. For example Filename.cs.

Our project only had xml and other file types.

Just added an empty cs file and it worked.

Shiraz Bhaiji
+1 (I came here looking for a better answer, but I guess if this is all we can get, so be it!). Still present in 3.5 SP1. MS people not busy waiting for Connect to refresh, please note!
Ruben Bartelink
I had to add a main method in my empty class, I guess the person that added the project made it a console app.
aceinthehole
A: 

I also got this error message when "building" a project which didn't have any *.cs files...but we do that fairly often for SharePoint projects which are just XML. the VS project is just to organize some of the XML documents. Long story short the problem was that there was AssemblyInfo.cs file. After adding some assembly info to the project properties, voila! It worked. So I guess, yes, you need a .cs file to actually compile anything, but the AssemblyInfo.cs is enough.