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

16,602

Solution 1

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.

Solution 2

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.

Solution 3

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.

Solution 4

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.

Share:
16,602

Related videos on Youtube

Shiraz Bhaiji
Author by

Shiraz Bhaiji

Architect / dev lead / .net programmer Manager at Evry http://www.evry.no/ Board Member Oslo Software Architecture http://www.meetup.com/Oslo-Software-Architecture/

Updated on May 28, 2020

Comments

  • Shiraz Bhaiji
    Shiraz Bhaiji almost 4 years

    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?

  • Raymond
    Raymond about 14 years
    +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!
  • aceinthehole
    aceinthehole over 13 years
    I had to add a main method in my empty class, I guess the person that added the project made it a console app.
  • aruno
    aruno over 13 years
    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!
  • krystan honour
    krystan honour over 12 years
    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.
  • krystan honour
    krystan honour over 12 years
    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 general
  • Tim Partridge
    Tim Partridge over 11 years
    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.
  • Kenny Evitt
    Kenny Evitt about 11 years
    What's the minimum "appropriate data" that needs to be added?
  • ranthonissen
    ranthonissen about 11 years
    In fact, nothing at all. But you use it to set assembly information like version, title, guid, etc...
  • thecoolmacdude
    thecoolmacdude over 7 years
    @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.