tags:

views:

400

answers:

6

We have a class library where we keep a lot of the stuff that we often use when doing sharepoint development. How would you go around deploying this? Right now our best bet is to have it in a separate solution, and deploy that so that the assembly is deployed to GAC. That way we ensure that the assembly is deployed to all application tiers and is available.

Is there a better approach than this?

+1  A: 

The GAC is usually your best choice. Like ensuring you deploy to all applications, it's also easier in terms of security.

Rik
A: 

If I remember correctly, putting it in the GAC is the recommended course of action.

paul
A: 

Also, remember that you have to add to the SafeControls list in the web.config.

http://grounding.co.za/blogs/brett/archive/2008/05/23/sharepoint-register-an-assembly-as-a-safe-control-in-the-web-config-file.aspx

Lou Franco
It's just a common library so it does not contain any controls (web parts).
mortenbpost
+2  A: 

GAC, of course, is the easiest way to deploy an assembly; however, what if you don't want to share this assembly across an entire server. Or what if the license doesn't permit that.

So, there are two ways to deploy an assembly:

  1. GAC (you already know about it)

  2. BIN folder. To deploy your assembly to the bin folder of your site (e.g. C:\Inetpub\wwwroot\wss\VirtualDirectories\80) you'll need to create a custom Security Policy file and change a security level in the web.config. This is not easy at all and can be quite frustrating but may be well worth it.

More information: http://msdn.microsoft.com/en-us/library/cc768621.aspx

Gleb Popov
A: 

I've decided to deploy it to GAC since the assembly doesn't pose a security risk since it will not be used from Web Parts.

I've researched a bit and deploying to gac is the recommended way to do it. You could argue that everything but Web Parts should be deployed to GAC. Since Web Parts pose a potentially security risk it can be a good idea to make your own CAS and deploy it to sharepoint bin.

Cheers.

mortenbpost
A: 

Note that if you do decide to deploy to the BIN folder, you can deploy custom security policy settings such as new Permission Sets through your solution manifest file.