Sharepoint 2010 WSP部署问题。无法部署新文件

时间:2010-11-15 12:40:49

标签: sharepoint deployment sharepoint-2010 publishing-site

我们发现部署到运行Sharepoint 2010 Publishing Site Collection的生产服务器时出现问题。

我们正在将从Visual Studio打包的WSP部署到Sharepoint Management Shell(卸载,重新安装解决方案)。它曾经像过去一样迷人。我们添加了自定义母版页,css文件,图像,之后我们成功添加了自定义页面布局。

我还在我的计算机上本地运行SP,一切正常,通过部署功能添加新文件没问题。我可以将它们整齐地添加到文档库中,甚至可以从Elements文件中创建新文件夹。

但是,当我将WSP部署到生产服务器时会出现问题。我想在样式库中添加一些JS文件和一个XSL文件,但这些文件不会被添加到文档库中。部署过程顺利进行但没有错误,当我在Sharepoint Hive中检查我的功能时,新文件就在物理驱动器上!但是,它们不会被添加到虚拟文档库中。

我可以更新母版页和CSS文件等现有文件,以便部署的功能正常运行。

我的猜测是,它与权限问题或我的代码中的一些错误有关。但是我的确完成了部署之前的工作。

这就是我的Elements.xml文件的样子:

<?xml version="1.0" encoding="utf-8"?>  
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">  
  <Module Name="ALayout" Url="_catalogs/masterpage" RootWebOnly="true" >  
    <File Path="ALayout\_a_intra.master" Url="_a_intra.master" Type="GhostableInLibrary" />  
  </Module>  
  <Module Name="ALayoutStyles" Url="Style Library" RootWebOnly="true" >  
    <File Path="ALayout\styles\z_aintra_core.css" Url="z_aintra_core.css" />  
    <File Path="ALayout\styles\aintra_std.css" Url="aintra_std.css" />  
</Module>  
  <Module Name="ALayoutStyleImages" Url="Style Library/img" RootWebOnly="true" >  
    <File Path="ALayout\styles\img\a-logobig.png" Url="a-logobig.png" Type="GhostableInLibrary" />  
    <File Path="ALayout\styles\img\bg.png" Url="bg.png" Type="GhostableInLibrary" />  
    <File Path="ALayout\styles\img\divider.png" Url="divider.png" Type="GhostableInLibrary" />  
    <File Path="ALayout\styles\img\nav-bg-hovered.png" Url="nav-bg-hovered.png" Type="GhostableInLibrary" />  
    <File Path="ALayout\styles\img\nav-bg-radius-left.png" Url="nav-bg-radius-left.png" Type="GhostableInLibrary" />  
    <File Path="ALayout\styles\img\nav-bg-radius-right.png" Url="nav-bg-radius-right.png" Type="GhostableInLibrary" />  
    <File Path="ALayout\styles\img\nav-bg-selected.png" Url="nav-bg-selected.png" Type="GhostableInLibrary" />  
    <File Path="ALayout\styles\img\nav-bg.png" Url="nav-bg.png" Type="GhostableInLibrary" />  
    <File Path="ALayout\styles\img\nav-divider.png" Url="nav-divider.png" Type="GhostableInLibrary" />  
    <File Path="ALayout\styles\img\top_bg.png" Url="top_bg.png" Type="GhostableInLibrary" />  
    <File Path="ALayout\styles\img\user-account-radius-left.png" Url="user-account-radius-left.png" Type="GhostableInLibrary" />  
    <File Path="ALayout\styles\img\user-account-radius-right.png" Url="user-account-radius-right.png" Type="GhostableInLibrary" />  
  </Module>  
  <Module Name="ALayoutScript" Url="Style Library/js" RootWebOnly="true" >  
    <File Path="ALayout\js\script.js" Url="script.js" Type="GhostableInLibrary" />  
    <File Path="ALayout\js\plugins.js" Url="plugins.js" Type="GhostableInLibrary" />  
</Module>  
  <Module Name="ALayoutScriptLibs" Url="Style Library/js/libs" RootWebOnly="true" >  
    <File Path="ALayout\js\libs\jquery-1.4.2.min.js" Url="jquery-1.4.2.min.js" Type="GhostableInLibrary" />  
  </Module>  
</Elements>  

最后两个模块(对于Javascript)是我无法部署到文档库的模块。我尝试了不同的文档库,但它仍然无法在生产服务器上工作,只是在本地。我无法通过功能部署到Sharepoint Hive。

任何人都能想到我错过的东西?

2 个答案:

答案 0 :(得分:5)

哇,解决方案很简单。我在Sharepoint管理中停用了该功能,并重新激活它并部署了新文件。

为什么会这样,我不知道。如果我修改我的功能而不是卸载 - >添加它可能会得到修复? 为什么生产场与本地的行为不同?等。

答案 1 :(得分:1)

我想要的几点让你注意到。只是检查一下你是否已经关注它们了......

  1. 我希望你的VS解决方案中有“js”文件夹(在ALayout模块下)。
  2. 将IgnoreIfAlreadyExists =“FALSE”属性添加到节点

    File Path =“ALayout \ _js \ libs \ jquery-1.4.2.min.js”Url =“jquery-1.4.2.min.js”Type =“GhostableInLibrary”IgnoreIfAlreadyExists =“FALSE”/

  3. 在生产部署时使用ULSViewer查看任何错误...