Dotnet Quit Unexpectedly Visual Studio

Hi, ConnectionAbandonedByReqQueue A worker process from the application pool has quit unexpectedly or orphaned a pending request by closing its handle. Does it help if you increase the queuelength value in application pool advanced settings? 818823 FIX: The C compiler quits unexpectedly when you use a valid negative mov offset statement in inline assembly code in Visual Studio.NET 2003 Q818823 KB818823 October 5, 2005 817795 FIX: The ToolTip component may cause a memory leak when it is added to a child MDI form in Visual Studio.NET Q817795 KB817795 September 27, 2005.

-->

This article helps you resolve the problem where unhandled exceptions cause ASP.NET-based applications to quit unexpectedly in the .NET Framework.

Dotnet quit unexpectedly visual studio 2017Visual

Original product version: .NET Framework 4.5
Original KB number: 911816

Note

This article applies to the Microsoft .NET Framework 2.0 and all later versions.

Symptoms

When an unhandled exception is thrown in a ASP.NET-based application that is built on the .NET Framework 2.0 and later versions, the application unexpectedly quits. When this problem occurs, no exception information that you must have to understanding the issue is logged in the application log.

However, an event message that is similar to the following example may be logged in the System log. Additionally, an event message that is similar to the following example may be logged in the application log.

Dotnet quit unexpectedly visual studio 10

Visual Studio Mac Dotnet Quit Unexpectedly

Cause

This problem occurs because the default policy for unhandled exceptions has changed in the .NET Framework 2.0 and later versions. By default, the policy for unhandled exceptions is to end the worker process.

In the .NET Framework 1.1 and in the .NET Framework 1.0, unhandled exceptions on managed threads were ignored. Unless you attached a debugger to catch the exception, you wouldn't realize that anything was wrong.

ASP.NET uses the default policy for unhandled exceptions in the .NET Framework 2.0 and later versions. When an unhandled exception is thrown, the ASP.NET-based application unexpectedly quits.

This behavior doesn't apply to exceptions that occur in the context of a request. These kinds of exceptions are still handled and wrapped by an HttpException object. Exceptions that occur in the context of a request don't cause the worker process to end. However, unhandled exceptions outside the context of a request, such as exceptions on a timer thread or in a callback function, cause the worker process to end.

Resolution 1

Modify the source code for the IHttpModule object so that it will log exception information to the application log. The information that is logged will include the following:

  • The virtual directory path in which the exception occurred
  • The exception name
  • The message
  • The stack trace

To modify the IHttpModule object, follow these steps.

Note

This code will log a message that has the Event Type of Error and the Event Source of ASP.NET 2.0.50727.0 in the application log. To test the module, request an ASP.NET page that uses the ThreadPool.QueueUserWorkItem method to call a method that throws an unhandled exception.

  1. Put the following code in a file that is named UnhandledExceptionModule.cs.

  2. Save the UnhandledExceptionModule.cs file to the C:Program FilesMicrosoft Visual Studio 8VC folder.

  3. Open the Visual Studio Command Prompt.

  4. Type sn.exe -k key.snk, and then press ENTER.

  5. Type csc /t:library /r:system.web.dll,system.dll /keyfile:key.snk UnhandledExceptionModule.cs, and then press ENTER.

  6. Type gacutil.exe /if UnhandledExceptionModule.dll, and then press ENTER.

  7. Type ngen install UnhandledExceptionModule.dll, and then press ENTER.

  8. Type gacutil /l UnhandledExceptionModule, and then press ENTER to display the strong name for the UnhandledExceptionModule file.

  9. Add the following code to the Web.config file of your ASP.NET-based application.

Resolution 2

Change the unhandled exception policy back to the default behavior that occurs in the .NET Framework 1.1 and in the .NET Framework 1.0.

Note

Studio

We do not recommend that you change the default behavior. If you ignore exceptions, the application may leak resources and abandon locks.

To enable this default behavior, add the following code to the Aspnet.config file that is located in the following folder:
%WINDIR%Microsoft.NETFrameworkv2.0.50727

Status

This behavior is by design.

Dotnet Quit Unexpectedly Visual Studio 2013

More information

For more information about changes in the .NET Framework 2.0, visit Breaking Changes in .NET Framework 2.0.

Dotnet Quit Unexpectedly Visual Studio Download

Visual Studio 2019 Version 16.4.6
Have AspNetCoreVersion: 3.1.1
I get the following error for all packages:
Error MSB4018 The 'ResolveTargetingPackAssets' task failed unexpectedly.
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:Program FilesdotnetpacksNETStandard.Library.Ref2.1.0dataFrameworkList.xml'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
at System.Xml.XmlTextReaderImpl.FinishInitUriString()
at System.Xml.XmlTextReaderImpl..ctor(String uriStr, XmlReaderSettings settings, XmlParserContext context, XmlResolver uriResolver)
at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings, XmlParserContext inputContext)
at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
at Microsoft.NET.Build.Tasks.ResolveTargetingPackAssets.AddReferencesFromFrameworkList(String frameworkListPath, String targetingPackDllFolder, ITaskItem targetingPack, List`1 referenceItems)
at Microsoft.NET.Build.Tasks.ResolveTargetingPackAssets.ExecuteCore()
at Microsoft.NET.Build.Tasks.TaskBase.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() Foundation.BlazorCssVendors C:Program Filesdotnetsdk3.1.102SdksMicrosoft.NET.SdktargetsMicrosoft.NET.Sdk.FrameworkReferenceResolution.targets 283
It seems that C:Program FilesdotnetpacksNETStandard.Library.Ref2.1.0 is empty.
Why is that?
Gorhal
Continue reading...