经过四天努力,查阅资料,终于搞定了
这是我部署成功的步骤,分享一下:(对了是在公司给同事写的 所以是英文的 不要介意)
The document would tell you how to deploy a WebPart.
1. The will be an open source framework ‘QuickPart’.
There will be two zip files One include a dll file(It’s the webpart assembly),another include a bat file.
2. Put the dll file to the folder of bin of the WebSite.
3. Run the bat file,then the ‘Quick Part’ would be deployed on the website.
4. Then open the web.config file of the website(Which is your main site)
5. Check the XML Node ‘Trust Tag’,it should be changed to ‘<trust level="Full" originUrl="" />’
6. Then Check if there is a ‘SafeControl Tag’ for ‘QuickPart’.
The right content should be:
<SafeControl Assembly="QuickPart, Version=--The version--, Culture=neutral, PublicKeyToken=--The Strong Name for the Assembly--" Namespace="—The NameSpace-- " TypeName="*" Safe="True" />
It’s the dll information.
(If there is no the ‘SafeControl Tag’,you can look the StrongName from ‘reflector tools’)
7. Then go to the ‘SiteActions’à’Site Collection Administration’à’Site Collection Features’ to Active the ‘QuickPart’.
Like this:
8. Now the ‘QuickPart’ deploy is done,then we can write the UserControl in VS2005.
Maybe you can write the control with ‘Don’t place code in separate file’,then you can just deploy the control is ok.
9. When you have done the UserControl,please copy the ascx file to the wpresources folder.
10. Then restart the IIS,all is done.
11. When you edit a page,you can add a webpart named ‘QuickPart’,then modify the ‘QuickPart’,you can see the UserControl you have coded in the ‘User control list’.