hi,
I have been trying to create an error handler to send me mail whenever an error occurs. This error handler is finally working ok on my local computer, but not so on the web site itself when I upload it.
The environment between the two are almost exactly the same. The local even uses the remote database, and the smtp tag of the configuration file uses my SMTP information for my web site. So nothing should need changed when it is uploaded, as long as I'm allowed to set the port, because on my local computer port 25 is blocked, so I have it using 587.
This error handler is compiled into a DLL and placed into bin.
Maybe if I show the code, someone can see what is wrong? It's nto giving an error, the mail just isn't being sent once I upload the site and provoke an error, such as going to a non-existent page.
Err, how do you post code here? I know of no code tags :(. I'm just going to paste it, and if there is some formatting to use, either someone who can change it, please do so, or tell me and I'll edit.
using
namespace
{
#region
}
context.Error +=
);
mailMessage.Subject =
mailMessage.Body =
mailMessage.Body = ReplaceTemplateVariables(mailMessage.Body);
mailMessage.IsBodyHtml =
mailMessage.Priority =
smtpClient.Send(mailMessage);
message = message.Replace(
#endregion
I had a problem with my HTTP module on one of my sites. It just gave back an error without any information about the reason.
I think it can be an issue about HTTPModules in ASP.NET 2.0 on ASPnix.
But for you, please check that you have configured SMTP server in Web.Config manually or from website configuration tool.
Quite interesting. Why wouldn't http modules work?
Yeah, I have the SMTP section of web.config configured just fine. Like I said, I have it so I won't have to change those settings even when I upload it.
Does anyone know if applications using the Enterprise Library can work OK on ASPnix? It seems like it'll be a lot easier to use that.
thanks for the response.
HTTPModules are not handler indeed but they are being proceed in a same process as handlers.
It can be caused by medium trust but can I add that famous line to my web.config or you have disabled it via machine.config?
If you mean the medium trust line then no sorry it's disabled in the config. Do you have a suggestion?
It's just an http module, which you're supposed to be able to set up in web.config.
I don't know; is there something in the code I posted that cannot be executed in medium trust?
*DevBanana thinks he needs to get a VPS so he can do more messing around with configuration
Well, I am now using the Enterprise Library to do these tasks, and it worked wonderfully on my computer, very nicely, yet when I upload it, well: http://www.devbanana.com [:9]
Is there someone from support who might be able to take a look at the error at their convenience? This is quite impossible for me, and annoying too, lol.
I can look at it tomorrow maybe because we are very busy with a server issue and normally we don't support code but I will try for you.
That's no problem, and I understand...
I'm going to try to upgrade to a VPS so I don't have to worry about permissions and configuration limitations and so I can get more experience setting up this kind of thing, for future purposes. But I'm not positive yet. I'm trying to keep costs as low as I possibly can but still not limit myself too much. And given I do a lot of development and testing, a VPS might be better. I asked a question in a ticket I just o pened about vpses
The Wizard:If you mean the medium trust line then no sorry it's disabled in the config. Do you have a suggestion?
Rick, can you enable custom policy for some operations in web.config?
This is my suggestion to enable some operations in custom policy. If you disable this completely, probably no one can use HTTPModules in his/her application.
I sent a blog post about this issue:
http://nayyeri.net/archive/2006/06/02/938.aspx
Please keep up the conversation to get a good result. We need to solve this anyway. I asked Scott Guthrie to give a short description about this.
After reading your blog post I want to tell you something to help you understand why shared hosts run in Medium Trust.
When we first deployed ASP.NET 2 on our servers it was set to Full Trust and some wonderful client who is no longer with us ran a nicely crafted ASP.NET script and deleted all domain web files on the server he was on and this is why we went to Medium Trust and I might add that we are using a slightly customized version of Medium Trust to allow file IO access and DNN 4 runs fine on our config so the DNN core team has found a way to make it work so it's very possible without the server config being changed.