zoukankan      html  css  js  c++  java
  • 使用stsadm命令部署和激活webpart解决方案 Virus

    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、首先在系统的环境变量中设置stsadm的运行路径,也就是【c:\program files\common files\microsoft shared\web server extensions\12\bin】。

    stsadm1

    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/

    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/

    页面安全验证失效,有时候是因为切换账户导致,估计是切换账户之后,前面的页面是另外一个权限的账户打开的,所以你退回去的话,可能安全验证就失效了。

    下面是通过代码添加程序集到GAC中。gacutil.exe是安装框架之后会有的程序,如果没有也可以上网下载。

    gacutil –uf wikieventhandler

    gacutil –if wikieventhandler.dll

    iisreset

    pause

    【Blog】http://virusswb.cnblogs.com/

    【MSN】jorden008@hotmail.com

    【说明】转载请标明出处,谢谢

    反馈文章质量,你可以通过快速通道评论:

  • 相关阅读:
    输入和输出插头
    MCB2300的CTM1050(CAN)
    POJ读书笔记2.1 —— 鸡兔笼带
    Java程序猿的书面采访String3
    JavaScript:undefined And null差异
    设计模式——结构模型
    Qt移动应用开发(六):QML与C++互动
    让我们来谈谈合并排序算法
    安装Eclipse完PyDev插件中没有出现
    汉顺平html5课程分享:6小时制作经典的坦克大战!
  • 原文地址:https://www.cnblogs.com/virusswb/p/1632060.html
Copyright © 2011-2022 走看看