How to use +number in asp.net server error page? - asp.net-2.0

If my app throws an exception I see the server error page. The stack track shows the method where the error occurred (null reference exception for example), and a plus number, like +730. How can I backtrack that number to the line of c# code?
Edit: I don't know what "+730" represents and I don't have a reference manual for it. One thing I can tell you is that this is not a line in a C# file.

"it’s an offset into the native instructions for the method" - see http://odetocode.com/blogs/scott/archive/2005/01/25/funny-numbers-in-my-stack-trace.aspx

They're offset to machine code bytes. See here.
If you add the pdb files you might get the .NET code line number.

If you are using Visual Studio you can press Ctrl+G and enter the line number you want on the page that exception occurs
also you can watch the Stack Trace using Debug > Window > Stack trace
hope it helps

Related

Xamarin's Forms Chip Error on launch of app

I am getting the following error in Xamrain forms and their is no more detail I can give until you ask me as unfamiliar with the error never had it before.
Severity Code Description Project File Line Suppression State
Error error: CGViewProvider_1 is not abstract and does not override
abstract method checkView(View,int) in ChipItemViewProvider public
class
CGViewProvider_1 THEHOCKEYLAB.Android D:\GitMaster\thehockeylabl.mobile\THEHOCKEYLAB\THEHOCKEYLAB.Android\obj\Debug\110\android\src\crc640a67887a4134e062\CGViewProvider_1.java 4
It seems to be something to do with their conversation code that converts the code into real time java, I see no obv way of getting to what the error is from here it happens on launch and cancels the build..
Its making a referring to ChipItemViewProdiver I have not changed processers or any part of my pc this application works.
If you let me no how to get extra debug info to diagnose this I would be greatfull
Edit 2
It would be appear to do with having fast debug on and the linker at the same time I am trailing it here and see if it works.
This was caused by having the linker and fast debug switched on your settings for Android should be like this. To avoid the error.
BTW I didnt change this manually folks this was after VS Update

Qt Application throws an Access violation exception during startup

I have a Qt Application that works in Debug mode without any problems. Since two days I'm trying to make it work in Release mode. After some Project property modification I managed to compile without errors. But unfortunalty the application crashes before even reaching the main method.
That's my environment:
MS VS 2010
Qt 4.8.4
Qwt 6.0.0
I don't know if this is relevant, but I also installed the Qt plugin for VS and used Qt Designer to create my GUI.
As I said in Debug mode there is no problem. Starting the release version from the Visual Studio produces the following error:
Unhandled exception at 0x77c415de in Application.exe: 0xC0000005: Access violation reading location 0x0000000c.
The last function I can "debug" is the the "WinMain" method called inside the method "__declspec(noinline) int __tmainCRTStartup", which is located in crtexe.c (honestly I have no idea what this is). The call stack looks like this:
ntdll.dll!77c415de()
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
ntdll.dll!77c415de()
ntdll.dll!77c3014e()
msvcr100.dll!718f0269()
msvcr100.dll!718f233b()
msvcr100.dll!718f233b()
msvcr100.dll!718f233b()
QtCore4.dll!5b2cfc49()
QtGui4.dll!57bf54ea()
Application.exe!__tmainCRTStartup() Line 547 + 0x1c bytes C
kernel32.dll!754633aa()
ntdll.dll!77c59ef2()
ntdll.dll!77c59ec5()
In the moment I'm totaly lost with this problem. No idea what to try further...
I've tried to reduce the program and commented out the complete main function. But the result was the same behaviour. As I said the error occurs even before the main function is called. I also turned off all optimization and recompiled... didn't changed anything.
What completly puzzles me, is the fact that it "works" when I call "Application.exe" from the command prompt (ok it also crashes but much later during execution). Weird, isn't it? What is the difference between starting from command prompt and starting from Visual Studio application?
AnatolyS and npiau thanks for you tips. Meanwhile I continued digging in my code. More or less I started from the very beginning and finally got the place the error occurs. I suppose npiau is right, it has nothing to do with Qt.
It's still (for me) a strange problem. I posted it in a new thread (because it has little to do with this thread): C++ Creation of a Singleton object in initializer list causes an Access Violation (only Release Mode)
The problem is not in QT but in your source code. "0xC0000005: Access violation reading location 0x0000000c" means that you try to access a wrong memory location.
Check out your arrays, ans pointers.

What is causing intermittent "Object reference not set to an instance of an object" at compile time in VS 2010?

I am sorry if this is not really a coding question (it depends on if its my code causing the problem I suppose).
I have seen this question: Tracking down intermittent 'Object reference not set to an instance of an object.' error on build
However, it has not been of much help (although if you read the comments, you will see that I thought it did help for a while there).
When I try publish my website, occasionally, I will get an error with no file or line reference:
Pre-compiling Web Site
Building directory '/App_Code/'.
Building directory '/'.: Publication (web): Object reference not set to an instance of an object.
Pre-compilation Complete
------ Skipped Publish: Project X:\, Configuration: Debug Any CPU ------
I know the usual causes of "Object reference not set to an instance of an object" but this seems a bit different, isn't it supposed to be a runtime error? Not a build error?
What is weird is that it happens, seemingly at random (about 25%-33% of the time). I can try to publish it and have it fail. Then try again straight after, without changing anything and it works fine.
I started getting this error after moving some of my functions (VB.net btw) to a new file in the App_Code folder so they can be accessed by all pages of the site.
If you need any more info, please let me know.
Thanks,
EDIT: After further investigation, it seems to only happen if I try to publish the website within a few seconds of saving changes to any file within it. What could cause this?
The same error occurred for me to, I deleted the dlls of the custom controls in the web site that are already in the bin, then i published the web site, and succeeded
IF you have any custom/usercontrols in your project, they are actually running at design time and can give object ref errors. This can occur during builds too. In that case, a property is being referenced that is NOTHING and throws the error.
I had a similar problem with a Windows Form project.
Wherever I try to move a custom control on the windows form, and then try to save the form, VS2010 comes back with "Object not set to an instance of an object".
I suspected the error was deep down in the layers of abstraction in my inherited code, but couldn't work out how deep to go, without reviewing every line of code.
My solution to this problem is this.
Open up another instance of Visual Studio 2010
Menu: Debug | Attach to Process..
Search for "devenv.exe xxx YourApplicationName..." and select it
Click "Attach"
Menu: Debug | Exceptions..
Tick all the boxes in the thrown column, then "OK"
Your second instance of VS2010 is not debugging your first instance, including all the custom controls.
Return to the first instance of VS2010, and repeat the actions that caused the error in the first place, the second instance of VS2010 will break at the line of code that has the error.
You may want to look at this link there is a bug in vs2012
https://connect.microsoft.com/VisualStudio/feedback/details/749901/error-when-i-click-publish-object-reference-not-set-to-an-instance-of-an-object

ASP.Net MissingMethodException - "ctor" method not found

We are getting intermittent problems on a production server that we cannot recreate.
There are two very strange things about the issue. Firstly it's a method not found error on the constructor (ctor) for an exception handling helper class and secondly we have custom errors switched on for remote users and this property is being ignored.
The detail of the error is:
Server Error in '/MyWebsite' Application.
Method not found: 'Void MyExceptionHelperClass..ctor (System.Exception)'.
...
Exception Details: System.MissingMethodException: Method not found: 'Void MyExceptionHelperClass..ctor (System.Exception)'.
...
The stack trace is pretty unhelpful.
My thoughts are that there may be an out-of-memory error or something like that that is killing the page. When the exception handling code kicks in it tries to create an exception object which fails for the same reason giving this error.
However this is wild speculation. We are waiting for the event logs to see whether anything is amiss with the server but in the meantime does anyone have any thoughts or suggestions?
UPDATE:
It has proven difficult to get information out of the team responsible for the production servers but I have managed to find out that as far as load balancing is concerned, this site is currently only running on one server (this can be made to switch over onto another if necessary). Given that this is an intermittent problem and there is only one server involved, then I find it difficult to believe that this could be an assembly issue. Surely if it was then the problem would occur every time?
If you see this error happening on a site that has custom errors turned on, then the error is happening in the custom error handling routine itself.
From the look of the .NET error message it appears that your routine is expecting a constructor that accepts an exception by reference - your comment above shows a constructor that accepts by value.
Check carefully that there isn't a stale version of an assembly in your system somewhere. These can lurk in the Temporary ASP.NET Files folder; you'll need to do an "iisreset /stop" before you can clear them out.
In that regard it's always a good idea to make sure that AssemblyInfo.cs is set up to automatically stamp version numbers in some way. We have our version numbers tied to our source code repository system and CI build box so we can tell exactly what was in what assembly really easily.
I would use elmah: http://code.google.com/p/elmah/ to hopefully give you a bit more insight into the issue. It is free and can be used on an existing site without any recompilation. Try it - and post back if the issue is still happening.
As others have also mentioned, I would suspect that your site is somehow using an out of date version of an assembly. Something you could try doing is a full Precompile of your site before deploying to your production server. This ensures that ASP .Net doesn't dynamically compile the site on the fly, and therefore should mean that it's using completely up to date code throughout.
Do you have a no parameter public constructor defined for MyExceptionHelperClass in your code? Or is the class meant to only have static methods, in which case it should be a static class.
public class MyExceptionHelperClass()
{
public MyExceptionHelperClass() { }
}
Unfortunately, this may be one of those cases where the error message is of little to no value. In my experience, this general class of exception may be the result of either a configuration issue or bad logic aroung threading/app domains. For example, I have seen similar issues upon attempting to load the same assembly into an app domain more than once.
You mention that this is difficult to reproduce. If it's only happening on one server in the production farm it's more likely to be a config issue (with that machine). If it's happening on more than one server than it could be either config or threading.
It might be worth spending some time looking at the larger code base around the areas mentioned above. The root cause may not be in this class. Good luck!
I think it's a Framework issue with keeping compiled versions consistency. It's common to see same sort of errors while updating site sources repeatedly. Just try something like
net stop iisadmin /y && del /q /f /s "%systemroot%\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\*.*" && iisreset
I encountered this exception today on a webforms page. I found a solution, but I'm not sure why it worked.
Nest the code behind in a 'Namespace [YourNamespace]' tag.
Add the namespace to the html Page tag's Inherits property in the aspx page 'Inherits="PathStart.YourNameSpace.ClassName"'.
Rebuild
Navigate to the page again and you should not encounter the exception.
After following the steps above I reverted the changes and did not re-encounter the exception.

Exception that goes away with Clean/Rebuild. How to diagnose/prevent?

Pre-Problem: our office was hit by a worm due to a corporate patching oversight, and the boys in the lab repaved my machine. I needed to re-install all my development tools (Visual Studio 2005, SP1, and the Web Application Project Setup patch) again. The following problem did not occur before this event.
I've been working on an ASP.NET web application project for several months now. I've been editing, debugging, etc without a problem. Then, I added a single line of code, ran it in Debug and got this error:
System.Web.HttpUnhandledException:
Exception of type 'System.Web.HttpUnhandledException'
was thrown.
System.IO.FileLoadException: The given assembly name
or codebase was invalid. (Exception from HRESULT: 0x80131047)
I uncommented the new code, built the project and ran in debug again, but got the same error.
New Code:
Me.frm.btnSubmitChanges.Attributes.Add("onclick", "javascript:return validateSubmit();")
The only way I've been able to fix this is to Clean, then Rebuild the project. I haven't been able to trap where it's happening using breakpoints.
It's happened a couple times in the last few days. What should I be looking at to fix this?
Thank you!
Have you tried to enable Fusion Logger to see if it's an assembly that is failing to load? In C# you can tell the debugger to break at any exception (There's a command you can add by customizing the tool bar called Exceptions). I'm not sure if VB has this but I would assume they do. Can you tell it break on FileLoadException and that might help you understand what's going on.
The line of code you added is pretty innocuous. When you add the code it breaks, have you then done a clean build with that line of code still in and does it work or not?
I did run the Fusion Logger, but did not get any results when the exception occurred. I tried all 4 settings.
The new line of code runs fine after a clean/rebuild.
I haven't used the break on all exceptions before; I'll see if I can find it.

Resources