Last post Jun 05, 2007 11:36 AM by jeremyh
Jun 04, 2007 04:36 AM|jdm2104|LINK
I still get the same old default runtime error message despite turning the custom error mode to off? Could anyone help?
I have set up the mssql databases on my server by running the configuration scripts so I have a feeling my connection string is wrong but can't see the error message.
<add name="classifiedsConnection" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\classifiedsdb.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
<add name="classifiedsConnection" connectionString="Data Source=mssql.e-militaria.net;Database=CLASSIFIEDSDB;User ID=classifiedsAdmin;Password=******;Trusted_Connection=False" providerName="System.Data.SqlClient=" />
<add name="LocalSqlServer" connectionString="Server=mssql.e-militaria.net;Database=ASPNETDB;User ID=aspnetAdmin;Password=******;Trusted_Connection=False" providerName="System.Data.SqlClient" />
Does the connection string look ok?
Jun 04, 2007 08:55 AM|jeremyh|LINK
Jun 04, 2007 09:16 AM|jdm2104|LINK
Thanks for your reply. However, I have checked this already.
Strange thing is if I access my site through Visual Web Developer Express I can see everything and the site works perfectly. However, if I try to access the site through a browser I get the runtime error page I described above.
Jun 04, 2007 10:04 AM|jeremyh|LINK
Can you show me the error page? What does it say.
Guess you have checked the permissions are ok.
Jun 04, 2007 10:17 AM|jdm2104|LINK
The error page I'm seeing at the moment is just the generic one (see below). Still trying to turn custom errors off but the following doesn't seem to work:
<!-- Web.Config Configuration File --><configuration> <system.web> <customErrors mode="Off"/> </system.web></configuration>
<!-- Web.Config Configuration File --><configuration> <system.web> <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/> </system.web></configuration>
Jun 04, 2007 10:30 AM|jeremyh|LINK
Have you checked that you have not got more than one customErrors tags in the web.config.
Well permission it a little hard to say without know more about the application but read should be enough unless you have some logging to file or something.
How are you hosting this app local or with a host?
Is it running as an iis applcation? The directory flag correctly?
Jun 04, 2007 11:21 AM|jdm2104|LINK
Only one customerrors tag in the web.config file.
The application is with a host.
I'm not sure about whether it's running as an iis application, I've just uploaded the application and created the tables nothing else. Is there an easy way to check?
Also, I'm sure what is meant by the directory flag. Could you clarify this?
Jun 05, 2007 07:22 AM|jeremyh|LINK
Well the best way to tell about the directory is to use the control panel tools the host gives you. Most have a file manager and you can then get to the properties from there.
Or some have a iis application tool. I might be able to give you more to go on if you tell me which host it is.
Sorry I was not clear with "the directory flag" All I meant was that it was an IIS application.
The only other way I guess is to make a test page with a label, like
label1.text = HttpRuntime.AppDomainAppVirtualPath
but this may just show you the root application.
Good luck, let me know how you get on.
Jun 05, 2007 08:37 AM|jdm2104|LINK
My host is UKHost4u and the control panel interface is Plesk version 8.1.
I've just been having a good look around at the options in Plesk for the .NET framework. I found out that I'm currently running version 1 so I've now changed this to version 2 and I get a proper error message (see below). I'll have a look through the achieve
here to see if anyone has had a similar problem.
Line 40: <customErrors defaultRedirect="Error.aspx" mode="Off" />Line 41: <pages styleSheetTheme="Red"/>Line 42: <authentication mode="Forms" />Line 43: <membership>Line 44: <providers>
Jun 05, 2007 08:50 AM|jeremyh|LINK
Ok great, So now you have a good error "This error can be caused by a virtual directory not being configured as an application in IIS."
So you need to make the directory an IIS application this link should give you the steps you need.
Hope it fixes, let me know.
Jun 05, 2007 09:25 AM|jdm2104|LINK
Great it's working!
I followed the instructions you posted for making a virtual directory and the classifieds site seems to be running fine. All I need to do now is get the email up and running and personalise the site.
Thank you for your time Jeremy!
Jun 05, 2007 11:36 AM|jeremyh|LINK
Glad to hear that you are up and running, be sure to let me know if I can help you again.
If you have a minute can you mark the post that helped you out as the answer, will help some else maybe one day.