我最近的项目遇到一个棘手的问题项目中用到了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天没睡好觉了   大侠们快来帮我啊

解决方案 »

  1.   

    try
    server install EnterpriseLibrary
      

  2.   

    如果用的vs2005 可以用 发布网站 呀,那个就可以编译成dll文件,不需要服务器端安装的
      

  3.   

    参考一下这个帖子里的答案http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1133494&SiteID=1
      

  4.   

    把错误信息google一下,一般都能找出原因
      

  5.   

    google了一晚上  也对着修改了[assembly: AllowPartiallyTrustedCallers()] 修改了ObjectBuilder  修改了EnterpriseLibrary的生成参数  就是不行我郁闷啊
      

  6.   

    http://www.cnblogs.com/weisai/archive/2005/11/25/283754.html 看看这个帖子吧,遇到的问题和你的一样 InstallServices.bat  出错
      

  7.   

    你也许需要改动一下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