Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6062823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:05:44+00:00 2026-05-23T09:05:44+00:00

I’m trying to create a VSIX installer for a WPF control. Its supposedly easy,

  • 0

I’m trying to create a VSIX installer for a WPF control.

Its supposedly easy, but the “easy” version assumes that you create the WPF control in the VSIX project.

The thing is, I’ve got my UserControl nestled deep within one of my DLLs, and I don’t believe pulling it out is the best design. I’d like to leave it in there, but I can’t seem to do this AND have the control added to the toolbox.

One option would be to move the code I need to install it to the toolbox into the control’s assembly, but that would add a dependency to Microsoft.VisualStudio.Shell.Immutable.10.0.dll. The assembly is both used by someone with Visual Studio installed, and a remote server running within a service where VS isn’t installed, so that’s a no-go.

Another option I tried was to “trick” the toolbox installer VSIX by applying the RegistrationAttribute to proxies which would register the types defined in the other assembly. Thought it would work, but weird stuff happened.

all kinds of weirdness in the toolbox

Instead of getting two controls, I get a bunch of Border controls (the standard WPF border) in oddly named tabs, some of which echo some of my namespaces.

How can I register a WPF UserControl with the Toolbox when the control is defined in an assembly other than the VSIX?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:05:44+00:00Added an answer on May 23, 2026 at 9:05 am

    I was able to whip up a proof of concept similar to the proxy idea that you had mentioned.

    The problem that you’re seeing is caused by the registration of the wrong assembly, so I created a new registration attribute called ProvideProxyToolboxControlAttribute which is used as an attribute on the proxy classes that you have in your VS integration assembly. It’s almost identical to ProvideToolboxControlAttribute except that it takes the type of the actual control. Of course, this new attribute would also be in your VS assembly.

    For example, say I have a toolbox control in my non-VS assembly called MyToolboxControl, I’d create a simple proxy class MyToolboxControlProxy in my VS assembly that looks like this:

    [ProvideProxyToolboxControl("MyToolboxControl", typeof(NonVsAssembly.MyToolboxControl))]
    public class ToolboxControlProxy
    {
    }
    

    And of course, the magic happens in ProvideProxyToolboxControlAttribute, which is basically just this class (comments and parameter/error checking removed for brevity):

    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
    [System.Runtime.InteropServices.ComVisibleAttribute(false)]
    public sealed class ProvideProxyToolboxControlAttribute : RegistrationAttribute
    {
        private const string ToolboxControlsInstallerPath = "ToolboxControlsInstaller";
        public ProvideProxyToolboxControlAttribute(string name, Type controlType)
        {
            this.Name = name;
            this.ControlType = controlType;
        }
    
        private string Name { get; set; }
    
        private Type ControlType { get; set; }
    
        public override void Register(RegistrationAttribute.RegistrationContext context)
        {
            using (Key key = context.CreateKey(String.Format(CultureInfo.InvariantCulture, "{0}\\{1}",
                                                             ToolboxControlsInstallerPath,
                                                             ControlType.AssemblyQualifiedName)))
            {
                key.SetValue(String.Empty, this.Name);
                key.SetValue("Codebase", ControlType.Assembly.Location);
                key.SetValue("WPFControls", "1");
            }
        }
        public override void Unregister(RegistrationAttribute.RegistrationContext context)
        {
            if (context != null)
            {
                context.RemoveKey(String.Format(CultureInfo.InvariantCulture, "{0}\\{1}",
                                                             ToolboxControlsInstallerPath,
                                                             ControlType.AssemblyQualifiedName));
            }
        }
    }
    

    It seems to work well, I verified that the control is in the toolbox and that the proper registry keys were added.

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.