jeudi 28 juin 2018

.Net Core API - File Write Issue

I am getting weird issue and not sure if I am doing wrong somewhere. describing problem in points below:

  1. Web API created in .Net core 2.0 and hosted on IIS 7.5, with separate Application Pool. i.e say "No Managed Code" and running with "Local System" service.

  2. Calling Web API service method from POSTMAN, Posting XML and receiving xml successfully.

  3. In same Web API Service, trying to create request and response log using simple System.IO.File.WriteAllText(path, content). Working fine when calling it from POSTMAN. Path Folder is of D: drive of same machine when WebAPI is hosted on IIS. Read-Write permissions given on folder to all users like EveryOne, Local System, Administrators, Network Services etc.

  4. Now, the problem here is when calling the same service from Web Application developed on .Net 4.0 then System.IO.File.WriteAllText(path, content) is not giving any error plus not creating file. Secondly, Sharing GUID folder name stored on ViewData ((Controller)filterContext.Controller).ViewData.Add("TracePath", strTracePath + strNewGuidFolder); from filter class method to Controller for writing Response file is also appears empty.

Not sure what to do here, please suggest.




Aucun commentaire:

Enregistrer un commentaire