Open the Web. config file under the root directory of the SPS Virtual Site and find the following line:
<Trust level = "wss_minimal" originurl = ""/>
Modify it:
<Trust level = "wss_medium" originurl = ""/>
Tip:
By default, a webpart cannot access the SharePoint Object Model (that is, the list, document library, document, user, and other information in the SPS site cannot be accessed through the wss sdk ), to make our webpart work properly, we can:
★Create a separate policy file for this webpart.
★Add strongname to the webpart (. dll) file and put it in GAC.
★Improve the trust level of the entire SPS Virtual Site
The third method is used to increase the default trust level from wss_minimal to wss_medium (the highest level is full ).
InstallGACTo achieve full trust
when you use stsadm.exe to install Web components for a Program with a strong name. when installing a cab file, you can use the globalinstall command line switch to install it in GAC, as shown below:
stsadm.exe-O addwppack-filename path_to_web_part.cab file-globalinstall
You can also manually install a Web part assembly with a strong name to GAC, the method is to import the Web part. drag the DLL file to the following special folder:
local_drive: \ windows \ Assembly