【问题标题】:The name "..." does not exist in namespace ".." Visual Studio 2017名称“...”在命名空间“..”中不存在 Visual Studio 2017
【发布时间】:2017-04-09 15:01:11
【问题描述】:

我正在开发一个在 Visual Studio 2017 上使用“.Net Framework 4.6.2”的 WPF 项目。

我从 Internet 上获得了一个名为“GrayscaleEffect”的 dll 文件并将其添加到引用中。

在我添加的 xaml 文件中

xmlns:grayScaleEffect="clr-namespace:GrayscaleEffect;assembly=GrayscaleEffect"

并像这样使用它:

<Image.Effect>                                                   
      <grayScaleEffect:GrayscaleEffect x:Name="grayscaleEffect"/>
</Image.Effect>

当我运行应用程序时它可以工作,但在 xaml 编辑器中它会给出错误:

The name "GrayscaleEffect" does not exist in the namespace "clr-namespace:GrayscaleEffect;assembly=GrayscaleEffect"....

我尝试重建项目并重新启动 Visual Studio,但没有解决这个问题。

【问题讨论】:

标签: wpf


【解决方案1】:

我刚刚想通了。我删除了引用,右键单击 dll 文件并选择“取消阻止文件”,添加到引用中,现在一切都很好。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-26
    相关资源
    最近更新 更多