Louis Rhys
Louis Rhys

Reputation: 35627

Can I specify default "using"s to be added by resharper?

By default, Resharper does not specify any usings in .cs files. Is it possible to configure it to add one or two usings by default

Upvotes: 3

Views: 178

Answers (2)

Dmitry Osinovskiy
Dmitry Osinovskiy

Reputation: 10118

First of all, you can use a special kind of intellisense called Import symbol (Shift-Alt-Space) instead. It would show you all available methods regardless of their namespace and then it would import everything.

But if you still want additional usings, then in addition to advice from @Hadi Eskandari I can suggest to go to ReSharper | Options -> Code Editing | C# | Namespace imports and add your namespaces to "Namespaces that should always be imported". This way ReSharper would not suggest to remove your namespaces and would always add them during Code Cleanup.

Upvotes: 4

Hadi Eskandari
Hadi Eskandari

Reputation: 26354

Goto Resharper -> Template Explorer... menu and from there choose File Templates tab and on the screen select Class template and customize that. Now when you create a new class using Resharper's New From Template item in the context menu, you'll get the template you want.

Upvotes: 2

Related Questions