WPF程序集引用丢失 - 项目仍在构建中

时间:2023-01-13 20:19:02

I am trying to use the Dynamic Data Display library for WPF in my solution. I added a reference to DynamicDataDisplay.dll in my project. I also added a namespace in the .xaml like this: xmlns:d3="http://research.microsoft.com/DynamicDataDisplay/1.0"

我试图在我的解决方案中使用WPF的动态数据显示库。我在我的项目中添加了对DynamicDataDisplay.dll的引用。我还在.xaml中添加了一个命名空间,如下所示:xmlns:d3 =“http://research.microsoft.com/DynamicDataDisplay/1.0”

Intellisense is not helping me when I try to add a element from the Dynamic Data Display library. When I type something like this in my .xaml:

当我尝试从动态数据显示库添加元素时,Intellisense没有帮助我。当我在.xaml中输入类似的内容时:

<d3:ChartPlotter></d3:ChartPlotter>

Visual studio will mark it as an error with some text like:

Visual Studio会将其标记为错误,其中包含以下文字:

The type 'd3:ChartPlotter' was not found. Verify that you are not missing an 
assembly reference and that all referenced assemblies have been built.

But the odd thing about it is that it still compiles. Can someone please tell me what I am doing wrong?

但奇怪的是它仍然编译。有人可以告诉我我做错了什么吗?

Here is a sample code which compiles fine but is showing an error in the designer:

下面是一个示例代码,它编译得很好,但在设计器中显示错误:

<Window x:Class="WpfApplication1.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d3="http://research.microsoft.com/DynamicDataDisplay/1.0"
    Title="MainWindow" Height="350" Width="525">
<Grid>
    <d3:ChartPlotter></d3:ChartPlotter>
</Grid>

Edit:

编辑:

I tried the namespace declaration like Merlyn Morgan-Graham suggested but it still does not work. Another error occurred:

我尝试了像Merlyn Morgan-Graham建议的名称空间声明,但它仍然不起作用。发生了另一个错误

Unable to load the metadata for assembly 'DynamicDataDisplay'.
This assembly may have been downloaded from the web.
See http://go.microsoft.com/fwlink/?LinkId=179545.  The following error was encountered
during load: etc.

It seems like that assemblies that were downloaded need to be manually unblocked. This can be done in the Windows file properties. After unblocking and a restart of Visual Studio the problem was solved.

看起来下载的程序集需要手动解锁。这可以在Windows文件属性中完成。解除阻塞并重新启动Visual Studio后问题得以解决。

http://www.xup.in/pic,13990010/Unblock.PNG

http://www.xup.in/pic,13990010/Unblock.PNG

4 个解决方案

#1


6  

This appears to be a schema reference, not an assembly reference.

这似乎是架构引用,而不是程序集引用。

Something like this might work better:

这样的事情可能会更好:

xmlns:d3="clr-namespace:Microsoft.Research.DynamicDataDisplay;assembly=DynamicDataDisplay"

http://msdn.microsoft.com/en-us/library/ms747086.aspx

http://msdn.microsoft.com/en-us/library/ms747086.aspx

Edit

编辑

I think I found the library you are using, so I updated the XAML namespace reference to what I think will work for you. If not, check the docs, or start editing some code, and figure out the namespace that the ChartPlotter class lives in.

我想我找到了你正在使用的库,所以我将XAML命名空间参考更新为我认为适合你的。如果没有,请检查文档,或者开始编辑一些代码,并找出ChartPlotter类所在的命名空间。

#2


2  

An additional point for other readers: if you projects builds successfully, but you get this error message while trying to load your view in the designer, make sure your assembly is x86 or Any CPU, because Visual Studio 2010 is a 32bit process and cannot load x64 assemblies in the designer.

对于其他读者的另一点:如果您成功构建项目,但是在尝试在设计器中加载视图时收到此错误消息,请确保您的程序集是x86或任何CPU,因为Visual Studio 2010是32位进程并且无法加载设计器中的x64程序集。

#3


1  

I got the same "Unable to load metadata" error when referencing the DLL file found in binary version of Dynamic Data Display Library. The problem was solved when I downloaded the source version of the library and compiled it myself. When referencing the DLL under DynamicDataDisplay_0.3/sln/DynamicDataDisplay/Debug/bin , it worked just fine.

在引用动态数据显示库的二进制版本中找到的DLL文件时,我得到了相同的“无法加载元数据”错误。当我下载库的源版本并自己编译时,问题就解决了。在DynamicDataDisplay_0.3 / sln / DynamicDataDisplay / Debug / bin下引用DLL时,它工作正常。

I suppose the problem is with some permissions of the DLL, as pointed already at the end of the question - you can "unblock it", see above.

我想问题是DLL的一些权限,正如问题末尾已经指出的那样 - 你可以“解锁它”,见上文。

#4


0  

I had similar problems, I was following the steps to create a first sample project as outlined here, https://github.com/Microsoft/InteractiveDataDisplay.WPF

我有类似的问题,我按照这里概述的步骤创建了第一个示例项目,https://github.com/Microsoft/InteractiveDataDisplay.WPF

This currently applies to,

目前适用于,

  • NuGet package avostres.InteractiveDataDisplay.WPF v1.0 and
  • NuGet包avostres.InteractiveDataDisplay.WPF v1.0和
  • NuGet package InteractiveDataDisplay.WPF v1.0
  • NuGet包InteractiveDataDisplay.WPF v1.0
  • my project target framework is .NET 4.6.1 / V.S Pro V15.7.3
  • 我的项目目标框架是.NET 4.6.1 / V.S Pro V15.7.3

It builds but you get a runtime error. It seems to be a compatibility issue due to recent tinkering by Microsoft. Use NuGet to install an additional package,

它构建但是你得到一个运行时错误。由于最近微软的修补,这似乎是一个兼容性问题。使用NuGet安装额外的包,

  • System.Reactive.Compatibility V4
  • System.Reactive.Compatibility V4

this fixed the problem for me.

这解决了我的问题。

I found the fix discussed on a github forum by StephanBartels here, https://github.com/louthy/echo-process/issues/19

我在StephanBartels的github论坛上找到了解决方案,https://github.com/louthy/echo-process/issues/19

#1


6  

This appears to be a schema reference, not an assembly reference.

这似乎是架构引用,而不是程序集引用。

Something like this might work better:

这样的事情可能会更好:

xmlns:d3="clr-namespace:Microsoft.Research.DynamicDataDisplay;assembly=DynamicDataDisplay"

http://msdn.microsoft.com/en-us/library/ms747086.aspx

http://msdn.microsoft.com/en-us/library/ms747086.aspx

Edit

编辑

I think I found the library you are using, so I updated the XAML namespace reference to what I think will work for you. If not, check the docs, or start editing some code, and figure out the namespace that the ChartPlotter class lives in.

我想我找到了你正在使用的库,所以我将XAML命名空间参考更新为我认为适合你的。如果没有,请检查文档,或者开始编辑一些代码,并找出ChartPlotter类所在的命名空间。

#2


2  

An additional point for other readers: if you projects builds successfully, but you get this error message while trying to load your view in the designer, make sure your assembly is x86 or Any CPU, because Visual Studio 2010 is a 32bit process and cannot load x64 assemblies in the designer.

对于其他读者的另一点:如果您成功构建项目,但是在尝试在设计器中加载视图时收到此错误消息,请确保您的程序集是x86或任何CPU,因为Visual Studio 2010是32位进程并且无法加载设计器中的x64程序集。

#3


1  

I got the same "Unable to load metadata" error when referencing the DLL file found in binary version of Dynamic Data Display Library. The problem was solved when I downloaded the source version of the library and compiled it myself. When referencing the DLL under DynamicDataDisplay_0.3/sln/DynamicDataDisplay/Debug/bin , it worked just fine.

在引用动态数据显示库的二进制版本中找到的DLL文件时,我得到了相同的“无法加载元数据”错误。当我下载库的源版本并自己编译时,问题就解决了。在DynamicDataDisplay_0.3 / sln / DynamicDataDisplay / Debug / bin下引用DLL时,它工作正常。

I suppose the problem is with some permissions of the DLL, as pointed already at the end of the question - you can "unblock it", see above.

我想问题是DLL的一些权限,正如问题末尾已经指出的那样 - 你可以“解锁它”,见上文。

#4


0  

I had similar problems, I was following the steps to create a first sample project as outlined here, https://github.com/Microsoft/InteractiveDataDisplay.WPF

我有类似的问题,我按照这里概述的步骤创建了第一个示例项目,https://github.com/Microsoft/InteractiveDataDisplay.WPF

This currently applies to,

目前适用于,

  • NuGet package avostres.InteractiveDataDisplay.WPF v1.0 and
  • NuGet包avostres.InteractiveDataDisplay.WPF v1.0和
  • NuGet package InteractiveDataDisplay.WPF v1.0
  • NuGet包InteractiveDataDisplay.WPF v1.0
  • my project target framework is .NET 4.6.1 / V.S Pro V15.7.3
  • 我的项目目标框架是.NET 4.6.1 / V.S Pro V15.7.3

It builds but you get a runtime error. It seems to be a compatibility issue due to recent tinkering by Microsoft. Use NuGet to install an additional package,

它构建但是你得到一个运行时错误。由于最近微软的修补,这似乎是一个兼容性问题。使用NuGet安装额外的包,

  • System.Reactive.Compatibility V4
  • System.Reactive.Compatibility V4

this fixed the problem for me.

这解决了我的问题。

I found the fix discussed on a github forum by StephanBartels here, https://github.com/louthy/echo-process/issues/19

我在StephanBartels的github论坛上找到了解决方案,https://github.com/louthy/echo-process/issues/19