Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF assembly reference missing - project still building

Tags:

c#

assemblies

wpf

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"

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:

<d3:ChartPlotter></d3:ChartPlotter>

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

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:

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.


(source: www.xup.in)

like image 447
Mario Pistrich Avatar asked Aug 08 '10 00:08

Mario Pistrich


1 Answers

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

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.

like image 187
Merlyn Morgan-Graham Avatar answered Sep 28 '22 16:09

Merlyn Morgan-Graham