问题描述
描述: 应用程序尝试执行安全策略不允许的操作。要授予此应用程序所需的权限,请与系统管理员联系,或者更改配置文件 中的应用程序的信任级别。
大多数帖子说编辑网络配置文件并允许信任。我阅读了这个,但是我真的不能理解它。
如果这有助于澄清事情。我可以使用LINQ.dbml DataContext连接数据库并检索结果。但是,当我尝试将结果分配给一个对象时,例如说...数据上下文是一个外部项目,编译到一个dll并放在bin文件夹中。
DataContext db = new DataContext(connectionstring);
var bankUser =(from u in db.Bankers
其中u.banker_email == TXT_user.Text
&& u.banker_password == TXT_pass.Text
select u) 。单();
它会抛出上面发布的错误。
我只能通过控制面板访问,所以任何更改必须在web.config中。我已经将项目设置为拥有自己的应用程序池。
任何想法赞赏。
Hai Kieran,
在您的网络配置中,
尝试这个< trust level =Full/>
看看会发生什么....只是试试...
来源
I would like help with the following asp.net error i now have after deploying my app to live
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Most posts say to edit the web config file and allow trust. I read this http://msdn.microsoft.com/en-us/library/tkscy493.aspx but am not really able to make sense of it.
If it helps to clarify things. I can connect to the database and retrieve results using LINQ.dbml DataContext. However when I try and assign the results to a Object, say for example.. The Data context is an external project compiled to a dll and put in the bin folder.
DataContext db = new DataContext("connectionstring");
var bankUser = (from u in db.Bankers
where u.banker_email == TXT_user.Text
&& u.banker_password == TXT_pass.Text
select u).Single();
it throws the error posted above.
I only have access via a control panel so any changes will have to be in web.config. I have set the project to have its own application pool.
any ideas appreciated.
Hai Kieran, In your web config,
Try this<trust level="Full"/>
and we ll see what happens.... Just try it...
Source Forums.asp.net
这篇关于推送asp.net web应用程序。安全例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!