1

For some reason this line of code...

var dirInfo = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

...returns an empty string on my dev machine.

I'm running OOB and with elevated trust on Win7.

I don't honestly know quite where to start on this. Can anyone shed any light?

Thanks in advance,

EightyOne Unite
  • 11,665
  • 14
  • 79
  • 105
  • 1
    I can't repro -- I have a "bare" silverlight project, with just the one line you have, and once I enable out of browser and elevated trust, it works. Now, without elevated trust, the exception that gets throw includes an empty string as the path -- maybe you aren't really getting elevated? – JMarsch Mar 10 '11 at 16:38
  • Thanks for trying. As I suspected,.. this was environmental. See my answer below. – EightyOne Unite Mar 10 '11 at 16:46

1 Answers1

2

Joy of joys...

The problem was down to my working from home on a machine which uses roaming profiles! Should've guessed that really.

The fix was simple enough.

RegEdit -> HKCU -> Software -> Microsoft -> Windows -> Current Version -> Explorer -> User Shell Folders -> Personal was pointing to a remote (unavailable) path. Just changed this to a local path and all worked well.

EightyOne Unite
  • 11,665
  • 14
  • 79
  • 105