删除 userControls 后出现 Visual Studio 命名空间错误
确实,Visual Studio 有时会很烦人...
我除了删除文件夹中的 3 个 UserControls 之外什么也没做。从那时起我收到一条错误消息,但我没有摆脱它。无论我做什么,我都无法成功构建我的项目。
我没有触及 SchoolAdministrationUC.xaml 文件,但我删除了位于以下路径中的其他 3 个 UserControl:TBM\View\SchoolclassAdministration\ 来自
VS 的错误消息:
错误 1 类型或命名空间名称“SchoolclassAdministration”位于命名空间“TBM.View”中无法使用。 (缺少程序集引用?) E:\TBM\obj\x86\Debug\View\SchoolclassAdministration\SchoolAdministrationUC.g.cs 33 16 TBM
如何消除错误?
Really Visual Studio can be so annoying sometimes...
I did nothing else than deleting 3 UserControls in a folder. Since that time I get a error message I do not get rid of. Whatever I do I can not build successfully my project.
I did not touch the SchoolAdministrationUC.xaml file , but I deleted 3 other UserControls also located in the path: TBM\View\SchoolclassAdministration\
Error message from VS:
Error 1 The type or namespacename "SchoolclassAdministration" is in namespace "TBM.View" not available. (missing assembly reference?) E:\TBM\obj\x86\Debug\View\SchoolclassAdministration\SchoolAdministrationUC.g.cs 33 16 TBM
How do I get rid of error ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,事实上它显示了 obj 文件夹作为错误所在,您是否尝试过干净的构建?还是彻底重建?
听起来好像有一个对象在寻找不存在的名称空间。
构建->重建解决方案
Well, the fact that it shows the obj folder as where the error is, have you tried a clean build? Or a complete rebuild?
Sounds like there is an object out there looking for a non-existent namespace.
Build -> Rebuild Solution
当您无意中创建一个新的 Windows 应用程序项目以在同一项目文件夹中添加类库项目的现有代码时,会出现此错误。如果原始类库项目与 VS 不兼容或者您有任何其他问题,则可以选择创建新的类库。
This error comes up when you unwittingly create a new Windows application Project to add the existing code for a class library project in the same project folder. If the original class library project is not compatible with VS or you have any other issue then creating a new class class library is an option.