Error handling for new class libraries in SharePoint projects and common problems in project construction

Source: Internet
Author: User
Tags error handling iis reference

The first SP project director encountered various problems, the following is a summary:

Question 1. When you create an SP project, there is a difference between "farm solution" and "sandbox solution", and you can see the MSDN official documentation, which is summarized here:

1 Field Solution: In the hosting and W3WP.exe, its running will affect the whole field of code, and can attach W3WP.exe process to debug (vs to Run as an administrator).

2 sandboxed Solution: Load and SPUCWorkerProcess.exe, so restart the IIS application pool and IIS server do not need to restart, does not affect the code of other fields, and the sandbox is monitored, the runtime is accurately monitored SPUCWorkerProcess.exe 。 Here are the limitations of the sandbox solution.

Question 2. The New class library does not know how to reference when you create an SP project.

Two ways:

1 GAC Registration: Right click on items (such as class library These first wood has registered) Select attributes-"signature"

New-"

It then creates a strong-named key file for Xx.snk, and then puts the strong name key file and the DLL file under the same folder (when I test on SP2010, I can estimate the reason for the version even if it's not in the same folder). To be compatible with the previous SP version, then open the vs2012 command prompt and enter the content: gacutil-i absolute path \xxx.dll

When prompted that the Assembly has been successfully added to the cache, it means that the registration has succeeded, and then the SP project is deployed and the reference can be executed successfully.

Disadvantage: Every time you modify the new compiled DLL into the registered DLL which path, so use is not very flexible.

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/web/sharepoint/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.