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

a 夏天 提交于 2019-12-03 04:04:49

问题


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?


回答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.




回答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.




回答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.




回答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.



来源:https://stackoverflow.com/questions/986221/tfs-build-server-csc-fatal-error-cs2008-no-inputs-specified

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!