ASP.NET Web Application Error - asp.net

I have an application with the main and 2 sub pages. The main page works and one of the sub pages work fine. But the other sub page gives me an error:
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".
When trying to run on my local, i get
An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL.
These were working fine a week ago and this problem is sudden. help please.

You are facing this issue because the SubPage you are getting error on accessing might be under some security. The error you have described comes on a page which is not accessible to the anonymous user.
You must check the Web.config firstly to see if there is some Location Access permissions defined for that Webpage and ensure that they are correctly defined.
You may read about more to this problem by a previous Answer.
web site configuration

Related

Security Exception while running an ASP.NET on deployment server

I am trying to run a WebAPI on a deployment server connected via a Remote Desktop link, but when I try to connect to the website via a browser, I get the error of:
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: The source was not found, but some or all event logs could not be searched.  Inaccessible logs: Security.
Source Error:
An unhandled exception was generated during the execution of the current web request.
I can run and access the website fine when it is running from Visual Studio, its just when it is on the deployment server.
So far, I have tried:
Adding a <trust level="Full" /> element to web.config
Place the site in its own application pool in IIS (It already was).
The information in this article
Made changes to my code to see if it was the code itself which was causing the issue (I don't think it was, any request method such as POST and GET returned the same issue as above. I even tried other directories/URLs, I still got the error.)
Remove and re-publish the site several times.
Is there something which I am doing wrong which I'm not realising? Is there another way which I can solve this issue?
Any help would be appreciated.

Server error when copying ASP.NET code to another host

Sorry for the simple question.
I have moved a site to a host by simply copying the code but even the first login page fails if I include the following :-
In Web.config file..if I add the following
or...
Aspx page..if I include a reference to a class file ( which does exist in the app_code directory )
Sign In <%If clsGeneral.str(Request("timeout")) = "t" Then Response.Write(" - YOUR SESSION EXPIRED")%>
I get the 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.
etc...
Copying an application from one host to another is only simple in the file copy. There are a number of issues that may arise from the application running on the "new" server. For example, is the server running the same version of IIS? Is IIS configured properly for this application? Etc ... to see what error the application is throwing, inspect the Application Log in the event viewer on the server. This will give you some hint as to what the issue is. Without that information, there's really no place you can start, except maybe turning off the custom error or error suppression to see the error details in the browser. But I would recommend that you inspect the Application event log on the server.

Runtime Error on Website (asp.net versions mismatch)

I'm quite new to this and was playing around with a website today. I decided that, since I had tinkered with most pages I'd just upload the whole thing via Filezilla anew but when I tried to access the website afterwards I only got this:
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 <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
I have backups and tried uploading them (again - the whole thing) but its coming up with the same error. What should I do to get my site back online?
Check the application pool the website is using matches the .net framework version site was developed using. Amend the IIS application pool to match and restart the site.

Deploying ASP.NET application

i'm trying to deploy asp.net application, i transfered all the files into server's root directory by ftp.
but i got this 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".
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.
Blockquote
I added line but the error is still the same..;/
locally everything works fine.
what should i do?
Is this your own server? In other words, do you have direct access to IIS on this server? Maybe you already did this, but in case you didn't: You need to create an application for the site in IIS. The easiest way to do this is to right-click on your website (Default Website if you only have one) in IIS and choose "Add Virtual Directory..."

Problems deploying a web application

I am trying to deploy a web application to a remote server over which i have no control.
If I use FTP deployment from visual studio, I manage to get the files onto the server, but when I point my browser to the server, it gives me the standand error page:
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".
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.
I have made shure that custom errors has mode="Off" as the text above suggests. No amount of refreshing or Cntl-F5-ing gives me anything other than the error page above.
Its most likely is that the location you have put it is not setup as an IIS Application and this is required for the .net framework application to work correctly.
As you have no control on the server you won't be able to change the IIS settings, and so dropping .net onto the server isn't quite the xcopy deployment method Microsoft pushed lots.
Please verify the virtual directory is mapped to the publish location properly. Because your question tells changing the web.config has no impact.
Probably your application on remote server isn't defined as application in IIS. This means that it can't find it 'code' resources(bin or App_Code directories) and customErrors setting is taken from parent web.config.

Resources