locked
All of a sudden - File operation not permitted. Access to path '' is denied. Why? RRS feed

  • Question

  • I have a SilverLight OOB app that has been working fine for ages. I just ran it in Visual Studio, and got the error mentioned above on the line...

    LocalFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + MagicConstants.LocalFolderName;

    I'm doing this, because the app allows the user to view files stored on the server, and I download them, save them in this folder and then open them from there.

    As I said, this has been working fine for a long time, but has suddenly stopped working. I get the same problem when running the production version.

    Anyone any ideas why this has happened, and (more to the point), how I fix it?


    FREE custom controls for Lightswitch! A collection of useful controls for Lightswitch developers (Silverlight client only). Download from the Visual Studio Gallery.

    If you're really bored, you could read about my experiments with .NET and some of Microsoft's newer technologies at http://dotnetwhatnot.pixata.co.uk/

    Wednesday, April 29, 2015 4:39 PM

Answers

  • In case it helps anyone, I eventually solved this by randomly installing various Silverlight packages, including the run time, the SDK, the dev tools, etc. Most of them told me they were already installed, but eventually I must have managed to install something that was missing, as it now works.

    FREE custom controls for Lightswitch! A collection of useful controls for Lightswitch developers (Silverlight client only). Download from the Visual Studio Gallery.

    If you're really bored, you could read about my experiments with .NET and some of Microsoft's newer technologies at http://dotnetwhatnot.pixata.co.uk/

    • Marked as answer by Mr Yossu Tuesday, May 5, 2015 12:49 PM
    Tuesday, May 5, 2015 12:49 PM

All replies

  • Forgot to mention that the code shown above runs in the Application class, ie on the client. It looks like the app is suddenly running OOB, but without elevated trust. No idea why that would be.

    Don't know if it's relevant, but I had a problem earlier where Chrome suddenly started claiming that SL wasn't installed, even though it was. I fought with this for a while, but eventually got around it by uninstalling SL and then reinstalling. I ran into the problem that you can't install the SL4 tools if you have VS2010 SP1 installed, and had to resort to workarounds to sort that as well. I don't know if something's gone wrong with my SL installation, which is causing this error. Thought it might be relevant to mention.


    FREE custom controls for Lightswitch! A collection of useful controls for Lightswitch developers (Silverlight client only). Download from the Visual Studio Gallery.

    If you're really bored, you could read about my experiments with .NET and some of Microsoft's newer technologies at http://dotnetwhatnot.pixata.co.uk/

    Wednesday, April 29, 2015 5:34 PM
  • Do you enable trace in your project? the error messages will show the path to troubleshoot
    Thursday, April 30, 2015 2:09 PM
  • Do you enable trace in your project? the error messages will show the path to troubleshoot

    Not sure what you mean, but I know the path, as it's described clearly in the line of code I posted.

    The problem isn't the path itself, it's that SL is suddenly unable to access the local file system. I'm pretty sure that this is to do with having to uninstall and reinstall SL yesterday. It looks like something is missing, but I can't work out what. It was a nightmare trying to install all the bits anyway, as the SL dev tools installer refuses to proceed if you have SP1 installed.

    Thanks anyway. Any other ideas?


    FREE custom controls for Lightswitch! A collection of useful controls for Lightswitch developers (Silverlight client only). Download from the Visual Studio Gallery.

    If you're really bored, you could read about my experiments with .NET and some of Microsoft's newer technologies at http://dotnetwhatnot.pixata.co.uk/

    Thursday, April 30, 2015 2:19 PM
  • In case it helps anyone, I eventually solved this by randomly installing various Silverlight packages, including the run time, the SDK, the dev tools, etc. Most of them told me they were already installed, but eventually I must have managed to install something that was missing, as it now works.

    FREE custom controls for Lightswitch! A collection of useful controls for Lightswitch developers (Silverlight client only). Download from the Visual Studio Gallery.

    If you're really bored, you could read about my experiments with .NET and some of Microsoft's newer technologies at http://dotnetwhatnot.pixata.co.uk/

    • Marked as answer by Mr Yossu Tuesday, May 5, 2015 12:49 PM
    Tuesday, May 5, 2015 12:49 PM