I'm working on Asp.net MVC4 project using Visual Studio 2012.
When there's an error during debugging, it used to stop on the error.
But suddenly, the debugger does not stop and just spit out the error information webpage like below.
Server Error in '/' Application.
The given key was not present in the dictionary.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.Collections.Generic.KeyNotFoundException:
The given key was not present in the dictionary.
Source Error: ...
Stack Trace: ...
How can I set the debugger to stop on the error?
I had the same problem, even my debugging options are the same as #John Koerner.
I found that not all exception types are enabled to break the solution by default. You can choose which are enabled from the Exception Setting window.
VS2015: Debug -> Windows -> Exception Settings.
VS2012: Debug -> Exceptions more details
I enabled the whole CLR Exceptions set.
Make sure the exception assistant is enabled:
Related
Unable to deploy to Azure App Service. What might be possibly going wrong here?
10-10-2021 11:07:06
System.AggregateException: One or more errors occurred. ---> Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.
--- End of inner exception stack trace ---
---> (Inner Exception #0) Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.<---
Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.
===================
I'm using Visual studio 2022 Preview.
I tried this solution earlier, but this didn't work in my case, this was actually due to partially deleted publish profile under the properties folder.
So completely clearing (leaving launchSettings.json intact) that and adding profile again helped me resolve this issue.
So, the problem: I have working application on UWP, written on C# and C++. It works as it must work on desktop in releas and debug modes. It worked on mobile devices and emulator not so long before some changes happend in C++ part. But now application crashes at the begining of C++ part if application opens on emulator or mobile. MSVS gives me this messages, but It does't helped:
Exception thrown at 0x7767B928 (ntdll.dll) in rhodes.exe: 0xC0000139: Entry Point Not Found.
Exception thrown: 'System.Runtime.InteropServices.COMException' in System.Private.Interop.dll
The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)
Exception thrown: 'System.Runtime.InteropServices.COMException' in System.Private.Interop.dll
Exception thrown at 0x76EA2812 (KernelBase.dll) in rhodes.exe: 0x40080201: WinRT originate error (parameters: 0x8007007F, 0x00000050, 0x03B0E2DC).
Any ideas?
Go to Debug -> Windows -> Exception, and enable breaking on all exception types (C++, CLR and Win32) ones. Depending on where the issue comes from, you'll need to use either native or managed mode debugging (you can set it in Project Properties -> Debug tab). Now, the project should hit a breakpoint when you hit that exception, which will point you to where it is coming from.
I have an application hosted in iis. Very occasionally (every month or two) the following exception is thrown:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for "System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory" threw an exception. ---> System.MissingFieldException: Field not found: ?.s_webServicesFactoryType.
The application is set to automatically recycle every day and it seems sometimes after a recycle this exception is thrown repeatedly until the next recycle.
The only hit I can find on google is http://mcfunley.com/135/bizarro-typeinitializationexception-in-systemruntimeremoting, which describes the exact same problem but there doesn't seem to be a solution posted.
Has anyone experienced this before?
Thanks in advance.
We have over 1000 unit tests. A while ago 18 of them started to fail when they were run together with the other tests. These tests run a windows workflow.
If they are run alone they pass.
The error appears to be that it cannot find the connection string.
It cannot find the connection string because it does not know which config file to look in.
It does not know which config file to look in because it cannot find the application context
And it cannot find the application context due to a compilation lock.
Anybody have any idea what could be wrong, and how to fix this? The error I am getting is:
Message: Exception message: The
supplied connection string is not
valid, because it contains
insufficient mapping or metadata
information. Parameter name:
connectionString Inner exception :
System.InvalidOperationException:
Unable to determine application
context. The ASP.NET application path
could not be resolved. --->
System.Reflection.TargetInvocationException:
Exception has been thrown by the
target of an invocation. --->
System.Web.HttpException: The type
initializer for
'System.Web.Compilation.CompilationLock'
threw an exception. --->
System.TypeInitializationException:
The type initializer for
'System.Web.Compilation.CompilationLock'
threw an exception. --->
System.NullReferenceException: Object
reference not set to an instance of an
object. at
System.Web.Compilation.CompilationLock..cctor()
--- End of inner exception stack trace --- at System.Web.Compilation.CompilationLock.GetLock(Boolean&
gotLock) at
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()
Thanks
Shiraz
Since you mention that your tests run a WF workflow, I would guess that a previous test run has one or more workflow instances that still run on a thread somewhere, thus locking the compiler because the assemblies are still loaded in a process somewhere.
Can you open Task Manager and investigate whether there's a running process that still uses the workflow somewhere? If so, kill it and see if you can't compile.
So a webapp I've been working on broke, and I made some fixes... it still crashes, but in the YSOD it shows me the old code. I'm running this from the VS 2005 IDE. It won't hit any breakpoints, and it crashes on line 249, which is clearly commented out. I've cleared out my debug/release folders and rebuilt it; restarted IIS (just in case); what would cause this?
Could not find file 'c:\Program Files\Microsoft Visual Studio 8\Common7\IDE\map.xml'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: Could not find file 'c:\Program Files\Microsoft Visual Studio 8\Common7\IDE\map.xml'.
Source Error:
Line 248: //XmlDocument xMap = new XmlDocument();
Line 249: //xMap.Load(MapPath("map.xml"));
The current code probably did not compile, therefore the metadata in the DLL is for your old code.