Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WCF and WF
  4. using local namespace in XAML

using local namespace in XAML

Scheduled Pinned Locked Moved WCF and WF
dotnetwpfhelptutorialquestion
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kaminem
    wrote on last edited by
    #1

    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 ?

    P 1 Reply Last reply
    0
    • K kaminem

      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 ?

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      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.

      My blog | My articles

      K 1 Reply Last reply
      0
      • P Pete OHanlon

        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.

        My blog | My articles

        K Offline
        K Offline
        kaminem
        wrote on last edited by
        #3

        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:

        P 1 Reply Last reply
        0
        • K kaminem

          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:

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          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.

          My blog | My articles

          K 1 Reply Last reply
          0
          • P Pete OHanlon

            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.

            My blog | My articles

            K Offline
            K Offline
            kaminem
            wrote on last edited by
            #5

            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 ??

            P 1 Reply Last reply
            0
            • K kaminem

              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 ??

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              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.

              My blog | My articles

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups