日期:2014-05-18  浏览次数:20470 次

EnterpriseLibrary部署遇到问题
我最近的项目遇到一个棘手的问题

项目中用到了EnterpriseLibrary       在本地程序是很好的     可是传到服务器上,只要有页面用到了EnterpriseLibrary   访问数据库就会出现   如下错误:

Security   Exception  
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.  

Exception   Details:   System.Security.SecurityException:   That   assembly   does   not   allow   partially   trusted   callers.

我为这个问题2天没睡好觉了       大侠们快来帮我啊



------解决方案--------------------
try
server install EnterpriseLibrary
------解决方案--------------------
和空间商商量看看,要不然换家空间提供商。

------解决方案--------------------
如果用的vs2005 可以用 发布网站 呀,那个就可以编译成dll文件,不需要服务器端安装的
------解决方案--------------------
参考一下这个帖子里的答案

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1133494&SiteID=1

------解决方案--------------------
把错误信息google一下,一般都能找出原因
------解决方案--------------------
http://www.cnblogs.com/weisai/archive/2005/11/25/283754.html 看看这个帖子吧,遇到的问题和你的一样 InstallServices.bat  出错
------解决方案--------------------
你也许需要改动一下web.config里的trust设置,还有,你也许需要获取Patch 2554 (http://www.codeplex.com/entlib/Release/ProjectReleases.aspx?ReleaseId=1339)

<trust level= "Medium " />

参考

http://www.codeplex.com/entlib/Thread/View.aspx?ThreadId=8832


Using Enterprise Library in ASP.NET 2.0 Partial Trust Mode
http://www.devx.com/dotnet/Article/32951/0/page/1

------解决方案--------------------
帮顶