I'm trying to upload my c# site,
The sites seems to upload correctly,
But when I try to enter, I get the next message:
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".
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Now I add the customErrors mode="Off" to my Web.config:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<customErrors mode="Off"/>
</system.web>
</configuration>
And the new error is:
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
Source Error:
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.
Source File: \blablablablablabla\public_html\myweb\web.config Line: 8
Version Information: Microsoft .NET Framework Version:2.0.50727.8793; ASP.NET Version:2.0.50727.8762
I tryed modifying it to 2.0 (because the error signature), also tryed to delete the targetFramework attribute, but nothing works.
Thaaaaanks.
Go to IIS,
Click on Application Pool--> on the right side --> Select your Site--> double click on it and change the .Net Framework to v4.0
I hope it will solve your problem.
Thnks.
Related
I have developed a website in asp.net and hosted it on server. It works fine with computer's but it do not run on mobile. The web.config error occurs every time.Web.config Error Occurs Every Time.
In Web.Config file do as below
<configuration>
<system.web>
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly">
<error statusCode="500"
redirect="InternalError.htm"/>
</customErrors>
</system.web>
</configuration>
it for the Un-handeled exception thrown when use browsing your web application. if you dont set that flag user will receive full stackstrace of error which user dont want. so it better you set the flag to On or Remoteonly in production environment.
On-Specifies that custom errors are enabled. If no defaultRedirect attribute is specified, users see a generic error. The custom errors are shown to the remote clients and to the local host.
Off-Specifies that custom errors are disabled. The detailed ASP.NET errors are shown to the remote clients and to the local host.
RemoteOnly-Specifies that custom errors are shown only to the remote clients, and that ASP.NET errors are shown to the local host. This is the default value.
Read more : https://msdn.microsoft.com/en-us/library/h0hfz6fc(v=vs.100).aspx
Hey i have an mvc app that i have published in my azure server. I get an error when i try it in the server. In localhost in works fine. But in the server i get an error that looks like this
So my question is how can i remove that custom error. I want to see the error message that explains what the error is about?
i want the error message to be like this one
check if you have this line this line in your web config system.web area
<customErrors mode="Off" />
if you do change it to off and if not add it in
You can use web.config transform file (such as Web.Debug.config or Web.Release.config) and include the following section:
<system.web>
<customErrors mode="Off" xdt:Transform="Insert" />
</system.web>
The Web.config file will be transformed when you deploy to Azure. The transform does not occur locally.
I've been investigating this thing for hours but couldn't understand what's the problem causing this behavior.
I have built a simple ASP.NET MVC app to upload and delete photos from a predefined container on the Azure Storage Server.
It works perfectly when I run the application on my machine, locally.
Also, it works perfectly when I run this on my machine but the Data service is located on Azure.
But, when Publishing the application to Azure, surfing to this website runs to this uninformative error:
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>
This doesn't tell me anything, also - nothing like this happens when running on my machine with Visual Studio.
If you have any idea what's going on here I'd really appreciate your help, thanks.
When I load my web page its giving me this error, I just published it from visual studio, where it was function perfectly fine and now its giving me an error.
Configuration Error
Description: An error occurred during the processing of a
configuration file required to service this request. Please review the
specific error details below and modify your configuration file
appropriately.
Parser Error Message: It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This
error can be caused by a virtual directory not being configured as an
application in IIS.
Source Error:
Line 87: ASP.NET to identify an incoming user.
Line 88: -->
Line 89: <authentication mode="Windows"/>
Line 90: <!--
Line 91: The <customErrors> section enables configuration
Whenever a new web application created, using Visual Studio.net it automatically creates a virtual directory in IIS and configures as an application. So you have to manually create a Virtual directory and configure it to application.
Start->All program-mes->Administrative tools->Internet Information service-> Select Server name->Web Site->Default Web site-> right click ->new->virtual directory
this opens a virtual directory wizard. give a name, give path of application. Give appropriate permission. then Finish.
Now to cross check whether its configured to an application or not, select created virtual directory Right click->properties->Select Virtual directory under "Application settings"
http://blogs.msdn.com/b/robgruen/archive/2005/09/12/464196.aspx
delete all code in web.config and paste
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<add name="your connection string name" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\your database name;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
</system.web>
</configuration>
it will work.
My MVC3 application displays custom error pages for 403, 404, and 500 status codes, but browsing to trace.axd displays the following YSOD:
Server Error in '/' Application.
Trace Error
Description: Trace.axd is not enabled in the configuration file for this application. Note: Trace is never enabled when <deployment retail=true />
Details: To enable trace.axd, please create a <trace> tag within the configuration file located in the root directory of the current web application. This <trace> tag should then have its "enabled" attribute set to "true".
<configuration>
<system.web>
<trace enabled="true"/>
</system.web>
</configuration>
So I have trace disabled, which is good, but why is the 500 page not being displayed, since this it's a 403 being returned from the server? I'd be happy enough with a 404, 403, or 500 really - just as long as it's not an ugly yellow screen!
Edit: I was getting a 500 along with the YSOD when running on localhost, but it's actually a 403 on the server which is closer to what I was expecting - but still no custom error page. It's also a slightly different standard error page on the server:
Server Error in '/' Application.
Trace Error
Description: The current trace settings prevent trace.axd from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable trace.axd to be viewable on remote machines, please create a <trace> tag within the configuration file located in the root directory of the current web application. This <trace> tag should then have its "localOnly" attribute set to "false".
<configuration>
<system.web>
<trace localOnly="false"/>
</system.web>
</configuration>
Removing the IgnoreRoute as suggested by #Cosmologinaut didn't work for me and as he says feels wrong. I found a better solution which is to remove the tracing HTTP handler in the Web.config file:
<system.webServer>
<!-- remove TraceHandler-Integrated - Remove the tracing handlers so that navigating to /trace.axd gives us a
404 Not Found instead of 500 Internal Server Error. -->
<handlers>
<remove name="TraceHandler-Integrated" />
<remove name="TraceHandler-Integrated-4.0" />
</handlers>
</system.webServer>
Navigating to /trace.axd now gives us a 404 Not Found instead of 500 Internal Server Error.
Since there were no responses I asked #shanselman on Twitter, who suggested <deployment retail = "true" /> might solve it, but it still returned the same YSOD.
In the end I solved it by removing routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); from the routing config. Doesn't quite seem right, but it works.