web.config modification

Jun 13, 2012 at 11:45 PM

Hello Randy,

Great job! I've heard a lot of complaints about this feature being removed from 2010 after so many people have come to rely upon it and you deserve much fanfare for creating this.

One question I have is related to the requirement that the web.config be modified (whether manually or through the Feature Activation): What makes this necessary? I've create many SharePoint solutions and have never had to do this for any of them. Could you explain why this is needed?

Thanks,

Jim

Coordinator
Jun 14, 2012 at 1:34 AM

Hi Jim,

That's a great question! I couldn't for the life of me get both the delegate control and the custom pages in the _layouts directory to work without deploying the assembly to the GAC and adding an assembly reference to the web.config file. This is the first SharePoint solution I've ever developed so it's entirely possible I missed something obvious. If you have any tips I'd love to hear them.

Thanks,
Randy 

Jun 14, 2012 at 2:56 AM

It seems to be working fine in my environment without it. Do you recall the error message you received?

Coordinator
Jun 14, 2012 at 4:37 PM

It's probably working because the web.config feature is activated automatically at the web application level when the solution is installed. If you deactivate it the menu will no longer work. If it does, then the assembly reference must still be in the web.config file.

In any case, I just figured out a way to make it all work without the assembly reference. :) It turns out the solution was embarrassingly simple. All that I had to do was specify the assembly's full name in the Inherits attribute on the custom pages and control. 

Thanks for bringing this up, I knew there had to be simpler option but I had already given up on finding a better way. I'll publish the updated solution file soon.