LeifO
LeifO

Reputation: 21

Error: The name XXX does not exist in the namespace 'clr-namespace:YYY'

I've just installed Blend 4 and are trying to use it with a rather big VS2010 project that includes a couple of C++/CLI assemblies with some native code. For a lot of controls I get a Blend error like 'The name XXX does not exist in the namespace 'clr-namespace:YYY' when trying to open the design view.

I've searched the web (including this forum) for similar errors and have made sure that I've followed all available suggestions, like e.g. making sure I have an AnyCPU configuration, that I don't use e.g. 'x64\Debug' as the output folder, and that I have the proper namespace declaration in my XAML (using 'assembly' in my clr-namespace declaration).

I've also made a simple, new project that only accesses one of the assemblies with the issue, but I still get the error.

It looks to me that the issue is related to assemblies that references any of the C++/CLI assemblies that includes some unmanaged code. I do not seem to get the error for assemblies that references managed-code-only assemblies.

What could cause the errors ?

Regards,

Leif


Little response here, so maybe I should rewrite my question a bit:

Has anyone successfully used Expression Blend for a project that uses assemblies with unmanaged code ?

Regards, Leif

Upvotes: 2

Views: 1882

Answers (1)

Jürgen Fink
Jürgen Fink

Reputation: 3545

had a similar problem: project compiled correctly without error in VB 2010, but got error when opening it in Expression Blend 4 (beautyful tool, by the way):

The name XXX does not exist in the namespace "clr-namespace:YYY".

at line:

<CollectionViewSource x:Key="YYYViewSource" d:DesignSource="{d:DesignInstance {x:Type my:YYY}, CreateList=True}" />

In my case it was an Entity in my edmx, a FunctionImport named "YYY" with a ComplexType "YYY_Result", and my XAML code at the CollectionViewSource referenced to that entity "YYY".

This XAML code generated No error in VB 2010, compiled and ran perfectly well (compiled also correctly in Blend), however no design view in Blend.

Solution: I realized my mistake at the x:Type in CollectionViewSource and corrected name from "YYY" to "YYY_Result" and it worked:

<CollectionViewSource x:Key="YYYViewSource" d:DesignSource="{d:DesignInstance {x:Type my:YYY_Result}, CreateList=True}" />

Conclusion: Maybe this answer is not exactly related to your problem concerning the C++/CLI assemblies with some unmanaged native code, and maybe yes.

This case was just a nice example of a project compiling correctly in VB 2010, but same XAML generated above error message in Blend 4 when creating the design view (many users reported similar issues at this forum).

Upvotes: 1

Related Questions