I need create a file and need to write the every exception in a file. i am using bellow code to do that.
File.Create(filePath);
File.AppendText("Exception Detail Start-------------------------------------------");
File.AppendText("Stack Trace :" + ex.StackTrace );
File.AppendText("Error :" + ex.Message );
File.AppendText("Exception Detail End-------------------------------------------");
But I'm getting the below error:
Additional information: Access to the path 'C:\Program Files (x86)\IIS Express\Exception Detail Start-------------------------------------------' is denied`