Web service
-
Hi, I have created a web service and i have created the msi file. I deployed the Web service in the IIS by running the msi file. If any exceptions occur during the WS call i want log the exceptions in to a file. I have given the file path in the web.config file. Until or unless i create a directory with write permission, its not creating the file in the mentioned path. for ex: path : c:\Inetpub\wwwroot\webservice\ErrorLog\ErrorLog.txt If the dont create the ErrorLog folder with write permission its showing the c:\Inetpub\wwwroot\webservice\ErrorLog\ErrorLog.txt denied message. Is there any way to create directory with write permission through the c# code itself or the above is the only way to log the message. Please help me. With Regards, Anand
-
Hi, I have created a web service and i have created the msi file. I deployed the Web service in the IIS by running the msi file. If any exceptions occur during the WS call i want log the exceptions in to a file. I have given the file path in the web.config file. Until or unless i create a directory with write permission, its not creating the file in the mentioned path. for ex: path : c:\Inetpub\wwwroot\webservice\ErrorLog\ErrorLog.txt If the dont create the ErrorLog folder with write permission its showing the c:\Inetpub\wwwroot\webservice\ErrorLog\ErrorLog.txt denied message. Is there any way to create directory with write permission through the c# code itself or the above is the only way to log the message. Please help me. With Regards, Anand
anandhakrishnan wrote:
If the dont create the ErrorLog folder with write permission its showing the c:\Inetpub\wwwroot\webservice\ErrorLog\ErrorLog.txt denied message.
There are Two Solution for that. 1. If you are using IIS 6.0 or above, Create a separate
Application Pool
, Change the identity of Application to "Local System
", By default it is "Network Service", which is having minimum privilege on your system and that will not allow you to write on server. Change the Identity of Application Pool to "Local System", Assign the Application Pool to you virtual Directory. Then Try. It will work :) 2. Give the Right Permission to All th user to that file. I will suggest you to go for application pool. Let me know if any other issue.cheers, Abhijit CodeProject MVP