Why am I getting Server Error in '/' Application? - asp.net

I have been trying to fix this on my site but I am having no luck and every page I have found with its fix tells to set customErrors mode="Off" and I have already done that. This server error only occurs on one page, but the one page is the page where a majority of the sites functionality resides.
I am running .Net 4.0, and I have just recently published this same site in the same way with no problems at all. There has been no changes to my web.config file.
Here is a little code sample from my web.config where I have the customErrors set to off
<system.web>
<customErrors mode="Off"/>
<authorization>
<allow users="?" />
</authorization>
</system.web>
if anyone can provide some helpful insight, it will be greatly appreciated, if there is more code needed to solve this I will provided what is requested. Thank you

After a days worth of looking for the answer it has been found. Someone made a change to one of the database names without informing me. So my problem was I had a wrong name of a database nothing else was wrong.
Thank you all

Related

Can't get rid of It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level

I know this topic is discussed several times here but I read them and I don't believe they apply to my scenario. I added the following to my web.config:
<location path="Admin/default.aspx">
<system.web>
<authorization>
<allow roles="Customer Service Admin" />
<deny users="*"/>
</authorization>
And I started getting the error. I looked at the other SO posts on this and I found another web.config higher up in the Account subfolder but I deleted it. There are no other web.config files. I have done the other things like deleting the obj file but I keep getting this error. I am running i IIS Express locally. What else could it be?
The problem was unlike in any of the other SO Posts on this error. The error was caused by two system.web sections in the web.config

500 - Internal server error with godaddy

after i finished uploading my website, I found this error when I try to preview my website
how can I solve this error? I try to add this code
<configuration>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true"/>
</system.web>
</configuration>
in web.config
to get details about the error but the error message still the same!!!
how can I solve it?
One of the many cause of this error on Godaddy hosting is the framework version.
In this case, just change the .Net version
Go to ASP.Net setting and then click Change Version. Now, here you may downgrade the version to 2.0 .
This simple change in this case will work like a magic.
If your problem is still not resolved, please reply.

I'm getting runtime error for asp.net application, is it timeout issue?

I'm getting this runtime error sometime when I try to use asp.net application.
I'm getting this error when my browser windows is open for long time and I does not work on this.. might be server time
Is it because of login timeout ?
I do not believe there is any way to tell from this error message what the problem is. As the error message states, the current settings prevent the actual error message from being displayed! You need to change the settings so you can actually see the error message, that will help you figure out what is causing it.
To do that, go into your web.config file and set (Note Off has capital O)
On IIS6:
<configuration>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true"/> <---- Optional
</system.web>
</configuration>
On IIS7:
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed" />
<asp scriptErrorSentToBrowser="true"/>
</system.webServer>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true"/>
</system.web>
</configuration>
Edit - adding some more information:
Hi ashuthinks, I see you have accepted my answer already, but just wanted to add a few more lines. If everything in your code is fine, and the website runs perfectly, and you only get an error message on your screen if you leave it idle for 20 minutes or so, it is possible you are hitting the session timeout. I don't have any experience with this, but I have heard of it happening.
One of the things you can try is to change the session timeout in your web.config :
There seems to be a nice article about this here: http://www.simon.kaulius.com/page_timeout_in_asp_net.htm
It talks about modifying web.config, and making changes in IIS and global.asax to redirect the user to another page on timeout.
There alsoseems to be a thread dealing with a timeout issue on stackoverflow: Session timeout in ASP.NET

Redirect all asp.net errors to one page preferably through IIS

I am trying to remove all logging and tracing errors on a company website without having to run through and change all of the debugging ="true" statements (several hundred). We will refactor these later however, today, I am looking for a way to push all asp related errors to simple error page or even make everything a 404 error.
Is this possible or am I going to have to change all debug values?
relevant environment info:
.net framework 2.0, iis 7.0
You should be able to use the customErrors section of the web.config to push all errors to a default error page. Something along the lines of:
<configuration>
<system.web>
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly">
</customErrors>
</system.web>
</configuration>

What is wrong with my MVC application?! (500 on Content and Scripts)

For anything under the Scripts or Content folders in my ASP.NET MVC application, I am getting the following error:
The page cannot be displayed because an internal server error has occurred
That's the response in its entirety (excepting the headers) - nothing else. I am hosting this on GoDaddy, and have not had problems with this application before. What did I do to screw this up?! Working on 4 hours of sleep isn't helping matters...
This would be appropriate here:
"It takes considerable knowledge just to realize the extent of your own ignorance."
-Thomas Sowell
So, when struggling to get a Flash-based, JavaScript-configured component to work in my web app, I added a staticContent node to my web.config, with a mimeMap node as a child:
<configuration>
...
<system.webServer>
...
<staticContent>
<mimeMap fileExtension=".mp4" mimeType="video/mpeg" />
</staticContent>
</system.webServer>
</configuration>
When I commented-out the entire staticContent node, everything worked just fine. I didn't know that adding a mimeMap here would cause all of the default mimeMaps (specified within the server's ApplicationHost.config) to be overridden, because that seems to be exactly what is going on...Then again, I am merely guessing - either way, not very easy to figure out.
Thank you to everyone that responded, I appreciate it!
In your web.config file, find the customErrors section and change mode to Off.
<customErrors mode="Off">
</customErrors>
Changing that will give you a more descriptive error.
I had the same issue when upgrading to a newer version of IIS, though with a different mime type. As you also surmised, I believe the new version must already have the type registered (or the host did it at the machine level). I solved it by putting "remove" before the "add" - all my content started showing up again. I would think this would prevent having to modify the config between dev and prod.
<staticContent>
<remove fileExtensions=".mp4" />
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
</staticContent>
This has been edited to replace video/mpeg with video/mp4. /mpeg still worked for me, but apparently mp4 is recommended.
Can you turn off Simple error messages?
Perhaps you could try putting
routes.IgnoreRoute("Scripts");
routes.IgnoreRoute("Content");
in your route register?
Also make sure that if you are using the built-in authentication, you have this bit in your web.config, though I think it isn't your problem:
<location path="public">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
Hmm, do you have any control of IIS on that hosting? Maybe they have a wildcard mapping interfering. That's happened to us before with site minder.
Download Phil Haack's Route Debugger, then try navigating to one of the Scripts. You might be catching them in your routes.

Resources