打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
如何一步一步自己做WebPart的CAB安装包

如何一步一步自己做WebPart的CAB安装包

责任编辑:nancy作者:ITPUB论坛   2008-05-24   
文本Tag: 微软 sql

【IT168技术文档】

  虽然网上提供的方法很多,当大多都要借助第三方工具,其实这件工作很简单,自己动手做也许更方便。

  第一步:制作一个WebPart, 假定叫SearchBoxWebPart,强命名它(强命名不是必需的,但推荐使用);
  注意事项:AssemblyInfo.cs中记得加[assembly: AllowPartiallyTrustedCallers()]
及AssemblyVersion
  第二步:创建一个CAB的Project,添加两个文件,manifest.xml,SearchWebPart.dwp。

  manifest.xml内容为:
<?xml version="1.0"?> <WebPartManifest xmlns="http://schemas.microsoft.com/WebPart/v2/Manifest"> <Assemblies> <Assembly FileName="SearchWebpart.dll"> <SafeControls> <SafeControl Assembly="SearchWebPart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e01f55ae71a39d56" Namespace="SearchWebPart" TypeName="*" Safe="True" /> </SafeControls> <ClassResources> </ClassResources> </Assembly> <Assembly FileName="Microsoft.SharePoint.dll"> <SafeControls> <SafeControl Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Namespace="Microsoft.SharePoint" TypeName="*" Safe="True" /> </SafeControls> <ClassResources> </ClassResources> </Assembly> <Assembly FileName="Microsoft.Office.Server.dll"> <SafeControls> <SafeControl Assembly="Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Namespace="Microsoft.Office.Server" TypeName="*" Safe="True" /> </SafeControls> <ClassResources> </ClassResources> </Assembly> <Assembly FileName="Microsoft.Office.Server.Search.dll"> <SafeControls> <SafeControl Assembly="Microsoft.Office.Server.Search, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Namespace="Microsoft.Office.Server.Search" TypeName="*" Safe="True" /> </SafeControls> <ClassResources> </ClassResources> </Assembly> <Assembly FileName="Microsoft.SharePoint.Publishing.dll"> <SafeControls> <SafeControl Assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Namespace="Microsoft.SharePoint.Publishing" TypeName="*" Safe="True" /> </SafeControls> <ClassResources> </ClassResources> </Assembly> <Assembly FileName="Microsoft.SharePoint.Search.dll"> <SafeControls> <SafeControl Assembly="Microsoft.SharePoint.Search, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Namespace="Microsoft.SharePoint.Search" TypeName="*" Safe="True" /> </SafeControls> <ClassResources> </ClassResources> </Assembly> <Assembly FileName="Microsoft.SharePoint.Security.dll"> <SafeControls> <SafeControl Assembly="Microsoft.SharePoint.Security, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Namespace="Microsoft.SharePoint.Security" TypeName="*" Safe="True" /> </SafeControls> <ClassResources> </ClassResources> </Assembly> </Assemblies> <DwpFiles> <DwpFile FileName="SearchWebpart.dwp"/> </DwpFiles> </WebPartManifest>
  Assembly指定的dll会被安装到SharePoint的bin目录中。


  SearchWebPart.dwp的内容为:
<?xml version="1.0" encoding="utf-8"?> <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2" > <Title>SearchWebpart</Title> <Description>Custom search web part</Description> <Assembly>SearchWebPart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e01f55ae71a39d56</Assembly> <TypeName>SearchWebPart.SearchBoxWebPart</TypeName> </WebPart>
  它将指定要安装的WebPart.

  第三步:将所有所需的dll加到CAB Project中。

  第四步:使用stsadm 命令安装。
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
MOOS 2007基础:部署自定义WebPart(1)
Creating a Basic Web Part
sharepoint几个关键字
SharePoint 2013 workflows stop working (Failed on started.)
ProjectServer2010升级到ProjectServer2016,Sharepoint2010升级到Sharepoint2016第三章
SharePoint Online 创建SPFx客户端Web部件
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服