Today I was debugging an application in my work. I proceeded to set a breakpoint in one of my catch blocks in order to inspect an exception with more detail.
The View Detail
modal window opens normally, but instead of showing me the details of the exception, it is throwing a strange error, one I never got, nor I know what it means:
The error says:
The name '$exception' does not exist in the current context
This is frustating because I am within the catch block scope, so I should be able to see my exception.
After restarting my application, I managed to debug it just fine. This was the only time (so far) I got this error.
Does anyone know what it means and how can I fix it (without having to restart application)?
NOTE: I am using Visual Studio 2012 Premium. Version 11.0.61030.00 Update 4
CS0103 is caused when you are using a name for a variable or method that does not exist within the context that you are using it. In order to fix the CS0103 error you will need to correct the name of the variable or method from where it is declared or referenced.
I know this error means that the control being referenced generally doesn't exist or is not a part of the class that's referencing it, but as far as I can see, that isn't the case here.
Many a times while writing a code we get this error which says, “The name does not exists in the current context”. This is because the code behind file is not able to find the control being added to your aspx file.
I solved the same problem in these steps:
step 1) If you program your custom DLL in C++ using Visual studio,then at the property page of your project set the Common Language Runtime Support (/clr)
parameter to Common Language Runtime Support (/clr)
.
step 2) To function deceleration in .h
file use __declspec(dllexport)
keyword like below:
__declspec(dllexport) double Sub(int a,int b);
step 3) Build and export DLL file, then use the Dependency Walker software to get your function EntryPoint.
step4) Import DLL file In the C# project and set EntryPoint and CallingConvention variable like below:
[DllImport("custom.dll", EntryPoint = "?Sub@@Y234NN@Z", CallingConvention = CallingConvention.Cdecl)]
public static extern double Sub(int a,int b);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With