Not running in a hosted service or the Development Fabric

今天尝试在azure上发布网站后,无法正常访问

本地调试也提示:

Not running in a hosted service or the Development Fabric

谷歌百度半天…

最后发现是之前直接在azure发布webapplication的问题

只要删除掉web.config中的以下内容就OK了

<trace> 
    <listeners> 
        <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics"> 
            <filter type="" /> 
        </add> 
    </listeners> 
</trace>
原文地址:https://www.cnblogs.com/sun8134/p/3499450.html