加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net-mvc-3 – ASP.NET性能分析404/500错误

发布时间:2020-12-16 03:53:24 所属栏目:asp.Net 来源:网络整理
导读:使用Visual Studio Performance Explorer和Cassini,我正在尝试在我的( Orchard CMS 1.4.0)ASP.NET MVC3应用程序上启动性能分析,但是我收到此错误: The web site could not be configured correctly; getting ASP.NET process information failed. Requestin
使用Visual Studio Performance Explorer和Cassini,我正在尝试在我的( Orchard CMS 1.4.0)ASP.NET MVC3应用程序上启动性能分析,但是我收到此错误:

The web site could not be configured correctly; getting ASP.NET process information failed. Requesting http://localhost:30320/OrchardLocal/VSEnterpriseHelper.axd returned an error: The remote server returned an error: (404) Not Found.

所以我搜索了一个解决方案,发现this article不适用,因为我使用的是Visual Studio的开发服务器(Cassini)而不是IIS – 不少于IIS 6.然后我读了this article和this article;在所有这些建议中,唯一有所作为的是将位置部分添加到我的web.config,以授予对VSEnterpriseHelper.axd的访问权限.但正如其中一篇文章预测的那样,我的404错误只是变成了500:

The web site could not be configured correctly; getting ASP.NET process information failed. Requesting http://localhost:30320/OrchardLocal/VSEnterpriseHelper.axd returned an error: The remote server returned an error: (500) Internal Server Error.

这些不同文章中的尾随评论对我不起作用.有什么建议?我想我会在这里发布我的(Orchard 1.4.0)web.config,以防有人发现罪魁祸首:

<?xml version="1.0"?>
<!-- 
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    WindowsMicrosoft.NetFrameworkv2.xConfig 
-->
<configuration>
  <configSections>
    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup,System.Web.WebPages.Razor">
      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection,System.Web.WebPages.Razor" requirePermission="false" />
      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection,System.Web.WebPages.Razor" requirePermission="false" />
    </sectionGroup>

    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" requirePermission="false" />
  </configSections>

  <appSettings>
    <add key="webpages:Enabled" value="false" />
    <add key="log4net.Config" value="Configlog4net.config" />
  </appSettings>

  <!-- Added this,which eliminated the profiling 
  VSEnterpriseHelper.axd 404 error - and led to a 500 
  error instead. -->
  <location path="VSEnterpriseHelper.axd">
    <system.web>
      <authorization>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>

  <system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory,System.Web.Mvc,Version=3.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35" />
    <pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />
        <add namespace="System.Linq"/>
        <add namespace="System.Collections.Generic"/>
        <add namespace="Orchard.Mvc.Html"/>
      </namespaces>
    </pages>
  </system.web.webPages.razor>

  <!-- 
        Set default transaction timeout to 30 minutes so that interactive debugging 
        is easier (default timeout is less than one minute)
  -->
  <system.transactions>
    <defaultSettings timeout="00:30:00"/>
  </system.transactions>
  <system.web>
    <!--<trust level="Medium" originUrl="" />-->

    <httpRuntime requestValidationMode="2.0" />
    <!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance,set this value to true only 
            during development.
    -->
    <compilation debug="true" targetFramework="4.0" batch="true" numRecompilesBeforeAppRestart="250" optimizeCompilations="true">
        <buildProviders>
        <add extension=".csproj" type="Orchard.Environment.Extensions.Compilers.CSharpExtensionBuildProviderShim"/>
      </buildProviders>
      <assemblies>
        <add assembly="System.Web.Mvc,PublicKeyToken=31bf3856ad364e35,processorArchitecture=MSIL"/>
        <add assembly="System.Web.Abstractions,Version=4.0.0.0,processorArchitecture=MSIL"/>
        <add assembly="System.Web.Routing,processorArchitecture=MSIL"/>
        <add assembly="System.Data.Linq,PublicKeyToken=B77A5C561934E089"/>
        <remove assembly="System.Configuration,PublicKeyToken=b03f5f7f11d50a3a" />
        <remove assembly="System.Web,PublicKeyToken=b03f5f7f11d50a3a" />
        <remove assembly="System.Data,PublicKeyToken=b77a5c561934e089" />
        <remove assembly="System.Web.Services,PublicKeyToken=b03f5f7f11d50a3a" />
        <remove assembly="System.Xml,PublicKeyToken=b77a5c561934e089" />
        <remove assembly="System.Drawing,PublicKeyToken=b03f5f7f11d50a3a" />
        <remove assembly="System.EnterpriseServices,PublicKeyToken=b03f5f7f11d50a3a" />
        <remove assembly="System.IdentityModel,PublicKeyToken=b77a5c561934e089" />
        <remove assembly="System.Runtime.Serialization,PublicKeyToken=b77a5c561934e089" />
        <remove assembly="System.ServiceModel,PublicKeyToken=b77a5c561934e089" />
        <remove assembly="System.ServiceModel.Activation,PublicKeyToken=31bf3856ad364e35"/>
        <remove assembly="System.ServiceModel.Web,PublicKeyToken=31bf3856ad364e35"/>
        <remove assembly="System.Activities,PublicKeyToken=31bf3856ad364e35"/>
        <remove assembly="System.ServiceModel.Activities,PublicKeyToken=31bf3856ad364e35"/>
        <remove assembly="System.WorkflowServices,PublicKeyToken=31bf3856ad364e35"/>
        <remove assembly="System.Web.Extensions,PublicKeyToken=31bf3856ad364e35" />
        <remove assembly="System.Data.DataSetExtensions,PublicKeyToken=b77a5c561934e089" />
        <remove assembly="System.Web.ApplicationServices,PublicKeyToken=31bf3856ad364e35" />
      </assemblies>
    </compilation>
    <!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
    -->
    <authentication mode="Forms">
      <forms loginUrl="~/Users/Account/AccessDenied" timeout="2880"/>
    </authentication>

    <!--
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically,it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.
    -->
    <customErrors mode="RemoteOnly" />
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
      <namespaces>
        <add namespace="System.Web.Mvc"/>
        <add namespace="System.Web.Mvc.Ajax"/>
        <add namespace="System.Web.Mvc.Html"/>
        <add namespace="System.Web.Routing"/>
        <add namespace="System.Linq"/>
        <add namespace="System.Collections.Generic"/>
        <add namespace="Orchard.Mvc.Html"/>
      </namespaces>
    </pages>

    <httpHandlers>
      <!-- see below -->
      <clear />
      <add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>

    </httpHandlers>

    <httpModules>
      <add name="WarmupHttpModule" type="Orchard.WarmupStarter.WarmupHttpModule,Orchard.WarmupStarter,Version=1.0.20,Culture=neutral"/>
    </httpModules>
  </system.web>

  <!-- 
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
  -->
  <system.webServer>

    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true">
      <remove name="WarmupHttpModule" />
      <add name="WarmupHttpModule" type="Orchard.WarmupStarter.WarmupHttpModule,Culture=neutral"/>
    </modules>
    <handlers accessPolicy="Script">
      <!-- clear all handlers,prevents executing code file extensions,prevents returning any file contents -->
      <clear/>
      <!-- Return 404 for all requests via managed handler. The url routing handler will substitute the mvc request handler when routes match. -->
      <add name="NotFound" path="*" verb="*" type="System.Web.HttpNotFoundHandler" preCondition="integratedMode" requireAccess="Script"/>
    </handlers>
    <!-- Prevent IIS 7.0 from returning a custom 404/500 error page of its own -->
    <httpErrors existingResponse="PassThrough" />
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <probing privatePath="App_Data/Dependencies"/>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0" newVersion="3.0.0.0"/>
        <bindingRedirect oldVersion="2.0.0.0" newVersion="3.0.0.0"  />
      </dependentAssembly> 
    </assemblyBinding>
  </runtime>
</configuration>

解决方法

就我而言,我有

<validation validateIntegratedModeConfiguration="true" />

在我的web.config中设置.当我把它改成

<validation validateIntegratedModeConfiguration="false" />

事情神奇地开始工作.三个小时下来……

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读