views:

627

answers:

3

I would like to know what the XML is for the simplest feature and that will register a Server Control in the GAC, and add it the safe controls section of the web.config for the SharePoint site.

My assembly:

MyServerControl.dll (MyServerControl, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3249363c0f6f8c59)

I can manually add it to the GAC with gacutil /i, but I want to have the feature do this for me and also add an element to SafeControls.

+3  A: 

Hi,

a feature cannot add files to the GAC, that's a job for a solution. The solution can deploy your feature to the 12 hives, the assembly to the GAC and can add a safe controls entry to the web.config.

MSDN on Solutions and Web Part Packages

As building a MOSS solution by hand can be a lot of pain, there are some cool tools out there which can support you on that.

VSeWSS 1.3
WSPBuilder

Flo
+1  A: 

You want to build a solution package to deploy your user control's assembly into the GAC. A feature doesn't deploy assemblies. In fact a feature isn't even needed to deploy a user control. Check out my post which contains instructions and sample code on how to get started.

Deploying a User Control in SharePoint

Corey Roth
A: 

WSPBuilder is the way to go, it will automatically add the dll's to the GAC, and if necessary, register it as a SafeControl in the web application you deploy the solution to.

Colin