Adding Controls to Visual Studio Toolbox

Apr 18, 2011 at 11:49 PM

Is it easy to add controls to Visual Studio's Toolbox through nuget?

Coordinator
Apr 18, 2011 at 11:52 PM

No, that’s what VS Extension Manager is for. NuGet adds code and extends your projects, the VS Extension manager extends Visual Studio.

Apr 19, 2011 at 12:00 AM

Hmm, my question must not be very clear.

Let's pretend Elmah had a visual component that could be dropped onto your page to show recent trace information. That GUI component goes into the Toolbox, from where you can drag it. Just like you can drag a server button etc. onto your work area.

We're not looking to extend Visual Studio, we're just talking about the equivalent of right clicking in the toolbox and selecting Choose Items...

Coordinator
Apr 19, 2011 at 3:15 AM

No, it’s perfectly clear. J

Adding items to the toolbox is extending Visual Studio. VS doesn’t have the concept of toolbox items that are added completely in the scope of your project. Toolbox items are added to a Visual Studio location. You have to install toolbox items into VS.

Think of it this way, NuGet doesn’t affect anything outside of your Solution directory. Since adding a toolbox item probably means adding something to My Documents or Program Files, NuGet packages can’t help you here directly.

However, we do have a feature request to support chaining VSIX packages via NuGet. That would solve this scenario, but you’d have to package up the toolbox item in a VSIX package, which is the appropriate mechanism for such functionality. Then, you could associate it with the NuGet package.

See http://nuget.codeplex.com/workitem/676 for more details.

Apr 19, 2011 at 4:02 AM

Did I misunderstand that nuget will load assemblies into the gac?

Developer
Apr 19, 2011 at 4:04 AM

We *never* put assemblies into the GAC.

Coordinator
Apr 19, 2011 at 5:22 PM

But you can specify a package that will add a reference to .NET Framework Assemblies in the GAC (from our NuSPec Format Docs).

<frameworkAssemblies>

<frameworkAssembly assemblyName="System.ComponentModel.DataAnnotations" targetFramework="net40" />

<frameworkAssembly assemblyName="System.ServiceModel" targetFramework="net40" />

</frameworkAssemblies>

But that feature is only for .NET Framework assemblies. It doesn’t add anything to the GAC. And for the most part, most packages won’t need to use this.

Jan 7, 2012 at 5:22 PM

It would be greate to have this feature, just like the  http://docs.nuget.org/docs/reference/packages-in-visual-studio-templates does.