If you blog, and haven’t used any of my plug-ins for Windows Live Writer, may be you should. In this post though, the agenda is not to push you to install the plug-ins but tell you about my experience with Application.StartupPath and how problematic it could be!!!
Well, it all started when I decided to write a few plug-ins for my favorite Windows Live Writer. The SDK was easily available, and I found that any new plug-in was required to be installed in the Plug-in folder inside WLW Installation folder. I never realized that a code as simple as Application.StartupPath would cause so much problem for me. In fact, quite a lot of users who downloaded the plug-in complained that it just doesn’t work. Finally, I had to give a suggestion that they should run WLW as an Administrator and the issue would go away!
Anyways, I decided to fix this issue once and for all, and the only change that was required was to use Application.UserAppDataPath instead of Application.StartupPath. By the way, in case you don’t know why this happens only in Vista… you should read this. In a nutshell, it is because of security implications, and Vista is much more strict than its predecessors. You should prefer using the UserAppDataPath in case you are writing a new file. Application.StartupPath is NOT the way to go.
Hope this helps,
Rahul
Quote of the day: Fall not in love, therefore; it will stick to your face. - National Lampoon