CommonApplicationData on Vista

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I have an app that uses Embedded Firebird for its DB so that I don't need to
install a DB server. On Vista my app throws an exception "Error trying to
write to file (the correct path here)".

The following code proves that the current user is able to write to the
specified folder.

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();
}


I have checked and the database file is in CommonApplicationData.


So my question is, are the UAC rules different between .NET assemblies and
binaries? It's the only thing I can think of :-)



Pete


.



Relevant Pages

  • Re: my ftp app not work correctly on Vista - OK on XP?
    ... on an FTP/web server. ... My app appears to install fine on XP and Vista ... but there's absolutely no reason to skip the diagnostic step of verifying that other FTP clients also do not work on the same computer. ...
    (microsoft.public.dotnet.languages.csharp)
  • my ftp app not work correctly on Vista - OK on XP?
    ... I wrote a simple ftp app for listing/downloading files from a directory ... on an FTP/web server. ... My app appears to install fine on XP and Vista ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Vista problems
    ... when opening my app in Vista. ... one of the file I install (a database file whose data is owned by us--is ... You probably need to put your database file in a writeable ...
    (borland.public.delphi.non-technical)
  • Re: Access 97 crash
    ... server. ... I can open the database file and work with it but as soon as I ... This app runs fine on Win2000 ... rights...the second login is sysop. ...
    (comp.databases.ms-access)
  • Re: Advice requested for SQLCE MDI app
    ... Plus, your app will consume more memory, and you'll have problems cranking complex queries ... As a strategy, I am loading a complete SQLCE database file into a DataSet, manipulating the data in various tables and 'pouring' the data including any changes, back to the database file when the user closes the app. ... The performance seems good, actually fantastic, but I have not implemented massive updates yet and I understand that the dataadapter only update those rows which have been changed.. ...
    (microsoft.public.dotnet.framework.adonet)