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

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 ?


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.

public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
    using (SPWeb web = ((SPSite)properties.Feature.Parent).OpenWeb())
        SPFile g = web.GetFile("ModuleName/Page.aspx");

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

  • 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. – Kenneth Van Coppenolle 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. – Kenneth Van Coppenolle Oct 25 '12 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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