2

I like having my warning level set at W4 but all new projects start at W3. Is there some way to change the default value for warning levels for new projects?

2 Answers 2

2

I don't know how to do it at the IDE but you cand always edit the new project templates at:

%PROGRAM_FILES%\Microsoft Visual Studio 9.0\Common7\IDE\ProjectTemplates\

If you're using the express version there could be a minor variation in the path:

%PROGRAM_FILES%\Microsoft Visual Studio 9.0\Common7\IDE\{Version}\ProjectTemplates\

Where {Version} is the express flavor you are using, VCSExpress, VBExpress, etc.

The templates are zip files, just edit the project changing:

<WarningLevel>3</WarningLevel>

to

<WarningLevel>4</WarningLevel>
2
  • What file types are the templates? Neither of those directories exist on my machine. Oct 4, 2008 at 0:57
  • The templates are csproj files inside a zip file, like 1033.zip
    – albertein
    Oct 4, 2008 at 16:28
0

I couldn't find any project templates or anything on my machine so I just searched in all the files for WarningLevel. I found common.js at

%\Microsoft Visual Studio 9.0\VC\VCWizards\1033

Searching in the file showed WarningLevel appeared in three places, lines 672, 699 and 3354. I simply changed the three lines reading

CLTool.WarningLevel = WarningLevel_3;

to

CLTool.WarningLevel = WarningLevel_4;

When I made a new project it was set at /w4. So this worked for me, won't guarantee it won't hose your machine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.