The Fix Namespace Mismatch quick fix is available once JustCode has detected a namespace that doesn't match the defined default namespace for that project. JustCode underlines the namespace or the class (can be configured in the options) and suggests you to automatically rename it so that it matches the default namespace.
Note |
|---|
Language Support Supported: C#, VB.NET Not relevant: ASP.NET, XAML, JavaScript, HTML |
Suppose we have the following code:
Lets set the default namespace for the project in Project -> Properties -> Application:
In the solution explorer we have put the class in a folder as follows:
JustCode will match the folders and subnamespaces and add a warning if they don't match.
To fix the namespace mismatch on the namespace identifier:
- Position the caret over the namespace identifier.
Press Alt+Enter. From the pop-up menu, select Fix Namespace
The result is:
To fix the namespace mismatch on the class identifier:
- Position the caret over the class identifier.
Press Alt+Enter. From the pop-up menu, select Move Type To Namespace 'SomeNamespace.SubNamespace'.
The result is:
See Also