I have been working on my new web site and needed to upgrade my menu control from the Visual Studio 2008 project format to Visual Studio 2010 format. In doing so I created the proper SharePoint Items (SPIs) for my project to build into a WSP. One issue I ran into is there is nothing in my solution that would cause Visual Studio to automatically create a Safe Controls entry. It was correctly creating the manifest and GACing the DLL, but it failed to see that my control was anything more than an assembly. My assembly is a menu control, but there is no “visual” component. This means that my assembly would build and deploy, but when I tried to reference it from a page it would fail because it was not marked as safe.
Todd Baginski, MVP and ski-dude extraordinaire, pointed out that you can chose one of the SPIs in your project (not all, but in my case Elements worked) and access the Safe Controls Entries collection and manually add the entry.
Now I don’t have any excuses for not finishing my web site (other than taking the dogs for a swim, doing yard work,…)
Ready to start your next project with us? That’s great! Give us a call or send us an email and we will get back to you as soon as possible!