0
votes

I have a strange problem .I have a WCF service hosted on IIS7..The service on IIS points to my deployment path D:\myService.My service takes data from client applications and save into Xml file which is available on path D:\MyService\App_Data. I also read current Data from Xml file through my service in my client application UI.

When I update xml data from client,it updates and reads back updated data.I also checked through WCF client and found updated data is there on service xml file .But when I open xml file in D:\MyService\App_Data path,I cant see updated data.Where is my updated data got saved?

I try restarting client ,but still it shows my updates reading through service but the xml file has no changes.

my service behavior is

  [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
public class MyService: IMyService
{

and I use xml path in service code as

   private readonly string mXmlPath = Path.Combine(HostingEnvironment.ApplicationPhysicalPath, "App_Data",
        "myDb.xml");
1
Is that path hardcoded or is part of it an environment variable? Your IIS is running under a different user than your desktop.nvoigt
Users are same for IIS and desktop,its hosted on same system where client is running. No hardcoded paths ,in my service code I use as private readonly string mXmlPath = Path.Combine(HostingEnvironment.ApplicationPhysicalPath, "App_Data", "myDb.xml");TRS
Then how about writing a function returning that path to the client? So you can check where your file ended up?nvoigt
@nvoigt-Good idea,let me try to log the path.TRS
@nvoigt I checked path is same as D:\MyService\App_Data\myDb.xml.TRS

1 Answers

0
votes

I resolved the problem by adding Write permissions to NETWORK_SERVICE account on my deployment folder.It works fine now.