.net - How to create a dump of the current ASP.NET managed process for debugging? -
I'm trying to debug an ASP.NET application. This is especially difficult because the bug is posted only in released code production it can not be repeated in the development or testing environment.
I am investigating the issue by creating a dump file on a particular line, where the problem is occurring. However, production environment can not be taken at any point due to business needs. This is the reason that this is also the reason that remote debugging can not be done.
Does anybody know how I compelled for a dump file is manufactured for w3wp.exe at a certain point in the managed code, still can still allow the rest of the application to be normal To operate with?
Use the rights to the web app so much and you can deploy the new code environment, You can manually create a dump file with the use of DbgHelp API:
[DllImport ("Dbghelp.dll", SetLastError = true)] Fixed Execution bool MiniDumpWriteDump (IntPtr ProcessHandle, Integer ProcId, IntPtr filehandle, Integer DumpType, IntPtr ExcpInfo, IntPtr UserInfo, IntPtr ExtInfo); Private static zero dump () {string outputFileName = "c: \\ mem.dmp"; Using (using FileStream stream = new FileStream (outputFileName, FileMode.Create, FileAccess.ReadWrite)) {Process Procc = Process.GetCurrentProcess ()) {MiniDumpWriteDump (proc.Handle, proc.Id, stream.SafeFileHandle .DangerousGetHandle (), (Int) 0x00000306, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero); }}}
Comments
Post a Comment