none
Why does my app require Microsoft.Window.Design.Extensibility?? RRS feed

  • Question

  • And, how do I get it installed in the GAC?  I added it to my published install, thinking that would do the trick.. but it doesn't.

    The install bombs with a message that this dll must be installed first.
    Tuesday, April 1, 2008 11:18 PM

Answers

  • Without having your source or your project file it is very difficult to know exactly why your application is trying to load this assembly.  If you are not directly referencing that assembly in any of your projects then one possiblity is that you are using a component in your application that dynamically loads  the Extensibility assembly.

     

    Once you are sure that none of your assemblies is directly referencing the Extensibility assembly then you might be able to find out what component is dynamically loading this assembly by sinking the AppDomain.AssemblyLoaded:

     

    Code Snippet

    AppDomain.CurrentDomain.AssemblyLoad += delegate(Object s, AssemblyLoadEventArgs e)

    {

    System.Diagnostics.Debugger.Break();

    };

     

     

    Add this code (or the VB equivalent if you are programming with VB) at the start of you application and when you debug the app Visual Studio will break each time an assembly is loaded.  Once you are at a break point you can check what assembly was loaded by looking at the AssemblyLoadEventArgs and if e.LoadedAssembly indicates that the Extensibility assembly was just loaded you can look at the call stack to see what code was responsible for loading it.

     

    Here is a quick example:

     

    Code Snippet

    class Program

    {

      static Program()

      {

        AppDomain.CurrentDomain.AssemblyLoad += delegate(Object s, AssemblyLoadEventArgs e)

        {

          if(e.LoadedAssembly.FullName== "Microsoft.Windows.Design.Extensibility, 

              Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")

            System.Diagnostics.Debugger.Break();

        };

      }

     

      static void Main(string[] args)

      {

        TestComponent test = new TestComponent();

        test.DoSomething();

      }

    }

     

    public class TestComponent

    {

      private object _instance;

     

      public void DoSomething()

      {

      _instance = Activator.CreateInstance(

        "Microsoft.Windows.Design.Extensibility, Version=3.5.0.0, Culture=neutral,

         PublicKeyToken=b03f5f7f11d50a3a",

        "Microsoft.Windows.Design.Policies.PrimarySelectionPolicy", null);

      }

    }

     

     

     


    Wells Caughey | Magenic Technologies
    Wednesday, April 2, 2008 2:14 AM

All replies

  • Given that the assembly, Microsoft.Windows.Design.Extensibility.dll, is installed in the %ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies directory and not in the %ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.0 directory where the most if not all the WPF assemblies are stored, I would assume that this file is not part of WPF but instead is part of Visual Studio. 

     

    Your installer might be detecting that one of your assemblies is referencing Microsoft.Windows.Design.Extensibility and is now looking for it to be installed on your test machine before continuing to install your app.

     

    Hope this helps,

    Wells

     


    Wells Caughey | Magenic Technologies
    Wednesday, April 2, 2008 12:46 AM
  • but WHY is what I'm trying to figure out.
    Wednesday, April 2, 2008 12:50 AM
  • Without having your source or your project file it is very difficult to know exactly why your application is trying to load this assembly.  If you are not directly referencing that assembly in any of your projects then one possiblity is that you are using a component in your application that dynamically loads  the Extensibility assembly.

     

    Once you are sure that none of your assemblies is directly referencing the Extensibility assembly then you might be able to find out what component is dynamically loading this assembly by sinking the AppDomain.AssemblyLoaded:

     

    Code Snippet

    AppDomain.CurrentDomain.AssemblyLoad += delegate(Object s, AssemblyLoadEventArgs e)

    {

    System.Diagnostics.Debugger.Break();

    };

     

     

    Add this code (or the VB equivalent if you are programming with VB) at the start of you application and when you debug the app Visual Studio will break each time an assembly is loaded.  Once you are at a break point you can check what assembly was loaded by looking at the AssemblyLoadEventArgs and if e.LoadedAssembly indicates that the Extensibility assembly was just loaded you can look at the call stack to see what code was responsible for loading it.

     

    Here is a quick example:

     

    Code Snippet

    class Program

    {

      static Program()

      {

        AppDomain.CurrentDomain.AssemblyLoad += delegate(Object s, AssemblyLoadEventArgs e)

        {

          if(e.LoadedAssembly.FullName== "Microsoft.Windows.Design.Extensibility, 

              Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")

            System.Diagnostics.Debugger.Break();

        };

      }

     

      static void Main(string[] args)

      {

        TestComponent test = new TestComponent();

        test.DoSomething();

      }

    }

     

    public class TestComponent

    {

      private object _instance;

     

      public void DoSomething()

      {

      _instance = Activator.CreateInstance(

        "Microsoft.Windows.Design.Extensibility, Version=3.5.0.0, Culture=neutral,

         PublicKeyToken=b03f5f7f11d50a3a",

        "Microsoft.Windows.Design.Policies.PrimarySelectionPolicy", null);

      }

    }

     

     

     


    Wells Caughey | Magenic Technologies
    Wednesday, April 2, 2008 2:14 AM