2017-10-07 167 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

感谢您的帮助,我已更改了这些行,但出现此错误:'/'应用程序中的服务器错误。在服务器上出现应用程序错误: 运行时错误 说明。此应用程序的当前自定义错误设置可防止远程查看应用程序错误的细节(出于安全原因)。但是,它可以通过本地服务器上运行的浏览器来查看。 –