使用stsadm命令部署和激活webpart解决方案
Solution.WebPart.webpart
?
<?xml version="1.0" encoding="utf-8"?>
<webParts>
? <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
??? <metaData>
????? <!--
????? The following Guid is used as a reference to the web part class,
????? and it will be automatically replaced with actual type name at deployment time.
????? -->
????? <type name="Solution.WebPart.SolutionWebPart, Solution.WebPart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f4da00116c38ec5"? />
????? <importErrorMessage>Cannot import SolutionWebPart Web Part.</importErrorMessage>
??? </metaData>
??? <data>
????? <properties>
??????? <property name="Title" type="string">SolutionWebPart Web Part</property>
??????? <property name="Description" type="string">SolutionWebPart Description</property>
????? </properties>
??? </data>
? </webPart>
</webParts>
?
Solution.WebPart.xml
?
<?xml version="1.0" encoding="utf-8"?>
<Elements Id="15f37071-ebef-46d0-984d-59fbe920a462" xmlns="http://schemas.microsoft.com/sharepoint/" >
? <Module Name="WebParts" List="113" Url="_catalogs/wp">
??? <File Path="solution.webpart\Solution.WebPart.webpart" Url="Solution.WebPart.webpart" Type="GhostableInLibrary" />
? </Module>
</Elements>
?
feature.xml
?
<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/" Id="F4952FEB-52E3-4d1e-909A-F5297F2FB146"
????????? Title="Solution.WebPart"? Scope="Site" Version="1.0.0.0" Hidden="false"
????????? DefaultResourceFile="core">
? <ElementManifests>
??? <ElementManifest Location="Solution.WebPart\Solution.WebPart.xml"/>
??? <ElementFile Location="Solution.WebPart\Solution.WebPart.webpart"/>
? </ElementManifests>
</Feature>
?
1、首先在系統(tǒng)的環(huán)境變量中設(shè)置stsadm的運行路徑,也就是【c:\program files\common files\microsoft shared\web server extensions\12\bin】。
2、然后,將下列命令行拷貝到setup.bat文件中
3、運行這個setup.bat文件
?
?
stsadm –o deactivatefeature –filename “solution.webpart\feature.xml” –url http://moss.virus.com/
stsadm –o retractsolution –name solution.webpart.wsp –immediate –allcontenturls
stsadm –o execadmsvcjobs
stsadm –o deletesolution –name solution.webpart.wsp
stsadm –o addsolution –filename solution.webpart.wsp
stsadm –o deploysoluiton –name solution.webpart.wsp –allcontenturls –immediate –allowgacdeployment –allowcaspolicies
stsadm –o execadmsvcjobs
stsadm –o activatefeature –filename “solution.webpart\feature.xml” –url http://moss.virus.com/
?
Technorati 標簽: sharepoint,stsadm,feature,webpart,本頁的安全驗證已經(jīng)失效,請點擊后退鍵,然后刷新頁面,The security validation for this page is invalid,Click Back in your Web browser
?
Sharepoint:The security validation for this page is invalid. Click Back in your Web browser
Sometimes while trying to delete documents or move documents from one library to another we get an error "The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again” while trying to move documents from one document library to another document library."
This error is caused due to security validation. So there should be a way out to turn it off. One method to turn off security is:
Central Administration—>application management—->web application general settings–>turn security validation off
But, if we always keep it on there might be danger of malicious code.
So, we should handle this through coding, turn off security validation for our code to execute and then again turn it on.
SPWeb ospWeb = SPContext.Current.Web;
Microsoft.SharePoint.Administration.SPWebApplication webApp = ospWeb.Site.WebApplication;
webApp.FormDigestSettings.Enabled = false;
// our code should be inserted here
webApp.FormDigestSettings.Enabled = true;
For more details, visit http://techolyvia.wordpress.com/2008/10/24/the-security-validation-for-this-page-is-invalid-click-back-in-your-web-browser-refresh-the-page-and-try-your-operation-again/
?
?
頁面安全驗證失效,有時候是因為切換賬戶導(dǎo)致,估計是切換賬戶之后,前面的頁面是另外一個權(quán)限的賬戶打開的,所以你退回去的話,可能安全驗證就失效了。
?
下面是通過代碼添加程序集到GAC中。gacutil.exe是安裝框架之后會有的程序,如果沒有也可以上網(wǎng)下載。
?
gacutil –uf wikieventhandler
gacutil –if wikieventhandler.dll
iisreset
?
pause
轉(zhuǎn)載于:https://www.cnblogs.com/virusswb/archive/2009/12/25/1632060.html
總結(jié)
以上是生活随笔為你收集整理的使用stsadm命令部署和激活webpart解决方案的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [转]SQL语句大全
- 下一篇: VS2005+WINDDK+Driver