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

发布于 2024-10-02 16:41:46 字数 3315 浏览 1 评论 0原文

我们发现运行 Sharepoint 2010 发布网站集的生产服务器的部署存在问题。

我们正在将从 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。

有人能想到我错过了什么吗?

We have found a problem with our deployment to a production server that runs Sharepoint 2010 Publishing Site Collection.

We are deploying WSP packaged from Visual Studio to Sharepoint Management Shell (Uninstall, reinstall solution). It has worked like a charm in the past. We added a custom masterpage, css files, images and later we successfully added custom page layouts.

I also have SP running locally on my computer and everything works fine with no problem adding new files via deploying Feature. I can add them neatly into a document library or even create new folders from the Elements file.

However the problem arise when I deploy my WSP to the production server. I want to add a few JS files and a XSL file to the Style Library but the files won't get added to the document library. The deployment process goes smooth though with no errors and when I check my feature in Sharepoint Hive, the new files are there on the physical drive! However they won't get added to the virtual Document Library.

I can update existing files like the masterpage and CSS files so the feature that is deployed is working.

My guess is that either it has to do with permission problems or some bug in my code. But I did exactly as we have done before when deploying.

This is how my Elements.xml file looks like:

<?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>  

The last two modules (for Javascript) is the ones I can't deploy to the document library. I tried different document libraries but it still doesn't work on production server, just locally. And I can't deploy to Sharepoint Hive via Feature.

Anyone can think of something I missed?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦巷 2024-10-09 16:41:46

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

为什么会发生这种事,我不知道。如果我对我的功能进行版本控制而不是卸载->添加,它可能会得到修复吗?
为什么生产农场与本地的行为不同? ETC。

Wow, the solution was simple. I deactivated the feature in Sharepoint administration, and reactivated it and the new files got deployed.

WHY this happened, I don't know. If I version my feature instead of uninstall->add it might get fixed?
Why is the behavior different on the production farm vs local? etc.

昔梦 2024-10-09 16:41:46

有几点我希望您注意。只需检查您是否已经关注它们...

  1. 我希望您的 VS 解决方案中有“js”文件夹(在 ALayout 模块下)。

  2. 向节点添加 IgnoreIfAlreadyExists="FALSE" 属性

    文件路径="ALayout\js\libs\jquery-1.4.2.min.js" Url="jquery-1.4.2.min.js" 类型="GhostableInLibrary" IgnoreIfAlreadyExists="FALSE"/

  3. 使用 ULSViewer 查看在生产环境中部署时出现的任何错误...

There are few points I want yo bring to your notice. Just check if you are already following them...

  1. I hope you have "js" folder in your VS solution (under ALayout module).

  2. Add IgnoreIfAlreadyExists="FALSE" attribute to the node

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

  3. Use ULSViewer to see any errors while deploying on production...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文