Avoid using VAR in program code

Dear Community,

I do not want to use the variable 'var' at all.

It is a coding Guideline in our Company.

Where can I switch that behavior off?

I uploaded the file ResharperWrongSetting.png.

I just found the Setting "Use preferred 'var' style". But if I select Hint, Warning, Error nothing happen.

The imporant part is if I use the function Join declaration and assignment. The variable is always var than.

Regards Chris

Comment actions Permalink

did you try "Enforce var keyword usage settings" in code cleanup? If you set the "var usage in declarations" options to "Use explicit type" in the code style options, your preferences should be enforced if you do a code cleanup.




Comment actions Permalink

Dear Andreas,

I set now Use explicit or implicit modifier for types and I set that for type memebers.

I saved the Profile on my computer and on the Project.

Reloading VS and the Project.

Unfortunately not successfull.

Regards Chris


Please sign in to leave a comment.