【问题标题】:upload and execute a .SQL script to a web host to deploy a SQL database将 .SQL 脚本上传并执行到 Web 主机以部署 SQL 数据库
【发布时间】:2010-07-30 13:17:41
【问题描述】:

我尝试按照Scott Guthrie's tutorial 中概述的步骤将 .SQL 文件上传到 Hoster 并执行它以部署 SQL 数据库。

当我尝试查看该页面时,我收到一个错误页面。 根本原因是什么,如何解决?

Opening url http://www.elhayesetal.com/New_Members_ASPNETDB.MDF.sql  
   An error occured: System.Security.SecurityException: 
   Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. 
    at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) 
    at System.Security.CodeAccessPermission.Demand() 
    at System.Net.HttpWebRequest..ctor(Uri uri, ServicePoint servicePoint) 
    at System.Net.HttpRequestCreator.Create(Uri Uri) 
    at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase) 
    at System.Net.WebRequest.Create(String requestUriString) 
    at ASP.runsql_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) 
The action that failed was: Demand 
The type of the first permission that failed was: System.Net.WebPermission 
The Zone of the assembly that failed was: MyComputer 

【问题讨论】:

    标签: asp.net sql-server deployment


    【解决方案1】:

    正如异常详细信息所述,这是一个安全和权限问题

    您的解决方案可能是确保您的代码在完全信任模式下运行。

    一种解决方案是修改您的 web.config 文件。

     <system.web> 
        <trust level="Full" originUrl="" />
     </system.web> 
    

    这个解决方案might require an IIS reset

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-02-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-09
      • 2021-02-15
      • 2020-06-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多