在web.config中设置信任级别 [英] Setting Trust Level in web.config

查看:961
本文介绍了在web.config中设置信任级别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法通过ASP.NET发送电子邮件,发送电子邮件到我的网络主机的一些帮助,被告知修改我的安全设置和发送的链接:

I can't send email via ASP.NET and sent an email to my web hosts for some help and was told to modify my security settings and was sent a link:

http://forums.asp.net/t/1111145.aspx/1

我读过它说有,并试图制定<信任级别=全originUrl =/>在web.config中,后来我得到错误:

I've read what it said there and tried setting <trust level="Full" originUrl="" /> in web.config, but then I get the error:

这部分配置无法在此路径使用。发生这种情况时,该网站管理员使用&LT锁定上网本节;地点有的allowOverride =false的&GT;从继承的配置文件。

我没有设置任何其他web.config文件。

I've not set any other web.config file.

于是我又问了网络主机,并问如果这是一个服务器设置,我无法改变,但我得到的回应只是:

So I asked the web hosts again, and asked if it was a server setting which I cannot change, but the response I got was just:

你需要指定一个更具体的路径。

这是可爱的,但我不知道这意味着什么!

Which is lovely, but I've no idea what that means!

做完多一点挖我想知道如果我要成立一个独立的信任文件,这是正确的?

Having done a bit more digging I am wondering if I have to set up a separate trust file, is this correct?

有人能指出我的设置我的信任级别的正确方法的方向(我知道全可能不正确呢?)我真的不明白我应该做的!

Could someone point me in the direction of the correct way to set up my Trust level (I realise "full" is probably incorrect as well?) as I really don't understand what I am supposed to do!

推荐答案

信任水平记录在这里:的 http://msdn.microsoft.com/en-us/library/ie/wyts434y.aspx 。在共享主机,供应商锁定该设置,所以你不能在你的web.config更改。如果你清楚地从你的供应商要求允许完全信任你的应用程序,并且如果他们回答说:是吗?,那么你在谈论一个大老粗 - 无论是要求升级或更换主机。 请配置我完全信任的应用程序应该是足够清晰。请注意,他们可能不会愿意这样做,一旦他们明白你的要求。

Trust levels are documented here: http://msdn.microsoft.com/en-us/library/ie/wyts434y.aspx. In shared hosting, providers lock that settings, so you cannot change in your web.config. If you clearly requested from your provider to allow full trust to your application, and if they responded with "huh?", then you were talking to an uneducated person - either request escalation or change hosts. "Please configure my application with full trust" should be clear enough. Note that they may not be willing to do that, once they understand your request.

另外,我不能肯定,充分信任是需要发送邮件了。发送邮件了涉及传达给SMTP服务器的能力,通常网络主机允许只访问他们,他们封锁一切(垃圾邮件prevention)。您将无法说服他们破例给你,但如果你问请告诉我要使用的SMTP端口,以从我的asp.net应用程序发送电子邮件了,他们应该给你(否则,升级或更改主机)。实际上,你应该问他们来帮助你第一次发送邮件时,你做出的结论,即信任级别是​​什么阻碍它之前(现在,我pretty确保它不会)。

Also, I cannot be sure that full trust is required to send mail out. Sending mail out involves ability to communicate to an SMTP server, and usually web hosts allow accessing only theirs and they block everything else (for spam prevention). You will not be able to talk them into making an exception for you, but if you ask "please tell me which smtp and port to use to send email out from my asp.net application", they should give it to you (otherwise, escalate or change hosts). You actually should have asked them to help you send mail out first, before you made conclusion that trust-level is what's obstructing it (now, I'm pretty sure it doesn't).

此外,阅读,请:<一href=\"http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem\">http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem

这篇关于在web.config中设置信任级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆