Is Sharepoint local bin deployment possible?

我与影子孤独终老i 提交于 2019-12-12 01:35:31

问题


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?


回答1:


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




回答2:


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"


来源:https://stackoverflow.com/questions/1754006/is-sharepoint-local-bin-deployment-possible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!