|Features
|-- FileCentral (Site scoped feature)
|---- FileCentral.feature
|------ FileCentral.Template.xml
|branding (module)
|-- js (folder)
|---- app (folder)
|------ fileCentral (folder)
|-------- home.js
|-- Elements.xml
|Pages (module)
|-- Home.aspx (file)
|Updates (folder)
|-- SyncFileCentral (folder)
|---- Assets (module)
|------ js (folder)
|-------- app (folder)
|---------- fileCentral (folder)
|------------ sync.js
|------ Elements.xml
|---- Button (custom action)
|------ Elements.xml
|---- Pages (module)
|------ SyncFiles.aspx
|------ Elements.xml
Assets 模块将SyncFiles.aspx页面的必要javascript e css文件部署到Masterpage Gallery:
<!-- Assets module -->
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="branding" Url="_catalogs/masterpage" RootWebOnly="TRUE">
<File Path="branding\js\app\fileCentral\sync.js" Url="branding/js/app/fileCentral/sync.js" ReplaceContent="TRUE" IgnoreIfAlreadyExists="TRUE" Type="GhostableInLibrary" Level="Published"/>
</Module>
</Elements>
按钮自定义操作会部署(猜测是什么?)自定义操作。 Pages 模块将SyncFiles.aspx页面部署到Pages文档库。
<-- Pages module -->
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="Pages" Url="Pages" RootWebOnly="TRUE">
<File Path="Pages\SyncFiles.aspx" Url="Pages/SyncFiles.aspx" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" ReplaceContent="TRUE" Level="Published" />
</Module>
</Elements>
FileCentral.Template.xml如下所示:
<?xml version="1.0" encoding="utf-8"?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/" **Version="2.0.0.0"** Title="File Central" ActivateOnDefault="FALSE" AlwaysForceInstall="TRUE" Description="DESCRIPTION HERE" Id="XXX" Scope="Site">
<!-- Feature Upgrade -->
<UpgradeActions>
<VersionRange BeginVersion="2.0.0.0" EndVersion="3.0.0.0">
<ApplyElementManifests>
<ElementManifest Location="Assets\Elements.xml" />
<ElementFile Location="Assets\js\app\fileCentral\sync.js" />
<ElementManifest Location="Button\Elements.xml" />
<ElementManifest Location="Pages\Elements.xml" />
<ElementFile Location="Pages\SyncFiles.aspx" />
</ApplyElementManifests>
</VersionRange>
</UpgradeActions>
<ElementManifests>
<ElementManifest Location="branding\Elements.xml" />
<ElementFile Location="branding\js\app\fileCentral\home.js" />
<ElementManifest Location="Assets\Elements.xml" />
<ElementFile Location="Assets\js\app\fileCentral\sync.js" />
<ElementManifest Location="Button\Elements.xml" />
<ElementManifest Location="Pages\Elements.xml" />
<ElementFile Location="Pages\SyncFiles.aspx" />
</ElementManifests>
</Feature>
好的,足够的背景。问题出在这里:当我 Update-SPSolution -Identity“FileCentralSolution.wsp”-LiteralPath“X”-GACDeployment 时,我可以看到($ site.QueryFeatures([Microsoft.SharePoint.SPFeatureScope] :: Site,$ true))有需要更新的功能。然后,当我更新功能时,我无法看到我的资产和页面都没有变化。唯一可以部署的是我的自定义操作。因此,当我单击按钮时,会打开一个空白对话框。如果我检查网络选项卡,我可以看到资产和页面请求返回404状态响应。 我做错了什么?
答案 0 :(得分:1)
您是否检查过文件系统以查看文件是否确实已部署到正确的配置单元?如果这是SharePoint 2013,您的解决方案文件是否部署到适合所选UI模式的文件夹? (CompatibilityLevel 14,15?)