locked
WPF XAML xmlns: assembly not found problem.

    Question

  • i've created a xbap wpf project
    and i have problem with "Error    2    Assembly '' was not found. The 'clr-namespace' URI refers to an assembly that is not referenced by the project. " at the line which highlighted with red color.

    CustomControlLibrary2 in particular is a custom control made by using adding wpf control library template project.

    <Page x:Class="CarouselSample.Page1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:d="http://schemas.microsoft.com/expression/interactivedesigner/2006"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
          xmlns:common="clr-namespace:Common;assembly=Common"
          xmlns:mcl="clr-namespace:MyControls"
        xmlns:cust="clr-namespace:CustomControlLibrary2;assembly=CustomControlLibrary2"
        xmlns:local="Local"
          Loaded="OnLoaded"
          Background="Black"
        Initialized="OnInitialized"
        Title="Page1"
      >


    What is assembliy?
    how do i fix them?
    Thursday, November 09, 2006 7:34 AM

Answers

  •       xmlns:common="clr-namespace:Common;assembly=Common"
          xmlns:mcl="clr-namespace:MyControls"

    These 2 statements reference namespaces in your main assembly. The current CTP of Cider does not support referencing types defined in your main assembly

    mark

    Thursday, November 09, 2006 5:00 PM
    Owner

All replies

  •       xmlns:common="clr-namespace:Common;assembly=Common"
          xmlns:mcl="clr-namespace:MyControls"

    These 2 statements reference namespaces in your main assembly. The current CTP of Cider does not support referencing types defined in your main assembly

    mark

    Thursday, November 09, 2006 5:00 PM
    Owner
  • thanx for the reply....

    so if the main assembly dosent support reference to namespace, how do i solve the problem inorder to use the namespace in the project?
    i need to include them into this project?
    is there anyway to work around it?
    Friday, November 10, 2006 3:04 AM
  • Is there a work around for this?  I am workign with the Patient Monitoring sample and I can not get the designer to work for the XAML.

    Thanks,

    Tim

    Friday, November 10, 2006 7:54 PM
  • The workaround is to either move the classes into a seperate assembly and use them from there or to not use the visual designer - this works fine at runtime.

    mark

    Sunday, November 12, 2006 5:06 PM
    Owner
  • Is this just a problem with the designer (Cider) or a general problem with the XAML parser?  I am trying to use XamlReader with something like <myclass xmlns='clr-namespace:mynamespace'/> and I get an exception about the assembly not being found.

    I am just wandering whether I should keep trying or whether I should wait for the next release.  Separating the assembly is not really an option since I am writing unit tests that use internal properties.
    Wednesday, November 15, 2006 6:24 AM
  • What CTP will this issue be resolved within, I would like to reference a namespace within the main assembly and use the designer?

    Regards,

    Luke

    Tuesday, December 05, 2006 12:57 PM
  • We are planning include this functionality in Orcas CTPs early next year

    mark

    Wednesday, December 06, 2006 2:11 AM
    Owner
  • Is this just a problem with the designer (Cider) or a general problem with the XAML parser?  I am trying to use XamlReader with something like <myclass xmlns='clr-namespace:mynamespace'/> and I get an exception about the assembly not being found.

    From what I understand the XamlReader has the same limitation. I'd suggest you ask on the WPF forum - mark

    Wednesday, December 06, 2006 2:12 AM
    Owner
  • Try to change the line in AssemblyInfo.cs in your main project so that is has a specific version instead of an automatically created one:
     
    //wrong:
    [assembly: AssemblyVersion("1.0.*")]
     
    //better
    [assembly: AssemblyVersion("1.0.0.0")]
     
    I think the load errors are because when the xaml is compiled the former executable version number is used, and then when it is linked it gets a new version number and therefore is another assembly for the loader later on.
     
    Monday, December 11, 2006 12:43 PM
  • This does not resolve the issue within our project.  Still receiving the Assembly '' was not found.  The clr-namespace URL refers to an assembly that is not referenced by the project.  I guess we will need to wait for an update to the CTP that resolves this issue within the designer.

    Tuesday, December 12, 2006 3:59 AM
  • As fas as I know, there will be no future Cider CTP releases for VS 2005. The next CTP releases will be integrated into Orcas. But I hope we won't wait for Orcas for long time.

    eriawan
    Tuesday, December 12, 2006 12:47 PM
  • 2 years ago. .NET 3.5 SP1 and the error is still here! :-(
    Đ.
    Sunday, November 30, 2008 3:48 PM
  • Try with xmlns:cust="clr-namespace:CustomControlLibrary2;assembly="
    It works!

    Friday, January 09, 2009 1:31 PM
  • Ivan Ferrer said:

    Try with xmlns:cust="clr-namespace:CustomControlLibrary2;assembly="
    It works!


    It most certainly does not work.

    2 f*cking years this bug has been around and its still causing problems. I can show about 8 threads involving this problem.

    I put food on the table because of microsoft .net but this editor is the biggest clunkiest tool I've ever ever ever used. Absurd.

    Really disappointed.

     

     


    Monday, January 26, 2009 10:22 PM
  • Bumping this thread bug until microsoft fixes it!!!

     

    Here's 4 other threads talking about this.

     

     
    http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/6379d330-f382-4b4d-a690-e89326ab4c72
    http://social.msdn.microsoft.com/Forums/en-US/vswpfdesigner/thread/174000a1-5166-49ea-92db-c02c0a8bcb13
    http://social.msdn.microsoft.com/Forums/en-US/vswpfdesigner/thread/0a244e58-dc0a-4f13-80ce-438f1e135320
    http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/fc02cd12-8e79-46e5-86d0-729fcd31bcac/

    Monday, January 26, 2009 10:30 PM
  • It must be something wrong in my overall VS 2008 IDE setup because every demo /sample project I've downloaded is broken in the same way.

     

    http://download.microsoft.com/download/f/6/e/f6e32974-726e-4054-96af-9c747bf89a6e/DataBindingLab.exe

    This is microsofts WPF example. Its broken in the same way.

     

     http://blog.norberteder.com/dlcounter/Downloader.php?d=54

    This is some dudes wpf binding example. Its broken in the same way.

     


    Monday, January 26, 2009 11:01 PM
  • I got mine working after adding

    xmlns:ComponentModel="clr-namespace:System.ComponentModel;assembly=WindowsBase" 

    Thursday, March 26, 2009 4:42 PM
  • So the problem with MY setup is very unique and probably doesn't effect most people.

    I was working ina  project folder with a '#' in the title. (C:\#programming\Toolkit) ... why use a hash? It appears at the top of the page in a alphabetically sorted list of folders. But it screws up dev studios. So that's the end of using Hashs.

    Friday, March 27, 2009 5:11 PM
  • I encountered something very similar.

    I had to use some classes from a custom assembly i had clearly referenced.
    The line
    xmlns:cust="clr-namespace:OtherNamespace;assembly=OtherAssembly"
    gave me the same error (Assembly 'OtherAssembly' was not found...). It was driving me nuts, until i remembered, that i had previously encountered a similar problem, which was solved by giving the custom Assembly a strong name.

    Or, in other words, to sign the assembly.

    So i opened the properties (Solution Explorer, right click on the project node, choose "Properties" from the context menu) of the custom assembly, went to the "Signing" Tab at the bottom, clicked "Sign the assembly" and added a key file to the assembly, which i hadn't until then.

    After rebuilding the assembly the designer accepted the namespace declaration without an error.
    Tuesday, May 05, 2009 3:00 PM
  • I encountered something very similar.

    I had to use some classes from a custom assembly i had clearly referenced.
    The line
    xmlns:cust="clr-namespace:OtherNamespace;assembly=OtherAssembly"
    gave me the same error (Assembly 'OtherAssembly' was not found...). It was driving me nuts, until i remembered, that i had previously encountered a similar problem, which was solved by giving the custom Assembly a strong name.

    Or, in other words, to sign the assembly.

    So i opened the properties (Solution Explorer, right click on the project node, choose "Properties" from the context menu) of the custom assembly, went to the "Signing" Tab at the bottom, clicked "Sign the assembly" and added a key file to the assembly, which i hadn't until then.

    After rebuilding the assembly the designer accepted the namespace declaration without an error.
    Hi,

    I ran into a simmular problem. I had good compilible WPF application. After a throw away my 'obj' and 'bin' directory the same error occured. After restoring the 'bin' and 'obj' it compiled again. 
    Is this a egg or chicken problem?!

    Normaly when you build an application from scratch, there is already a dll bofore you add some controls.
    Saturday, July 18, 2009 6:40 PM
  • Hello,

     

    I stumbled upon this problem as well over the weekend.  After about four days of slow and intensive analysis, it seems that the visual studio 2008 ide is at fault.  For some reason it doesn't know where the reference is when you manually change the namespace clr.  However, when I tried to resolve the error inside expression blend, the compiler actually worked.  Also, the debugger inside expression blend seems to be more accurate when it comes to the namespace resolution errors.  Try your luck in expression studio.

    Monday, April 05, 2010 8:01 AM
  • Most likely, there is an error in the code of your assembly. Locate and fix the problem in your source code, and try again.
    Wednesday, May 12, 2010 4:24 AM
  • No.  It's an error in the visual studio WPF designer.
    Saturday, May 29, 2010 3:51 AM
  • After upgrading an old VS Solution to VS 2010 you can get XMLNS: and designer view errors like this. I simply rebuilt the project/solution and the error flags went away.

    xmlns:local="clr-namespace:GraphingWithShapes"

    Error 1 Assembly 'GraphingWithShapes' was not found. Verify that you are not missing an assembly reference. Also, verify that your project and all referenced assemblies have been built.

    The VS IDE is probably requesting the rebuilding of a manifest of object references into the bin/obj directories that the VS Intellisense and WPF/win-forms Designer view windows rely on to locate design-time references to callable objects (design-time runtime execution). This is likely a side effect of how hacky your code might be in development steps and the VS IDE's ability to keep track of your object references until you do a rebuild or debug step.

    Also dependancy assembly DLL references in projects get cached by version signatures and you need to look into VS settings/code as how to force/refresh which ones to use. See the assembly .dll use "Specific Version" project reference property as a search topic also.

    When you change/replace/add a DLL using the same name-space name or change a NS name without rebuilding; (nested Solution-Projects,Assembly .dll references-- as in a "compile as DLL" project dependancy code modification) the signature of the assembly may no longer match in the build/VS IDE object cache; and then you will likely see new IDE code errors (object not found etc.) until a rebuild/debug.

    One (drastic) solution is to delete the bin/obj folders in the project/solution directory and do a rebuild (VS makes new ones) so VS IDE can look at a clean config and not guess about which assembly .dll version to use -- old or new assembly.dll library reference signatures. [this is an GAC assemblies .dll relevant issue also]

    Your code may say to use the same things (objects or new identically named name-space objects with new/extra functions) but Intellisense can't figure out what to do until a rebuild of the project/solution; so you see errors in the IDE editor markup and then often the designer windows don't intitialize or reflect the changes in features you added or removed. If it doesn't rebuild you can delete the obj/bin directories (or move them to another backup folder) and then try a rebuild again.

    Also for some reason shutting down VS IDE and restarting it helps a refresh/purge of the IDE. And possibly in the case of a GAC-assembly type of issue a reboot. (some people just hibernate/sleep/lock their computer and rarely reboot.) You'll definitely get an VS IDE/OS object GC to work that way ;-)

    My latest guesses to things that confuse me often. $10.00 pls. just kidding. I should print this post for myself and glue it to my desk/refigerator.

    Wednesday, June 02, 2010 4:39 AM
  • The problem still isn't fixed. Along with other xaml parser bugs(custom markup extensions). Kinda ridiculous that MS wouldn't fix such relatively simple problems. I guess they are more concerned with getting the latest IE done...
    Tuesday, April 19, 2011 7:53 AM
  • I  had the same problem, all my classes were in the same namespace.

    In the file including the class Page1, define a new namespace.

    So if your classes are in CarouselSample namespace, write:

    using CarousselSample;

    namespace CarousselSimpleNew

    {

        public partial class Page1:Page

    {

    // ...

    }

    }

    It works!

     

    Monday, August 22, 2011 9:45 PM
  • Just delete the "assembly=CustomControlLibrary2" and leave it as xmlns:cust="clr-namespace:CustomControlLibrary2  

    It will work that way, don know why!


    TatlaCas

    Tuesday, July 31, 2012 11:42 AM