简体   繁体   中英

sharepoint feature upgrade failing to update module

Ok guys, I've been bending my head over this problem for quite some time now. Let me give you a little bit of context here. I have a site collection feature ( FileCentral ) working on it's version '1.0.0.0' . What this feature does is to create a document library in which I can upload files that will be stored on a network share. So each item in this document library stores a link to the file path. No problem here. Recently I've got the following requirement: "It should be possible to synchronize files from the folder to the document library". In other words, I need some way to scan for files placed in the network share and create the respective list items pointing to these files. The proposed solution is to create a custom action on this document library that when clicked would open a dialog with a page called SyncFiles.aspx in it. This page would then call an asynchronous service responsible for listing the files that have not been synchronized. The user would then select the files he wants to sync and confirm the operation. The project structure for this solution is:

|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

The Assets module deploys to the Masterpage Gallery the necessary javascript e css files for the SyncFiles.aspx page to work:

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

The Button custom action deploys the (guess what?) the custom action. And the Pages modules deploys the SyncFiles.aspx page to the Pages document library.

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

The FileCentral.Template.xml looks like:

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

Ok, enough of context. Here is the problem: When I Update-SPSolution -Identity "FileCentralSolution.wsp" -LiteralPath "X" -GACDeployment , I can see ($site.QueryFeatures([Microsoft.SharePoint.SPFeatureScope]::Site, $true)) that there are features needing update. Then, when I update the features, I'm not able to see neither my assets nor my pages changes. The only thing that gets deployed is my custom action. So when I click the button a blank dialog open up. And if I inspect the network tab, I can see the assets and page requests return 404 status responses. WHAT HAVE I DONE WRONG?

Have you checked your file system to see if the files have indeed been deployed to the correct hive? If this is SharePoint 2013, are your solution files being deployed to the folder appropriate to your selected UI mode? (CompatibilityLevel 14,15?)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM