wpf - 自定义 WPF 命名空间映射在 Visual Studio 2010 中失败

标签 wpf visual-studio-2010 namespaces

我刚刚安装了 Visual Studio 2010 并将我的 Visual Studio 2008 WPF 项目之一转换为测试。虽然项目构建和运行正常,但 VS 设计器无法处理我给出的错误的自定义命名空间映射:

Assembly must be specified for XAML files that are not part of a project. Reopen this XAML file after adding it to a project, close this file and reopen it using the project it is associated with, or modify the clr-namespace to include the name of the assembly.



有问题的命名空间是项目的一部分。 Visual Studio 2008 的 XAML 没有问题。所以我创建了一个新的空白 WPF 项目,名为 Test1命名空间为 Test1 .然后我编辑了生成的 MainWindow.xaml 来为 local 添加单个映射。 :
<Window x:Class="Test1.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Test1"
    Title="MainWindow" Height="350" Width="525">
    <Grid />
</Window>

这给出了相同的错误。而且,令人惊讶的是,Google 没有报告该错误的结果!我尝试了一些变体,例如附加 ;assembly=;assembly=Test1 ,但这没有帮助。

谁能发现我做错了什么?如果没有,我将非常感谢有关为什么这可能会失败的建议。

编辑:根据评论,事实证明这仅在从网络共享打开项目时发生。如果在本地驱动器上打开项目,则不会发生这种情况。但是,我希望能够在网络共享上打开它,因此我将问题悬而未决。

最佳答案

尼尔艾伦是对的。将文件夹映射为驱动器,一切都会好起来的。
如何映射:
http://www.online-tech-tips.com/computer-tips/how-to-map-a-drive-in-windows/

关于wpf - 自定义 WPF 命名空间映射在 Visual Studio 2010 中失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2926378/

相关文章:

visual-studio-2010 - 如何使用 Visual Studio 构建 GIMP 插件?

visual-studio-2010 - TF31002 : Unable to connect to this Team Foundation Server for VS 2010, VS 2012 从同一台机器连接到同一服务器

python - bpython -i & 命名空间

c# - C#中的别名资源文件命名空间

wpf - 两种方式 wpf datagrid 绑定(bind)到数据库

wpf - 在 WPF 中使用 FindName() 找不到动态生成的控件

html - CSS 网格布局等于 WPF 网格

c# - WPF/银光 : Instantly render large amounts of multi-colored text

c++ - 如何初始化参数化模板类的静态成员

Gitolie个人分支机构