ASP project will not work on remote server

davearia

Centurion
Joined
Jan 4, 2005
Messages
184
Hi All,

I am having a nightmare at the moment. I have spent the last few hours working on a ASP.NET project runnig the code locally on my machine. The database is on a remote server. Anyway I got so much done and thought I would leave it there for today, so I used Visula Studio.NET to copy the project into a a folder only getting the files needed to run the application. I then uploaded the files onto my remote server web space (overwriting the ones already on there). When I clicked the link to the app I got the vague 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 <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".

<!-- 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 <customErrors> 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>

My web.cofig file has the following settings in it:

<customErrorsdefaultRedirect="/JokePoint/error.aspx"/>.

I have also tried using mode="Off" hoping to get more information on the fault. But I get no further information as to what the hell is going wrong. I have some code in my global.asax like this:

Visual Basic:
Sub Application_Error(ByVal sender AsObject, ByVal e As EventArgs)
Try
Dim email AsNew MailMessage
email.From = [email]me@blueyonder.co.uk[/email]
email.To = [email]me@blueyonder.co.uk[/email]
email.Subject = "Failure On WebSite"
email.Body = Server.GetLastError().ToString()
SmtpMail.SmtpServer = "SMTP.blueyonder.co.uk"
SmtpMail.Send(email)
Catch ex As Exception
EndTry
EndSub

So that I can read the errors and find out what is wrong. But the errors are not sent to my email address as they used to be. It is as if the app never gets going at all. Running it locally on my machine it runs perfect, as soon as I upload it onto the remote server it dies without any explanation. I cannot understand why this is, as the previous version of the app ran fine from the remote server and the updated version runs great locally why is not running at all on the remote server?

I am currently with fasthost.co.uk with my webspace there ftp server seems to be a little intermitent, but I have uploaded these files many times and to no avail.

Please help, I am lost with this problem.

Thanks, Dave. :)
 
Since you're still in test mode, change the web.config setting CustomErrors to off, this will allow you to see the real error message until you get your app squared away.
Also, at this point your global error is not even being triggered.
 
My web.config is the culprit. I have left in only the basic and it now works. I am not sure yet which bit it doesn't like but at least I know where look now.

Thanks, Dave.
 
The parts of the web.config that cause the app not to work are:
Code:
<location path="admin.aspx">
    <system.web>
      <authorization>
        <allow users="admin" />
        <deny users="*" />
      </authorization>
    </system.web>
</location>

And also:
Code:
<authentication mode="Forms">
      <forms name="JokePoint"
          loginUrl="login.aspx" path="/" protection="All" timeout="60">
        <credentials passwordFormat="Clear">
          <user name="user" password="user"/>
          <user name="admin" password="admin"/>
         </credentials>
      </forms>
</authentication>
<authorization>
    <allow users="*" />
</authorization>

Without these the app runs fine. But remember when running it locally these additions to the config file caused no problems. It was only when I tried to run it frokm the remote server.

Any ideas why these lines would not work?

Thabks, Dave.
 
All I have to do is add two lines to my web.config file and it dies:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="ConnectionString" value="server='0.0.0.0';database=db;User ID=user;Password=pwd;" />
  </appSettings>
  <system.web>
	<authentication mode="Forms">
	
	</authentication>
    <compilation defaultLanguage="vb" debug="true" />
    <customErrors defaultRedirect="/JokePoint/error.aspx" />
    <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-US"/>
  </system.web>
</configuration>
The two new lines are:
Code:
<authentication mode="Forms">
	
</authentication>
This will kill my app. But according to the books I am reading this should be fine.

Is there a possibility that there is a security issue on my remote webspace. As these work fine at home.

Please help this is driving me insane.

Thanks, Dave. :D
 
Last edited:
Back
Top