Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

We have deployed solution to SharePoint Online with following elements.xml file:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="MyModule">
    <File Path="MyFilePath\MyFile.aspx" Url="MyFileUrl/MyFile.aspx"/>
  </Module>
</Elements>

Then we updated our solution with changes in MyFile.aspx file but we cannot see those changes in SharePoint. Is there any way to force SharePoint Online to 'refresh' solution files? Out of curiosity does somebody know where those files are kept ?

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

What you could do is:

  • Create a Feature Event Receiver.
  • Delete your files on FeatreUpgrading.
  • Bump your package so the solution can be upgraded.

This will delete the files from the database, so on upgrade they will be replaced because they do not exist.
If this does not work you could try on feature deactivating.

share|improve this answer
add comment
public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
{
    using (SPWeb web = ((SPSite)properties.Feature.Parent).OpenWeb())
    {
        SPFile g = web.GetFile("ModuleName/Page.aspx");
        g.Delete();
    }
}

Try this, unfortunately needs to be hardcoded as I haven't found a way to enumerate through modules.

share|improve this answer
1  
You could get the module xml file and loop through it, like Eric Overfield does here: blog.pixelmill.com/1123/… . I have tried this approach but honestly I find it easier to just hard code –  eirikb Oct 25 '12 at 10:35
    
It's even easier when you keep all your module files inside one folder. All you need to do is remove the SPFile that points to your folder. –  Spongeroberto Squarepantalones Oct 25 '12 at 10:54
    
@SpongerobertoSquarepantalones what do you mean by "points to your folder"? You could probably remove the folder, that could work –  eirikb Oct 25 '12 at 12:14
    
Yes, that's what I meant. You only need to remove the folder. You can get it as either an SPFolder or SPFile though; both work. –  Spongeroberto Squarepantalones Oct 25 '12 at 14:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.