Subject Re: PROGRAMDATA Error while trying to write to file
Author Peter Morris
>I solved a similar problem installing
> application and database (an
> Access file) in C:\MyCompany\MyApp.

Hmm, that's something I could do out of pure desperation I suppose,
but I really wouldn't be happy with it. I'd like my database
installed in the "proper" place!

The user running my application does have permission to write to the
folder in question as the following code reveals...

static void Main(string[] args)
{
string fileName =
Environment.GetFolderPath(System.Environment.SpecialFolder.CommonApplicationData);
fileName = Path.Combine(fileName, "MyTest.txt");
Console.WriteLine("Writing to " + fileName);
StreamWriter sw = new StreamWriter(fileName);
using (sw)
sw.WriteLine("Hello");
Console.WriteLine("Done");
Console.ReadLine();
}


Works perfectly, so the problem must lie in the embedded DLL. Can
anyone shed any light on this?


Thanks

Pete