using local namespace in XAML
-
Hi all, I add my project namespace at the begining of my xaml usercontrol
xmlns:local="clr-namespace:myproject.xaml.usercontrol"
and I use this namespace to call a method I implemented in my project<ObjectDataProvider x:Key="Models" ObjectType="{x:Type local:Adpaters}" MethodName="GetModels"/>
when I execute my program I get an exception: could not load assembly "Myproject.dll Version=1.0.3167 ...." I'm using VS2005 have you please any ideas how to fix this ? -
Hi all, I add my project namespace at the begining of my xaml usercontrol
xmlns:local="clr-namespace:myproject.xaml.usercontrol"
and I use this namespace to call a method I implemented in my project<ObjectDataProvider x:Key="Models" ObjectType="{x:Type local:Adpaters}" MethodName="GetModels"/>
when I execute my program I get an exception: could not load assembly "Myproject.dll Version=1.0.3167 ...." I'm using VS2005 have you please any ideas how to fix this ?You need to supply the assembly to the definition, so you end up with
xmlns:local="clr-namespace:myproject.xaml.usercontrol, MyProject.dll"
and you must ensure that you've included a reference to the DLL in question into your application.Deja View - the feeling that you've seen this post before.
-
You need to supply the assembly to the definition, so you end up with
xmlns:local="clr-namespace:myproject.xaml.usercontrol, MyProject.dll"
and you must ensure that you've included a reference to the DLL in question into your application.Deja View - the feeling that you've seen this post before.
-
thanks for reply the namespace is local to my project, (it's not an external reference) and when I add the assembly name, I get a compilation error :doh:
Don't add the assembly name if it's local. What happens when you compile up?
Deja View - the feeling that you've seen this post before.
-
Don't add the assembly name if it's local. What happens when you compile up?
Deja View - the feeling that you've seen this post before.
as it's a local namespace I don't add assembly but I get a runtime exception An unhandled exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll Additional information: Unable to load the file or assembly 'MyProjectd, Version = 1.0.3167.27532, Culture = neutral, PublicKeyToken = 799442e4f418bb07' or one of its dependencies. The definition found in the manifest of the assembly does not correspond to the reference of the assembly. (Exception HRESULT: 0x80131040) Error in the file tagging "MyProjectd; component / dialog.xaml" 29 line position 18. in Line 29 I use my namespace, I check that the assembly is loaded ??
-
as it's a local namespace I don't add assembly but I get a runtime exception An unhandled exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll Additional information: Unable to load the file or assembly 'MyProjectd, Version = 1.0.3167.27532, Culture = neutral, PublicKeyToken = 799442e4f418bb07' or one of its dependencies. The definition found in the manifest of the assembly does not correspond to the reference of the assembly. (Exception HRESULT: 0x80131040) Error in the file tagging "MyProjectd; component / dialog.xaml" 29 line position 18. in Line 29 I use my namespace, I check that the assembly is loaded ??
Sorry it's taken me so long to get back to you on this. I've normally seen things like this when the class doesn't compile up.
Deja View - the feeling that you've seen this post before.