Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 684
Dave Avatar asked Sep 19 '13 17:09

Dave


People also ask

How do I turn off warnings in Visual Studio?

Suppress specific warnings for Visual C# or F# Or, select the project node and press Alt+Enter. Choose Build, and go to the Errors and warnings subsection. In the Suppress warnings or Suppress specific warnings box, specify the error codes of the warnings that you want to suppress, separated by semicolons.

How do I ignore warnings in C#?

Use a #pragma warning (C#) or Disable (Visual Basic) directive to suppress the warning for only a specific line of code.

How do I see warnings in Visual Studio?

To display the Error List, choose View > Error List, or press Ctrl+\+E.

What is pragma warning in C#?

C# provides a feature known as the #pragma feature to remove the warnings. Sometimes we declare a variable but do not use the variable anywhere in the entire program so when we debug our code the compiler gives a warning so using the #pragma we can disable these types of warnings.


1 Answers

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

like image 183
agent-j Avatar answered Nov 15 '22 06:11

agent-j