views:

269

answers:

2

I’ve inherited a SharePoint solution where all the projects have strong names and are deployed to the GAC.

I find that its difficult working with projects that are signed, it slows down development, testing and makes debugging difficult.

So, is it possible that SharePoint projects, WebParts, Codebehinds etc be deployed to the local bin instead of the GAC? Is it considered bad practice to deploy to the local bin?

+3  A: 

It is always recommanded to use the Bin directory over to GAC, for all the WebParts & Code Behinds. As that will restrict the Trust given to the code, GAC provides full trust to the code.

After deploying to the bin you can gain the required permission using CAS.

I recommend you to read the chapter Application Security of Inside Windows SharePoint Services 3.0 Book

Note: You will have to deploy your code Feature Handler, Timer Job etc to the GAC

Kusek
A: 

By default, SharePoint Web applications are only allowed to run with a very restrictive trust level of WSS_Minimal. If we want to have our Web Part deployed to the bin folder, then in order for it to run we must do one of two things: either set the trust level to WSS_Medium or WSS_Full in the web.config, or create a custom CAS policy that will allow this assembly's managed code to run. In a production environment, you will need to make an informed decision on this yourself.

I would use the GAC for local development and testing and use the bin in production.

To debug locally, check the following in your config file:

  • customErrors=off
  • Enable Stack Traces by adding CallStack=”true” to the SafeMode tag
  • Set the compilation debug attribute to "true"
IrishChieftain