Whenever I add a new VB.NET class, VS 2015 totally ignores any namespace declaration, because it's "automatically in the default namespace, but I want my classes namespaced by folder name as well. Plus I want explicit namespace declarations on all my classes.
Right now, I add a class, ReSharper squiggles it, and I elect to have it moved to the correct namespace. Is there no VS setting to always include the namespace 'wrapper' when creating a new VB.NET class?
There's no setting for that in VS. You have to manually fight the VB framework in this case.
Hand-edit the project file, setting RootNamespace to an empty string.
<RootNamespace></RootNamespace>
Reload the project and create your folder structure.
Namespaces will work like C# without VS or Resharper complaining:
You can only change the root namespace for a project:
1- With a project selected in Solution Explorer, on the Project menu, click Properties.
2- Click the Application tab.
3- In the Root namespace field, enter the name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With