[Mono-list] Unable to read ini file in Windows Service

Robert Jordan robertj at gmx.net
Tue Jul 29 05:39:52 EDT 2008


k1Ll5w1tcH wrote:
> I know this is not a mono related question, using VS2008 for this one, but
> please help me out.
> 
> I've written a windows service app, which needs to read an ini file. When I
> read the file, the getprivateprofilestring function returns no result, no
> errors and only "". When I run it in a windows forms app, it works fine.
> Is there something I'm missing??

Get[Private]ProfileString behaves like this when it was not able to
read the INI file. It's a broken old API.

> Please help me out guys!
> 
> P.S. The file is on the local disk and the SYSTEM account has full control
> of the file. 

IIS does not run the ASP.NET worker process as SYSTEM. Add an ACE with
read access rights for the user "IUSR_$machinename" to the ACL of this
file.

Robert



More information about the Mono-list mailing list