an unhandled win32 exception occurred in

При запуске различных программ пользователь может встретиться с сообщением «Unhandled exception has occurred in your application», после чего программа обычно просит нажать на кнопку «Continue» для продолжения работы. При этом после нажатия на данную кнопку приложение обычно бывает закрыто. Данный материал призван помочь пользователю исправить эту ошибку, я расскажу, что это за проблема, и как исправить Unhandled exception has occurred на вашем ПК.

Ошибка Unhandled exception has occurred при запуске игры PES

Суть проблемы Unhandled exception has occurred

В переводе с английского сообщение «Unhandled exception has occurred in your application» полностью звучит как «В вашем приложении произошло необработанное исключение. Если вы нажмёте на «Continue», то приложение проигнорирует эту ошибку и попытается продолжить работу. Если вы нажмёте на «Quit», приложение будет немедленно закрыто».

Появление такого сообщения имеет широкую вариативность причин, связанную с повреждением файлов, обслуживающих работу приложения, а также с проблемами в их отлаженном функционале. Ошибку с сообщением Unhandled exception has occurred можно встретить как при запуске множества игр, так и при работе различных служебных приложений и других специализированных программ.

Скриншот проблемы

Что делать с Unhandled exception

Чтобы исправить данную дисфункцию нужно сделать следующее:

  • Перезагрузите ваш компьютер, иногда это помогает;
  • Запускайте проблемное приложение с правами администратора, в некоторых случаях это оказалось эффективным;
  • Проверьте вашу систему на наличие вирусов, иногда причиной возникновения данной дисфункции является повреждение зловредами тела программы. Используйте проверенные антивирусные программы уровня Dr.Web CureIt!, Trojan Remover и другие;
  • Проведите восстановление программы NET Framework (зайдите в список установленных программ, найдите NET Framework, и, кликнув на неё дважды выберите «Repair»). После проведения процедуры восстановления попробуйте вновь запустить требуемое приложение;
  • Переустановите приложение Visual C++, проблемы в его работе также могут вызывать описываемую мной проблему
  • Переустановите с нуля проблемное приложение, а также попробуйте другой взлом к нему (при пиратской версии);
  • Загрузите ваш компьютер в безопасном режиме (safe mode) и попробуйте запустить приложение. Несмотря на то, что в данном режиме функционал системы существенно ограничен, для некоторых проблемных приложений это может быть хорошим лакмусом в выявлении корня проблемы. Если приложение запустилось, убедитесь в свежести драйверов для компонентов вашего ПК, а также проверьте, нет ли конфликтов между компонентами системы в диспетчере устройств;
  • Если в безопасном режиме ошибка «Unhandled exception has occurred in your application» повторяется, тогда выполните чистую загрузку (clean boot) системы.

Как исправить ошибку в зависимости от вашей операционной системы описано здесь.

Заключение

Описываемая выше ошибка Unhandled exception has occurred имеет широкую вариативность причин своего возникновения. Очень часто в этом виноваты вирусные программы, а иногда программа плохо функционирует из-за некорректно произведённого взлома. Попробуйте весь список предложенных мной советов, один из них обязательно окажется для вас наиболее действенным и эффективным.

I get the following exception when trying to load an ASP.NET MVC website:

Unhandled exception at 0x07070a91 in w3wp.exe: 0xC0000005: Access violation reading location 0x00000000.

The Visual Studio Just-In-Time Debugger opens and the only information I can see in the debugger is this:

The website uses some COM objects and everything worked fine until last week. This problem appeared out of the blue.

This is the error log from Windows Event Viewer:

Faulting application name: w3wp.exe, version: 7.5.7601.17514, time stamp: 0x4ce7a5f8
Faulting module name: MSVBVM60.DLL, version: 6.0.98.15, time stamp: 0x4a5bda6c
Exception code: 0xc0000005
Fault offset: 0x00030a91
Faulting process id: 0x1a0
Faulting application start time: 0x01cd31fcb47f66d8
Faulting application path: C:WindowsSysWOW64inetsrvw3wp.exe
Faulting module path: C:Windowssystem32MSVBVM60.DLL
Report Id: f5db0ae3-9def-11e1-ad79-005056c00008

Do you have any suggestions to help troubleshoot this problem?

Edit: I managed to solve the problem and now everything works. The solution involved tweaking some registry settings that the custom dlls need in order to function properly. So the problem didn’t actually appear out of the blue, I just didn’t realize some registry values were modified, which caused a com dll to crash.

I recently got a new PC at work and had to reinstall development tools, etc. The PC runs Windows XP (blech), and I’ve got Visual Studio 2010 and .NET Frameworks 2.0, 3.5, and 4.0 installed, each with all current service packs and patches. Windows XP itself is also up-to-date (if one could say that 🙂

One recurring problem I’ve noticed is the following dialog, which tends to pop up after the machine has been idle for a bit:

I suspect the crash is due to the .NET Framework performing Ngen compilation of system assemblies in the background, and crashing when it reaches one assembly in particular.

I’ve found another mention of this problem at the MSDN forums, and one of the suggested workarounds is to configure Windows XP’s Data Execution Prevention feature to «Turn on DEP for essential Windows programs and services only». However, that’s already the setting in effect on my PC.

How can I diagnose further? When I try to attach to the process, it’s already gone.

Are there any other suggested or likely fixes?

UPDATE:

I found some more information on ngen here and here.

I ran the following at a Command Prompt: ngen executequeueditems .. this now lets me reliably reproduce the problem instead of waiting for the idle background ngen to execute.

So, when ngen.exe got to the following entry:

. the result was the following error dialog:

Whereas, other assemblies that failed native image generation didn’t actually cause a crash, just an error message.

So, the specific assembly this is failing on is: Microsoft.SqlServer.Management.MultiServerConnection.

What else can I do? I don’t particularly care if it can be ngen’d or not at this point; I simply want to stop this annoying recurring error dialog from above. I already tried:

ngen uninstall Microsoft.SqlServer.Management.MultiServerConnection ,

. but it says «ERROR: The specified assembly is not installed.»

Is there a way to remove an assembly from the ngen queue, so ngen won’t even try to generate a native image for it?

4 Answers 4

The nGen of the Sql Server assembly is failing because a previous attempt at nGening the .Net Framework 2.0 mscorlib assembly has failed. This is nothing to do with .Net 4 at all so I suggest you stop looking at it’s ngen service (2 and 4 use their own services).

As for why that’s failed — well there’s not a huge amount around on the net about this. I did find this on MSDN forums though — there’s something in there about confirming whether mscorlib has been correctly nGen’d — I’d check that out.

Interestingly Sql Server is mentioned on that thread too; although it’s 2005 and I think version 10 assemblies you’re talking about here are Sql 2008. Still, might provide something.

But ultimately if this were my machine I would:

Uninstall .Net 2.0 and 3.0 and 3.5 (if you’re feeling brave uninstall 4.0 as well)

Uninstall whatever Sql Server component it is that contains the assembly that’s failing the nGen.

Install the .Net 3.5 sp1 redist; making sure you have also got the hotfix that is referenced for further down the page as well.

Wait for all the nGening to complete before continuing.

If you uninstalled .Net 4 reinstall that now too.

Reinstall the Sql Server component removed in step 2.

Yes, I know, kinda a ‘switch it off and on again’ answer — but I think it’s better than trying to sidestep the issue. If mscorlib 2.0 has not nGen’d correctly then tbh .Net 2.0 is not really usable in its current state. And since this is a SQL Server component that’s trying to nGen — only an nGen’d mscorlib v2 will work with it (nGen’d mscorlib v4 will not).

mscorsvw.exe could be seen as a Microsoft program and still profit from DEP, you can check if it is really off with Process Explorer. Either by adding a DEP column or checking the properties of the process.

Visual Studio (at least for me) isn’t really handy to debug crashes, you’ll better get a dump so we can try to look at the possible causes. You can install the default debugger using drwtsn32.exe -i . Or if you want to learn you could use WinDBG, which allows you to analyze crashed programs in more detail. Though, this is though stuff if you aren’t interested in it.

I suspect the crash is due to the .NET Framework performing Ngen compilation of system assemblies in the background, and crashing when it reaches one assembly in particular.

Wouldn’t ngen.exe crash instead then? Can you confirm that ngen.exe was running?

You could set up Process Monitor so that it only shows process/thread start/stops so you can see what ran, just leave it running for a while and consult back once you get that debugging window.

«Turn on DEP for essential Windows programs and services only».

Since mscorsvw.exe is a service, this doesn’t really affect it.

Look at the ngen log files. They are probably located in various folders like C:WindowsMicrosoft.NETFrameworkv4.0.30319 or whatever framework versions you have installed.

Mscorsvw .exe is process related to Microsoft .NET framework. Mscorsvw process is used to precompile .Net framework assemblies in the background.

Mscorsvw.exe process runs only in the background if it needs to compile highest priority assemblies after installing .NET framework redistributable and an application using .NET framework is installed to have its assemblies compiled.

Normally precompiling high priority assemblies will be done by mscorsvw.exe process with in 5 to 10 minutes and then it will try to process low priority assemblies when your Computer is idle.

Disabling or stopping mscorsvw.exe

  1. Navigate to C:WINDOWSMicrosoft.NETFrameworkv2.0.50727 in Windows Explorer.
  2. Open the command prompt by typing cmd in run box and press enter.
  3. Now we need to specify the above path in command and now type
    ngen.exe executequeueditems
    and press enter.
  4. Now wait for the process to precompile all assemblies, after couple of minutes it will be completed.

Now you observe there will be no mscorsvw.exe process running in task manager.

You can also use this command at anytime to see if there is anything queued up waiting to be executed :

To clear all queued items do :

To find out which assemblies are causing the problem, the log files that may help answer this:

On another note, you do not need .NET Frameworks 2.0 and 3.5, as 4.0 is supposed to substitute for all of them.

Оцените статью