Jacob
Jacob

Reputation: 525

Can't write to XML file from WCF service hosted in IIS 7.5

I have a simple WCF service library hosted in IIS 7.5 running on my local machine. The service is supposed to read and write to an xml file in the root of the sites directory. Running in VS2010 with the test client this works fine. When I call my IIS hosted service from a winforms client the service can't write or read from the xml file. I guess my question is why can't my WCF service write to a XML file when it is hosted in IIS but has no problems running in debug?

Upvotes: 2

Views: 1611

Answers (1)

Jacob
Jacob

Reputation: 525

Turns out my problem was that I hadn't changed my working directory from C:\windows\system32\inetsrv\ to my application's physical directory. Adding "AppDomain.CurrentDomain.BaseDirectory &" to my file path took care of it.

Upvotes: 2

Related Questions