Welcome to Comunidade Bloggers |create|it| Sign in | Join | Help

André Vala

FAST Search Server


  • SP24 Conference
    European SharePoint Community Awards 2012 Winner
    Locations of visitors to this page

    Comunidade Portuguesa de SharePoint

    Member of the SharePoint Community

    View André Vala's profile on LinkedIn

    © André Vala and Create IT, 2006-2013. Unauthorized use and/or duplication of this material without express and written permission from this blog’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to André Vala and Create IT with appropriate and specific direction to the original content.

Adding an Assembly to Safe Controls in SharePoint Tools for Visual Studio 2010

Using SharePoint Tools for Visual Studio 2010 allows you to build SharePoint solution packages very easily. When you create a SharePoint project, Visual Studio allows you to specify if the assembly for that project should be included in the package and, in case it does, where you want it to be deployed to.

By default, the assembly is included in the package and is deployed to the Global Assembly Cache. You can change both configurations by clicking on the project in Solution Explorer and editing the properties on the Properties window.

SharePoint Properties Window

However, there is no project property that allows you to specify you want to add the assembly to the Safe Controls section on the web application configuration file. To do this, follow the steps below:

1. On Solution Explorer, click on the project
2. On the Properties window, specify you don’t want the assembly to be included in the package (set Include Assembly in Package as False)

Add Assembly to Safe Controls - 1,2

3. On Solution Explorer, double-click the Package folder to open the Package editor
4. On the Package Editor, click the Advanced button (bottom of the screen)

Add Assembly to Safe Controls - 3,4

5. Click the Add button
6. Select Add Assembly from Project Output…

Add Assembly to Safe Controls - 5,6

7. Select the current project (which contains the package)
8. Add the safe controls information

Add Assembly to Safe Controls - 7,8

Posted: Sunday, August 22, 2010 5:42 PM by andrevala
Anonymous comments are disabled