Deepak
Deepak

Reputation: 761

Load XML file from a folder inside System32 for wcf (.svc) c# code

I want to load a xml file located in one of the application folder located inside the system32 from a mehod inside the wcf (.svc.cs).

I tried using the shared drive, mapping the shared drive as Z: and also using direct path C:\Windows\System32\WindowsPowerShell\v1.0\Modules\App in all the cases I get System.IO.DirectoryNotFoundException

Is it possible to read xml file from the System32, please let me know

Thanks Deepak

Upvotes: 0

Views: 374

Answers (2)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039080

Is it possible to read xml file from the System32

Yes, but you need to run your application under an account that has read permissions to this folder. You mentioned WCF. If you are hosting this service inside IIS ensure that the application pool is configured with such an account.

Upvotes: 1

tom redfern
tom redfern

Reputation: 31770

You have to grant permissions to the directory to the user account which your WCF service host is running as.

Upvotes: 1

Related Questions