我的项目发布到国内的服务器上没有错误,能正常运行(ASP.NET的)! 今天发布到Godaddy空间里面去,在添加信息的时候需要上传图片!
然后就报下面的异常错误! 百度了好多都没有解决!都说是文件夹权限问题,于是我把网站根目录下的所有文件夹都设置成了可读,写权限!问题依旧....无奈...以下是异常信息!
通过实验发现,只要不上传照片就能把数据插入进数据库里面去! 但是项目要求的上传图片是必须得...所以希望哪位高手上来帮忙解决下! 在线等! 问题解决可加分!
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: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.Source Error: 
[No relevant source lines]
 Source File: App_Web_8wd9t7d5.4.cs    Line: 0 Stack Trace: 
[SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
   Manager_Manage_news.Button1_Click(Object sender, EventArgs e) +1256
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242
   System.Web.UI.Page.ProcessRequest() +80
   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
   System.Web.UI.Page.ProcessRequest(HttpContext context) +49
   ASP._123_edit_news_aspx.ProcessRequest(HttpContext context) in App_Web_8wd9t7d5.4.cs:0
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75 

解决方案 »

  1.   

    联系 Godaddy 技术部咨询。 
      

  2.   

    程序没有权限操作文件,系统设置了安全策略。
    System.Security.Permissions.FileIOPermission操作权限问题,联系网站咨询。
      

  3.   

    1.请把你的文件夹权限设一下吧,添加ASP.NET这个账号.
    2.请把web.config文件中的: <trust level="Medium" originUrl=".*" />改为
      <trust level="Full" originUrl="" />或者把他注解掉