Add Source file link to the default ASP.NET Server Error page? - asp.net

Has anyone ever thought to attempt to modify the default ASP.NET Server error page to provide a link BACK to the error source in Visual Studio?
Consider the following standard error page in ASP.NET:
Server Error in '/myproject'
Application.
Invalid object name 'usp_DoSomething'.
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.Data.SqlClient.SqlException:
Invalid object name 'usp_DoSomething'.
Source Error:
Line 4323: cmd.CommandText = "usp_DoSomething";
Line 4324:
Line 4325: using (var dr = cmd.ExecuteReader())
Line 4326: {
Line 4327: if (dr != null)
Source File:
c:\development\myproject\myproject.components\providers\sql\sqldataprovider.cs
Line: 4325
When an error like this is generated, the HTML has the source back to the file the error occurs in and the line number. Has anyone ever written or thought of writing some mechanism to turn the text into a link back to the error in Visual Studio?
I've never seen anything that does it, but it just seems like it would be a helluva nice feature and I think about it in the back of my mind every time an error occurs when I have to manually go find it in the source. It would just be nice to be able to click a link to take me straight there.
Anyone written any, or know of any solutions for this. I use Chrome or Firefox as my browsers of choice, but I'd even consider using IE again if someone found a plugin that did this.
Thanks,
Max

Well, I had been hoping for some means of hacking the error page to turn this:
c:\development\myproject\myproject.components\providers\sql\sqldataprovider.cs Line: 4325
into a link back into my source code in Visual Studio... being that the file name and line number is provided. I was thinking of a browser plugin or something, but apparently no one has built anything like that before... oh well. Was worth a shot.

Related

Drupal site webpages getting 500 in google

I am working on a site that is having issues when google tries to crawl over it. (I just inherited this site.) Google is returning a 500 error that it can not find the page. I have done some debug but I am stumped on what more to do.
Here is what I know:
When google crawls the site it gets a 500 from some pages. All the pages with the error seem to be "~/content/~" pages.
When I try to manual fetch the page I also get the 500 error message.
The issue only happens sometimes.
Viewing the webpage in a browser gives no indication that anything is wrong.
This is the error message from my error log.
[17-Jul-2013 21:29:58] PHP Parse error: syntax error, unexpected $end in
/home/~/public_html/sites/all/modules/ctools/plugins/access/php.inc(55) : eval()'d code on line 1
Sometime it says line 1 or line 2.
If I comment out the line below, the error goes away. I don't know what the function below does and if getting rid of it does any harm.
// Provide a summary description based upon the checked roles.
function ctools_php_ctools_access_summary($conf, $contexts)
{
return !empty($conf['description']) ? check_plain($conf['description']) : t('No description');
}
I spoke with the hosting company and they said everything is "OK" on their end.
I submitted a question to the google forums and all the tools that they had me run against the site seemed to return successful information.
The problem seems like its getting progressively worse over time.
The apache log does not have any error messages in it.
From the durpal Admin panel - Node template. When I select contexts for the column variant sometimes I get the WSOD.
I don't see any php code anywhere that could be causing an error.
Does anyone have any ideas what could be going on?
PHP Parse error: syntax error, unexpected $end.... if it's the case
means that PHP has finished analyzing your code, but you forgot to close a symbol somewhere in your page or in those that are included.
Check:
you may forgot to close a quote, so PHP continues to analyze your code until it finds the closing quotation-mark.
You may forgot to close a bracket, so from the last opening, PHP thinks all the code that follows as part of a block that never ends.
You may forgot to close a parenthesis, so from the last open parenthesis, it thinks all the code that follows as part of it and that is not ending.
You may forgot a comma

ASP.Net: How do I find this error?

I'm getting the following error when I try to run an ASP.Net page. It just popped up during development, and I don't know what the cause is.
"OverflowException Occurred. Value was either too large or too small for an Int32."
The line the debugger breaks on is of absolutely no help at all
Dim ApproxDate As TextBox = FormView1.FindControl("CurrentResultDateTextBox")
The error is occurring on this line because calling findControl on FormView1 causes it to databind (executes a SQL query to return the dataset). I assume the error lies somewhere in one of the object data sources or possibly one of the grid views on the page, but the debugger won't tell me where. Most of the page data sources are bound declaratively (specified in ASP tags in the source)
Pressing F11 to run past the exception displays the following:
"13712696100373320501120906 is not a valid value for Int32."
The value being shown here is the primary key for the main SQL table used by the page. There are about 10 data sources which use this field. Again, there's no indication of where exactly the error is occurring.
So how can I debug an error like this? Are there commands I can run? IIS error logs? 3rd party software to capture the error? I'll take anything I can get
Managed to find the problem. The trick is to first disable "just my code" in the IDE/Debug settings. Then you can see the system functions on the call stack, and while there is no source code, you can click on these functions to unwind the stack to one of the web controls (in this case the ListControl.PerformSelect function)
If you check the auto variables in the debug window, it will show the control involved in the error. From there I added a watch on the ID property to see which control it was, looked up the data source that feeds it, and found the error.
You can also unwind the stack to the ObjectDataSourceView, look at the dataTable property, and call GetErrors() to see the issues. This returns an array of data rows which are flagging errors; The property RowError will show the error message for any given row.

Microsoft InfoPath Error? Cannot open

Just wondering if anyone can help me with an InfoPath problem I've got. I have a form that I am unable to open, originally displaying the message below.
The form definition (.xsf) file contains elements, attributes, or structures that are not valid.
Error details:
The keyref 'ruleSet_41' does not resolve to a key for the Identity Constraint '{http://schemas.microsoft.com/office/infopath/2003/solutionDefinition}ruleset_name_key'.
 
Line 1539, Position 3
--^
I have managed to clear this by removing ruleSet_41 from the manifest.xsf file but the message I am now receiving is shown below.
The following file is referenced in the .xsf file but is not part of the form: myschema.xsd
 
This is stopping me opening the form.
Does anyone have any ideas, anything would be much appreciated.
Many thanks, Jamie.
Remove the button that contains the RuleSetAction.
There would also look, open the file "myschema.xsd" will have been a reference to "ruleSet_41". Also delete it from the .xsd

Compiler Error Message: CS0103: The name 'Database' does not exist in the current context [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Razor-based view doesn't see referenced assemblies
I am a Newbie in ASP.net
I am trying to connect to a database and I keep getting this error
**Compilation Error
Description: An error occurred during the compilation of a resource
required to service this request. Please review the following specific
error details and modify your source code appropriately.
Compiler Error Message: CS0103: The name 'Database' does not exist in
the current context
Source Error:
Line 1: #{
Line 2: var db = Database.Open("demo"); '
Line 3:
Line 4:
Source File: c:\Users\Ayoya\Documents\My Web Sites\demo\Page.cshtml
Line: 2
**
Can anyone tell me whats wrong?
Thank you
The compiler's already telling you what's wrong - it doesn't know what you mean by Database. Is that mean to be a property of the page, or is it the name of a type with a static Open method? It's not clear from the code itself, and obviously the compiler can't find the name either.
Work out what name you mean, then work out why the compiler can't see it, then fix that. If you need more help on any of these steps, you'll need to provide more information.
(As an aside, I completely agree with dbaseman: putting database calls in your view is a bad idea.)
If you're opening a database in your Razor view, that is completely the wrong approach. Your logic should go in the Controller, not the View. Consider creating a "view model" class that contains all the data needed for your view, and populate that class from the Controller.
Probably the reason this piece of code isn't working is that you will need to specify the full namespace of Database. I'm not sure what that class is, though; if it's in a separate DLL, you'll have more problems. Again, though, you should circumvent this problem by putting your database logic in the controller.

Broken JavaScript Registry in Plone 3.1.7

I created a javascript file TTW for a quick fix to something i was working with, and when i went to the portal_javascripts and added it there i was met with this error upon saving:
Exception Type: CompilerError
Exception Value: Path element may not be empty in 'portal/http://www.example.com/portal_skins/cloud.js'
I get that same error every time i attempt to navigate to the portal_javascripts through the ZMI, it's obvious that I incorrectly entered the id of my file, but now I can't even fix it.
I was able to find this example of someone with a similiar issue, but I have no how to go about his fix
http://markmail.org/message/zbjhjoezz2h423yr#query:+page:1+mid:yhgjekdkwnegwqen+state:results
Try this:
http://example.com/portal_javascripts/unregisterResource?id=[your_js_resource_id]

Resources