2017-10-07 129 views
0

我在嘗試將我的網站託管到互聯網時下面附加了圖像文件。它已經由ASP.net mvc開發,並且像這樣的webconfig.file;託管MVC網站時出現錯誤

{

<configuration> 
    <appSettings> 
    <add key="webpages:Version" value="3.0.0.0" /> 
    <add key="webpages:Enabled" value="false" /> 
    <add key="ClientValidationEnabled" value="true" /> 
    <add key="UnobtrusiveJavaScriptEnabled" value="true" /> 
    </appSettings> 

    <system.web> 
    <customErrors mode="Off"></customErrors> 
    <compilation debug="true" targetFramework="4.5.2" /> 
    <httpRuntime targetFramework="4.5.2" /> 
    <httpModules> 
     <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" /> 
    </httpModules> 
    </system.web> 
    <system.webServer> 
    <security> 
     <requestFiltering allowDoubleEscaping="true"/> 
    </security> 
    <handlers> 
     <remove name="ExtensionlessUrlHandler-Integrated-4.0" /> 
     <remove name="OPTIONSVerbHandler" /> 
     <remove name="TRACEVerbHandler" /> 
     <!--alt satırı ekledim--> 
     <remove name="UrlRoutingHandler"/> 
     <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /> 
    </handlers> 
    <validation validateIntegratedModeConfiguration="false" /> 
    <!--alt satırı ekledim--> 
    <modules runAllManagedModulesForAllRequests="true"> 
     <remove name="ApplicationInsightsWebTracking" /> 
     <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" /> 
    </modules> 
    </system.webServer> 

}

我能做些什麼來完成託管?

Site error while hosting

+0

請仔細閱讀本網址https://stackoverflow.com/questions/11524582/system-security-securityexception –

+0

這是唯一的權限問題。你只需要給予完全的許可,它會解決你的問題。 –

回答

0

我希望這個問題時的應用程序的信任水平。我相信你的web.configuration缺少信任級別的配置,對於這一點,我們可以添加幾行代碼如下

你必須添加<trust level="Full"/><system.web>在web.config文件中的元素。我希望這些會幫助你。

+0

感謝您的幫助,我已更改了這些行,但出現此錯誤:'/'應用程序中的服務器錯誤。在服務器上出現應用程序錯誤: 運行時錯誤 說明。此應用程序的當前自定義錯誤設置可防止遠程查看應用程序錯誤的細節(出於安全原因)。但是,它可以通過本地服務器上運行的瀏覽器來查看。 –