Server error when copying ASP.NET code to another host - asp.net

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.

Related

Unable to consume WCF service (hosted in IIS )

I have hosted my web-application in IIS 5 in a virtual directory.
When browsing .aspx web pages everything works fine. Web-page takes few inputs from user and invokes WCF services. On making the service call I get below exception -
There was an error in serializing body of message : 'Unable to
generate a temporary class (result=1). error CS2001: Source file
'C:\WINDOWS\TEMP\peqft5u5.0.cs' could not be found error CS2008: No
inputs specified '
I have double checked environment variables looks good in the server.
I can confirm, there is no problem in code since, same works perfectly fine in other box of similar configuration & hosting environment.
ASP.NET default user was not having write access to TEMP folder. Posting the answer in hope it would be helpful later, some day!

ASP.NET Web Application Error

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

ASP.NET: Errors not viewable despite proper configuration

I'm having the classic (dare I say typical?) error on the ASP.NET production server, which tells me that I can't view errors. Below the error displayed below, are things I've already tried.
In IIS Manager (6.0), the application is located under one of the web sites in "Web Sites". It is indeed a web application, as opposed to a virtual directory (it has that gear icon).
When trying to view the error from the localhost (i.e. the server itself), it doesn't find the application on its path, even though the root web site works just fine from localhost. It is clearly not a firewall issue because first of all, the firewall is turned off, and second because the root web site works fine from localhost. Heck, I even tried connecting through telnet and that worked fine and dandy too, so it is most certainly and very clearly not a firewall issue.
Basically, I just need to view the error at all. I won't have to fix this problem if I can just see the error and fix it, because obviously there is something wrong in the code itself... I just don't know what, because IIS/.NET won't tell me.
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".
So what I've already tried is what the error message itself suggests by setting the customErrors thing to "Off". In fact, it always was on "Off" so I didn't have to change anything. I've made sure that the web.config XML is valid.
Another common reason for this error is that the .NET run-time is set to version 1.1, not 2.0. I've also made sure that this is correctly configured to 2.0.
I'm running it in an independent application pool, meaning that there are no other applications at all, much less 1.1 applications, on the same application pool.
I've made sure that EVERYONE can do ANYTHING to the files and directories in the application itself. I understand the security ramifications here, I'm just trying to get it working at all, and then I'll constrain the access rights afterward, one step at a time. But in any case, everyone can read those files.
Any help deeply appreciated. Thank you in advance.
The error is a .NET framework error so it finds the app, but there is a configuration error. What you could do is add some event logging code in APplication_Error handler in global.asax to trap these errors, or turn on health monitoring (<healthMonitoring enabled="true" />), which by default will log ASP.NET framework errors to the event log.
HTH.
Never got this working until I changed the application from a "sub-application" (I don't know the proper terminology) to an independent website with its own hostname. ASP.NET works in mysterious ways.

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