Dave
Dave

Reputation: 14178

Disable Visual Studio warning CS2008

I have a visual studio project (VS2012) that just contains some configuration files. When I build I get the following warning:

CSC : warning CS2008: No source files specified [C:\Project\Config\Config.csproj]

Is there any way to disable this warning?

Upvotes: 6

Views: 2323

Answers (2)

agent-j
agent-j

Reputation: 27913

I experienced the same problem with VS2017 (<nowarn> attribute didn't work). Adding an empty VersionInfo.cs prevented the build warning.

Upvotes: 4

Guttsy
Guttsy

Reputation: 2119

Go to the project's property page in your Solution Explorer. On the build tab, you can disable the warning using its warning number.

This describes the options available there: http://msdn.microsoft.com/en-us/library/vstudio/kb4wyys2(v=vs.100).aspx

If you ever have actual code that triggers warnings, it can be disabled like so: http://msdn.microsoft.com/en-us/library/vstudio/441722ys(v=vs.120).aspx

Upvotes: -1

Related Questions