R – SharePoint – simplest solution and feature config to register a server control

asp.netsharepointsharepoint-2007wsswss-3.0

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.

Best Answer

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