Abhijit Shelar
Abhijit Shelar

Reputation: 1065

How to change namespace if I have application with abc namespace?

Suppose I have namespace abc and I want to change it with def.xyz Then is there any way other than edit each and every file in my application and make changes?

Upvotes: 1

Views: 113

Answers (2)

Wouter de Kort
Wouter de Kort

Reputation: 39898

If you don't want to use any commercial tools, you will have to do it by hand. A search-replace could help but you need to be careful.

Resharper is a tool that can help you with renaming namespaces.

Upvotes: 1

Oded
Oded

Reputation: 498932

You do need to change the namespace in every file if what you want is to change the namespace to a different one. This can be done using global search and replace (supported by Visual Studio).

If all you want to do is refer to this namespace by a different name, you do not, however need to refer to it as abc in other code, as you can alias a namespace:

using def.xyz = abc;

Upvotes: 1

Related Questions