Visual Studio Auto Namespace change

2019-06-25 08:58发布

In VS2010SP1, i noticed that moving files around in a project from "Root" to a Folder ABC changes the namespace from MyNameSpace.X.Y to MyNameSpace.X.Y.ABC

Is there any option/tweak to prevent that ?

1条回答
甜甜的少女心
2楼-- · 2019-06-25 09:51

Entity framework constructs the entity model from an T4 template (ie creates .cs file on the fly) that's why the namespace changed after move. If you move simple .cs file, it will not change namespace.

To resolve this issue right click on the folder (in solution explorer) and set property "Namespace provider" into false.

Good luck!

查看更多
登录 后发表回答