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?
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.
Use a #pragma warning (C#) or Disable (Visual Basic) directive to suppress the warning for only a specific line of code.
To display the Error List, choose View > Error List, or press Ctrl+\+E.
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.
I experienced the same problem with VS2017 (<nowarn>
attribute didn't work). Adding an empty VersionInfo.cs
prevented the build warning.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With