I've just uploaded an asp.net web project to a Fasthosts shared server (yes, I know!). The site works fine on a different server, and builds successfully. However, when I upload it (or even just the files in the App_Code folder) to the fasthosts server, I just get a flat error 500 message.
I've ensured that the web.config file includes: <customErrors mode="Off"/> but still nothing - just Error 500.
The Fasthosts server is running asp.net 3.5, which is what the web project is built to.
Can anyone suggest what might be wrong, or how I get more information as to the cause of the error?
Thanks all...
You probably have an error in the web.config revert to old web.config and see if that works.
If you have
<modules runAllManagedModulesForAllRequests="true"/>
In your web.config, remove it.
Related
I have taken over the maintenance of a production website at a new job that is written in ASP.NET 4 Webforms and that runs on IIS 6 on Windows Server 2003. I am not familiar with Webforms nor managing IIS...so I am kind of working things out as I go here.
I have done several deployments to our production server which have worked fine, but am now setting up a test environment that is identical, just a different IP address/domain, so we can properly test changes first.
I have a problem where on this test site any URL that does NOT end with a reference to a file (always .aspx on this site) will return a 403 error on this server. For example http://users.test.oursite.com/admin will always return a 403 error when logged into the site. It should be redirecting to http://users.test.oursite.com/admin/organisation.aspx. Having an MVC background I am not even sure how this happens...but it does in production.
Browsing links within the site is fine as they always reference an .aspx file. Manually typing URLS that reference an .aspx file is fine, just not when the URL does not contain a file. This is not a problem on the production server.
As I said, I am not familiar with WebForms or managing IIS itself...so I have kind of run out of places to look.
Is there anything that comes to mind that I should be looking at that could be causing this problem?
In WebForms typically there is no routing involved.
You need to either provide a full path on the URL ending with .aspx OR
setup default documents for your website. (Index.aspx, Default.aspx etc.)
http://www.iis.net/configreference/system.webserver/defaultdocument
OR
<configuration>
<system.webServer>
<defaultDocument enabled="true">
<files>
<add value="home.html" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
Default documents can be setup in IIS Properties or via web.config.
Otherwise you need to provide the full path.
And because you haven't setup the DirectoryBrowsing (in IIS), you get a 403 Error when you try to access the Directory.
Enable the Directory Browsing option in IIS (not recommended) if you want this error to go away.
I am getting error when i am publish my ASP.NET Application in localhost using IIS 7.5.
all the pages run perfectly expect on and getting error:-
Compiler Error Message: CS0433: The type 'pages_Default' exists in
both'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET
Files\root\785050d7\543e65af\assembly\dl3\6a3d3e87\242bc946_6834cf01\App_Web_zxwcuztt.DLL'
and 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET
Files\root\785050d7\543e65af\assembly\dl3\c72e1cad\7d5dd447_6834cf01\App_Web_b5bhtyqt.DLL
Plese Help me to resolve this
Try it:
I set the batch="false" attribute on the compilation section in web.config worked for me.
This tells ASP.NET to dynamically compile individual .aspx/.ascx files into separate assemblies. This avoids the circular reference issue that triggers the exception.
<configuration>
<system.web>
<compilation debug="false" batch="false"></compilation>
</system.web>
</configuration>
Or
You will have a path similar to the following:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
Delete the contents of this entire folder (no harm will be done), then try and Clean and Rebuild your solution.
Or
The problem occurred in a virtual application's bin folder. Looking into this bin-folder you will probably see two files (an information i found here):
App_global.asax.dll
App_global.asax.compiled
Removing these resolves the error. The App_global.asax.dll is generated at runtime too which causes the problem.
I am however still investigating how these files got there, so comments are definitely welcome!
I've created a custom error page, using this article. This custom error page appears only when aspx page isn't find, and when file(like pdf and other) isn't find - default google's error page appears. How to get custom error page for files? I've tryed to implement this solution on two different machines: on local machine custom error page appears for both .aspx pages and files, but on a server this solution works only for .aspx pages, though config files are the same. What I'm missing? Maybe there are different IIS configuration on this machines, or something? Thanks in advance.
I think this will help you.
<system.web>
<customErrors defaultRedirect="Error.aspx" mode="On">
<error statusCode="500" redirect="Error.aspx"/>
</customErrors>
</system.web>
U can add additional tags and mention available error codes and the page where you want to redirect.
Try setting your Error Page directly in IIS. Take a snapshot of your Web.config before you do this as I'm pretty sure it's going to be modified by IIS once you make this settings change. If memory serves me right you'll see this change in system.webServer and not system.web.
Be advised, if you are operating in a web far though, using mixed version of IIS (Server 2008 and Server 2008 R2 for instance), I've found the settings for 2008 R2 to not be compatible with 2008.
i am developing a website in ASP .Net with Visual Studio 2010. I don't have yet attached any database, it is plain html with a lot of CSS and a little bit of Visual Basic. I rented web server space from a company. With FileZilla i uploaded the Published Content and placed them in wwwroot directory. When i visit the website from my browser i get the error below:
Server Error in '/' Application.
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
I googled it and found some answers but none fitted my case. I should mention that i am using windows 7 and IIS7, and that locally the site works fine. I thought that i might have made mistake in the code so i tried to upload the template website that visual studio has for default. But the same error still comes up. I tried to upload a plain html site and it worked. I tried to make a plain "hello world" aspx and asp file and it worked. Does anyone have experienced the same problem, and if so how can solve it?
Thank you
Put <customErrors mode="Off"/> in web.config, then it will show the detail error. It is difficult to say anything at this point.
This error can be caused by a virtual directory not being configured as an application in IIS.
Remove section <system.codedom> ...... </system.codedom> from Web.config file
I have installed SP 2010 in a Windows Server 2008 R2 loaded environment. I have been using VS 2010 for developing application pages for SP 2010.
I make use of wsp builder to package all my dlls, pages, scripts and images into a solution package and deploy it in the web applications.
Everything was working like a charm. I started enduring a torrid time when all of a sudden my web applications started popping up with 'HTTP 500 Internal Server Error'. This started happening after I made some drastic changes in my application pages and deployed it.
I tried creating new web applications but its not doing me any good. Any insights on what could be the source of this issue?
Regards,
Raghuraman.V
Fixed this problem by editing the Web.config and applicationhost.config.
C:\Users\\Documents\IISExpress\config or right click the IIS Express icon on the tray and view all application and click the desired website and then click the configuration file link.
Comment out
<error statusCode="500" prefixLanguageFilePath="%IIS_BIN%\custerr" path="500.htm" />
Set the parent node to <httpErrors errorMode="DetailedLocalOnly"
Set the httpErrors to Allow
<section name="httpErrors" overrideModeDefault="Allow" />
Change your web project web.config HttpErrors
<httpErrors errorMode="Custom" existingResponse="Auto">
That should fix it, its basically saying that "I dont want IIS Express to override the configuration of my site".
To resolve, you should first instruct IIS to display detailed error messages, instead of just "500".
Adjust your web.config file and set custom errors to off:
<customErrors mode="Off" />
(case-sensitive).
In addition, if you are using Internet Explorer, turn of the advanced option "Show friendly error messages".
To help others, here there is a guide that helped me to find what was wrong with my setup (credits to Rick Barber):
Working past 500
Load the site from a browser located on the same server. In IE you may need to turn off ‘show friendly http errors.’
Temporarily add the following within the appropriate tags in your web.config file:
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed" />
</system.webServer>
<system.web>
<customErrors mode="Off" />
<compilation debug="true" />
</system.web>
</configuration>
Open up IIS Manager and try to open up some of the different features by double clicking on the icon. If there is an error in the web.config file and it can’t even parse it, sometimes you will get a helpful error.
Look in Windows Event Viewer. Sometimes you can find the detailed error logged in there, particularly Application Event Viewer.
Setup Failed Request Tracing. This is especially helpful if it is an intermittent 500 error.
Look through the web log files. This is especially helpful for an intermittent 500 error. You can often parse the log files to see if there is a trend with a specific page that is throwing a 500 error.