Right Rights still ain't Right?
I'm perplexed, puzzled and pooped. I'm writing a class that is instantiated in Global.ASAX (FX 1.1) which needs to read in both a schema and an XML file when the application starts. Sounds easy enough, right?
Not so fast!
Consider this line of seemingly innocent code (where name = “d:\inetpub\***\rules.xsd”):
fileStream = New IO.FileStream(name, IO.FileMode.Open)
That line generates:
Access to the path "D:\inetpub\***\Rules.xsd" is denied
Okay, sure, I could buy that. So let's so see. I'm not running in an impersonation context, so the context for accessing the file is NT Authority\Network Service...
Problem: Network Service has read permissions on that file... Hrmmm, I say. Hrmmmm. We then, let's try that with Impersonation turned on even though for the scope of Global.ASAX it shouldn't make a difference. Well with that turned on, I don't get the exception even though I should have. Its as if Global.ASAX just said “duhhh...“ The OnStart event dies and default.aspx's page_load fires. Nice.
I'm doing this on IIS6 in an MS Virtual Server 2005 session. This works on IIS5.1, of course. That's gotta mean its CAS that for IIS6 that's given me the problem, right? FX 1.1 and 2.0 are installed, the site is setup for ASP.NET 1.1
Any thoughts on this one?