user2814080
user2814080

Reputation:

Visual Studio 2012 gives ridiculous errors

My visual studio doesn't build the solution if any of the following errors occurs:

1. Invalid spacing around ';'
2. All private methods must be declared after protected.
3. Constructor must be placed before method declarations.
4. Must use curly brackets in if condition.
5. Use string.empty instead of "".

Now I know we should follow correct coding practice, but I'm working on an old code that has these kinds of things. Its hard to change each and every file. How can I stop VS from giving these kinds of errors?

Upvotes: 1

Views: 99

Answers (2)

zaitsman
zaitsman

Reputation: 9499

Seems you're using Stylecop on a non-compliant solution. Create a setting file 'Settings.StyleCop' in the directory containing the *.sln file. Add the following contents to the file:

<StyleCopSettings Version="105">
  <GlobalSettings>
    <BooleanProperty Name="RulesEnabledByDefault">False</BooleanProperty>
  </GlobalSettings>
</StyleCopSettings>

Upvotes: 2

dimlucas
dimlucas

Reputation: 5131

This is either caused by a plugin like Resharper or StyleCop. You can turn off some of these warnings or disable the plugin completely.

Upvotes: 2

Related Questions