Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Jonny Irwin 91 posts 153 karma points
    Mar 28, 2013 @ 16:30
    Jonny Irwin

    Readonly files

    Not a problem with the uSync code more with the Umbraco code that it uses, but I was banging my head off a brick wall for a bit trying to figure out why I couldn't get uSync to work.

    When syncing templates or stylesheets, if any of the .master or .css files are marked as read-only (as happens if using TFS for source control), The methods Template.Import() and Stylesheet.Import() bomb out with an UnauthorizedAccessException.

    NOTE: I am using uSync with Umbraco 4.7.2 (having made a few minor changes to make it work).  There may be a chance that these methods may deal with read-only flags in 4.11.x

  • Kevin Jump 1780 posts 11431 karma points MVP 4x c-trib
    Mar 28, 2013 @ 21:18
    Kevin Jump

    yes I'm not sure their is much i can do in uSync to combat that, i suppose uSync could work out what the stylesheet/template file names where going to be, and check if they where read-only before import. I don't know enough about TFS to know what the full effect would be of removing the read-only flag would be ?

    I'm also intregued by what changes you've had to make to get uSync working on 4.7.2 - i haven't really gone back many versions with it but quite a few people do seem to be sticking with 4.7.x - do you think the changes could be merged back in without making to many compromises (the code already has some basic version stuff for 4.11.4 - 4.11.5 issues) ?



  • Jonny Irwin 91 posts 153 karma points
    Mar 29, 2013 @ 10:54
    Jonny Irwin

    TFS marks files as read-only if they aren't checked out.  It's no big deal - we can just make the first step of our process to make sure that the read-only flag is removed from all files first.

    There were no major changes to make it work on 4.7.2.  Jsut things like Usny having to inherit from ApplicationBase rather than implementing IApplicationEventHandler or whatever it is called now.  Doing this meant I had to call RunUsync() in the constructor rather than in the Application starting event.  Apart from that it was jsut changing the namespace/assembly that some of the umbraco methods were located in since the changes introduced when the Umbraco.Core assembly was introduced.

    If you want to see the changes, you can see them at

    Also, just wanted to say thanks for creating this awesome package, you don't know what a difference this is going to make to us!

  • Carl 29 posts 51 karma points
    Mar 19, 2015 @ 05:19

    Hi Jonny,

    I tried using your project, building and adding the built dll into a 4.7.2 project, but sadly nothing happened or got wrote to disk. Is there anything else I should be doing? In summary I:

    1. Tried downloading the 1.3.3 version of usync but it didnt work
    2. Then downloaded your project from github, built it and replaced the 1.3.3 usync dll with yours
    3. Tried again, restarting the site etc, but nothing was getting written to disk
    Would I have needed to do anything else?
Please Sign in or register to post replies

Write your reply to: