TFS Build server - CSC : fatal error CS2008: No inputs specified
Asked Answered
H

4

44

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?

Haemoglobin answered 12/6, 2009 at 11:41 Comment(0)
H
45

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.

Haemoglobin answered 12/6, 2009 at 12:20 Comment(4)
+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!Wightman
I had to add a main method in my empty class, I guess the person that added the project made it a console app.Facer
just make sure in the empty .cs file you put a comment/link to this question - or someone in the future is going to be equally confused!Clasp
Downvoted as this is not the best way to solve this problem, an empty class solves nothing and creates a class in a namespace that is simply not required, the correct way to overcome this is to create an assembly info as described below.Conni
U
44

You should add assembly info to the project. This evades the need to create an empty class file.

To create an assembly info file easily, open the project properties, select the application tab, click "Assembly Information", and enter appropriate data. This will automatically create the assemblyinfo.cs file in the appropriate location.

Untread answered 13/12, 2010 at 11:36 Comment(4)
What about Visual Basic projects? I have a "My Project\AssemblyInfo.vb" file instead of a "Properties\AssemblyInfo.cs" file. I still see the error.Microsporophyll
What's the minimum "appropriate data" that needs to be added?Intermix
In fact, nothing at all. But you use it to set assembly information like version, title, guid, etc...Untread
@TimPartridge - We have a vb project, too, and adding the AssemblyInfo.vb worked for me. We're also using Framework 4.5.1, so that could be the difference.Aluino
N
9

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.

Nystrom answered 30/7, 2010 at 20:7 Comment(1)
This is a better way to solve the problem however perhaps we shouldn't use .csproj files in the first place to organise this content in generalConni
D
6

I had the same error with a project that does not have any .cs files. I solved it by adding the following section to the corresponding .csproj-file:

  <PropertyGroup>
    <CoreBuildDependsOn>
    </CoreBuildDependsOn>
  </PropertyGroup>

This way the project will not be built, and there will be no build-output (no DLL is created) Works on both VS and TFS.

Dinothere answered 28/5, 2013 at 8:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.