我有一个大约有10个项目的解决方案,我自己还没有写任何内容,但是我将在这里接管一个项目。作为主要项目的项目基于WPF。当我尝试运行此项目时,出现以下编译器错误:

The tag 'RoutingManagerView' does not exist in XML namespace 'clr-namespace:RoutingManager.Views;assembly=RoutingManager'. Line 29 Position 14. C:\Source\WSA\WsaClient\Views\MainView.xaml 29 14 WsaClient

然后,如果我双击此错误消息,以便打开xaml,并加载了设计器,则设计器没有加载,并且我又收到3条错误消息:

Unable to load the metadata for assembly 'WsaClient'. This assembly may have been downloaded from the web. See http://go.microsoft.com/fwlink/?LinkId=179545. The following error was encountered during load: Could not load file or assembly 'WsaClient' or one of its dependencies. The system cannot find the file specified. C:\Source\WSA\WsaClient\Views\MainView.xaml 1 1 WsaClient

Unable to load the metadata for assembly 'RoutingManager'. This assembly may have been downloaded from the web. See http://go.microsoft.com/fwlink/?LinkId=179545. The following error was encountered during load: Could not load file or assembly 'RoutingManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. C:\Steria\Forsvaret\P6088\Source\WSA\WsaClient\Views\MainView.xaml 1 1 WsaClient

The type 'Views:RoutingManagerView' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Source\WSA\WsaClient\Views\MainView.xaml 29 14 WsaClient

我用谷歌搜索,很多人认为这是因为DLL源自互联网,因此被锁定了。但是在我的情况下,我没有DLL。该解决方案涉及两个项目,即WsaManager和RoutingManager。我将所有源代码保存在USB笔上的zip文件中,并且将其提取到c驱动器的某个位置,因此无法远程访问代码。

如果任何人之前有相同或相似的问题,我将非常感谢任何有关如何解决此问题的指导。

编辑

在XAML文件的这一行上给出了最后一条错误消息:

<Views:RoutingManagerView DataContext="{Binding Dependency}"/>


在XAML文件的顶部,这是程序集的导入:

xmlns:Views="clr-namespace:RoutingManager.Views;assembly=RoutingManager"

最佳答案

通过右键单击解决方案并选择“重建解决方案”来解决此问题

关于c# - 解决方案中的错误消息出现问题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/5832017/

10-13 07:46
查看更多