Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cannot find type error in XAML
Message
De
15/12/2009 13:42:02
 
 
À
14/12/2009 14:07:22
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01438189
Message ID:
01439208
Vues:
29
>>Hi,
>>Simple piece of XAML referencing a component in another assembly:
<UserControl x:Class="LLNet.Modules.Library.Views.Test"
>>    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>>    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>>    xmlns:llc="clr-namespace:LLNet.Layout;assembly=Canvas">
>>        <ContentControl>
>>                <llc:LLMainCanvas/>
>>        </ContentControl>
>></UserControl>
The assembly that this is in has a reference to the project for the 'Canvas' assembly. When this runs I get the following exception:
>>
>>"Cannot find type 'LLNet.Layout.LLMainCanvas'. The assembly used when compiling might be different than that used when loading and the type is missing."
>>
>>The weird thing is that simply by adding a reference to any object in the 'Canvas' assembly anywhere in code (e.g. "LLNet.Layout.LLCanvas llc;") allows this to run without a problem.
>>
>>Any clues,
>>TIA
>>Viv
>
>That is weird... Have you tried adding a reference to 'Canvas' into what ever assembly is calling "LLNet.Modules.Library.Views.Test"?
>
>not sure if it applies, but this is why I ask:
>
>http://www.smartypantscoding.com/content/odd-error-compositewpf-and-other-embedded-controls

Hi, Thx,
The project (in the non-NET sense of the word) that this happened in is in a state of flux and some of the components have been moved to other assemblies etc. so I can no longer reproduce (speaking as a programmer rather than a male of the species). But I think the answer does lie somewhere in that URL insofar as it it occassionally neccessary to include references to assemblies 'twice removed'. In this instance I think the problem *may* have been a reference to a resource dictionary in a third assembly - but I'm afraid I will now nver really know :-{
Best,
Viv
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform