Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/301.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 异常:引发System.OutOfMemoryException_C#_Exception_Out Of Memory - Fatal编程技术网

C# 异常:引发System.OutOfMemoryException

C# 异常:引发System.OutOfMemoryException,c#,exception,out-of-memory,C#,Exception,Out Of Memory,我已经做了4个多小时了。我已经删除了临时文件夹中的内容,并修复了所有构建问题,直到只有一个错误。当我尝试在解决方案中预览视图页面时,会出现this OutOfMemoryException。下面是堆栈跟踪 [OutOfMemoryException:引发了类型为'System.OutOfMemoryException'的异常。] System.Reflection.RuntimeAssembly.\u nLoad(AssemblyName文件名、字符串代码基、证据assemblySecurity

我已经做了4个多小时了。我已经删除了临时文件夹中的内容,并修复了所有构建问题,直到只有一个错误。当我尝试在解决方案中预览视图页面时,会出现this OutOfMemoryException。下面是堆栈跟踪

[OutOfMemoryException:引发了类型为'System.OutOfMemoryException'的异常。] System.Reflection.RuntimeAssembly.\u nLoad(AssemblyName文件名、字符串代码基、证据assemblySecurity、RuntimeAssembly位置提示、StackCrawlMark和stackMark、IntPtr pPrivHostBinder、Boolean throwOnFileNotFound、Boolean For Inspection、Boolean suppressSecurityChecks)+0 System.Reflection.RuntimeAssembly.nLoad(AssemblyName文件名、字符串代码基、证据assemblySecurity、RuntimeAssembly位置提示、StackScrawMark和stackMark、IntPtr pPrivHostBinder、Boolean throwOnFileNotFound、Boolean For Inspection、Boolean suppressSecurityChecks)+36 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef,证据assemblySecurity,RuntimeAssembly reqAssembly,StackScrawMark&stackMark,IntPtr pPrivHostBinder,Boolean throwOnFileNotFound,Boolean For Inspection,Boolean suppressSecurityChecks)+152 System.Reflection.RuntimeAssembly.InternalLoad(字符串assemblyString、证据assemblySecurity、StackScrawMark和stackMark、IntPtr pPrivHostBinder、布尔值用于内省)+77 System.Reflection.RuntimeAssembly.InternalLoad(字符串assemblyString、证据assemblySecurity、StackScrawMark和stackMark、布尔值ForInterspection)+21 系统.Reflection.Assembly.Load(字符串assemblyString)+28 System.Web.Configuration.CompliationSection.LoadAssemblyHelper(字符串assemblyName,布尔starDirective)+38

[ConfigurationErrorsException:引发了“System.OutOfMemoryException”类型的异常。] System.Web.Configuration.CompliationSection.LoadAssemblyHelper(字符串assemblyName,布尔starDirective)+738 System.Web.Configuration.CompliationSection.LoadAllAssembliesFromAppDomainBinDirectory()+217 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai)+130 System.Web.Compilation.BuildManager.GetReferencedAssembly(CompilationSection compConfig)+170 System.Web.Compilation.BuildManager.GetPrestartInitMethodsFromReferencedAssemblys()+92 System.Web.Compilation.BuildManager.CallPreStartInitMethods(字符串preStartInitListPath,布尔值&isRefAssemblyLoaded)+290 System.Web.Compilation.BuildManager.ExecuteRepapStart()+157 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager、IAApplicationHost appHost appHost、IConfigMapPathFactory configMapPathFactory、HostingEnvironmentParameters hostingParameters、PolicyLevel PolicyLevel、Exception appDomainCreationException)+531

[HttpException(0x80004005):引发了类型为'System.OutOfMemoryException'的异常。] System.Web.HttpRuntime.FirstRequestInit(HttpContext上下文)+9963380 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext上下文)+101 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr,HttpContext上下文)+254

Web.Config

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=301880
  -->
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
    <section name="mvcAuthorization" type="MvcAuthorization.Configuration.AuthorizationConfiguration, MvcAuthorization"/>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
  </configSections>
  <connectionStrings>
    <add name="MS_TableConnectionString" connectionString="Data Source=CELE-NEURONAH;Initial Catalog=molib;Integrated Security=True" providerName="System.Data.SqlClient"/>
    <add name="SQLServer_molibConnStr" connectionString="Data Source=CELE-NEURONAH;Initial Catalog=molib;Integrated Security=True" providerName="System.Data.SqlClient"/>
    <add name="DefaultConnection" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\aspnet-VR_Reports-20160408063851.mdf;Initial Catalog=aspnet-VR_Reports-20160408063851;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
    <add name="ADConnectionString" connectionString=""/>
  </connectionStrings>
  <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"/>
    <!--<add key="owin:AutomaticAppStartup" value="false"/>-->
    <add key="owin:AppStartup" value="VR.Reports.Startup"/>
    <add key="BaseUrl" value="http://localhost:21856/api"/>
    <add key="SupportUrl" value="http://localhost/vr-reports/api"/>
    <add key="Naira" value="₦"/>
    <add key="AppName" value="Molib VR"/>
  </appSettings>
  <!--<mvcAuthorization>
    <areas>
      <area>
        <controllers>
          <controller name="Account" roles="AllUsers">
            <actions>
              <action name="LogIn" />
            </actions>
          </controller>
          <controller name="*" roles="Admin">
            <actions>
              <action name="*" />
            </actions>
          </controller>
          <controller name="Home" roles="BusinessAdmin">
            <actions>
              <action name="Index" />
              <action name="TransactionVolume" />
              <action name="TransactionVolumePy" />
              <action name="TotalCustomerBalance" />
              <action name="BankFees" />
              <action name="BankFeesPy" />
              <action name="Loans" />
              <action name="SavingSchemeContribution" />
              <action name="SavingSchemeContributionPie" />
              <action name="TotalSavings" />
              <action name="TotalSavingsPie" />
              <action name="IncomeFromMerchant" />
              <action name="TotalSpendingOnMerchant" />
            </actions>
          </controller>
          <controller name="" roles="Marketing">
            <actions>
              <action name="Index" />
              <action name="LifeStyleGoalsCount" />
              <action name="LifeStyleGoalsCost" />
              <action name="Networth" />
              <action name="SpendingByCategory" />
              <action name="IncomeByCategory" />
              <action name="StandingOrder" />
              <action name="StandingOrderPie" />
              <action name="Assets" />
            </actions>
          </controller>
        </controllers>
      </area>
    </areas>
  </mvcAuthorization>-->
  <!--
    For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.

    The following attributes can be set on the <httpRuntime> tag.
      <system.Web>
        <httpRuntime targetFramework="4.5" />
      </system.Web>
  -->
  <system.web>
    <authentication mode="Forms"/>
    <membership defaultProvider="ADMembershipProvider">
      <providers>
        <clear/>
        <add name="ADMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider" connectionStringName="ADConnectionString" attributeMapUsername="sAMAccountName"/>
      </providers>
    </membership>
    <compilation debug="true" targetFramework="4.5.2">
      <assemblies>
        <add assembly="Syncfusion.EJ"/>
        <add assembly="Syncfusion.EJ.Mvc"/>
        <add assembly="Syncfusion.Compression.Base, Version=13.1400.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89"/>
        <add assembly="Syncfusion.Core, Version=13.1400.0.21, Culture=neutral, PublicKeyToken=632609B4D040F6B4"/>
        <add assembly="Syncfusion.DocIO.Base, Version=13.1400.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89"/>
        <!--<add assembly="Syncfusion.EJ, Version=13.1400.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89"/>-->
        <add assembly="Syncfusion.EJ.Export, Version=13.1400.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89"/>
        <add assembly="Syncfusion.EJ.Olap, Version=13.1400.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89"/>
        <!--<add assembly="Syncfusion.EJ.MVC, Version=13.1400.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89"/>-->
        <add assembly="Syncfusion.Linq.Base, Version=13.1400.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89"/>
        <add assembly="Syncfusion.Olap.Base, Version=13.1400.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89"/>
        <add assembly="Syncfusion.Pdf.Base, Version=13.1400.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89"/>
        <add assembly="Syncfusion.PivotAnalysis.Base, Version=13.1400.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89"/>
        <add assembly="Syncfusion.XlsIO.Base, Version=13.1400.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89"/>
      </assemblies>
    </compilation>
    <httpRuntime targetFramework="4.5"/>
    <pages>
      <namespaces>
        <add namespace="System.Web.Helpers"/>
        <add namespace="System.Web.Mvc"/>
        <add namespace="System.Web.Mvc.Ajax"/>
        <add namespace="System.Web.Mvc.Html"/>
        <add namespace="System.Web.Optimization"/>
        <add namespace="System.Web.Routing"/>
        <add namespace="System.Web.WebPages"/>
        <add namespace="Syncfusion.JavaScript"/>
        <add namespace="Syncfusion.JavaScript.DataVisualization"/>
        <add namespace="Syncfusion.MVC.EJ"/>
        <add namespace="Syncfusion.JavaScript.Mobile"/>
        <add namespace="Syncfusion.JavaScript.Olap"/>
      </namespaces>
    </pages>
  </system.web>
  <system.webServer>
    <modules>
      <remove name="FormsAuthentication"/>
    </modules>
    <handlers>
      <remove name="ExtensionlessUrlHandler-Integrated-4.0"/>
      <remove name="OPTIONSVerbHandler"/>
      <remove name="TRACEVerbHandler"/>
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/>
    </handlers>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Z.EntityFramework.Extensions" publicKeyToken="59B66D028979105B" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-3.10.25.0" newVersion="3.10.25.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Syncfusion.EJ" publicKeyToken="3D67ED1F87D44C89" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-14.1450.0.41" newVersion="14.1450.0.41"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed"/>
        <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.IdentityModel.Tokens.Jwt" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-4.0.20511.1437" newVersion="4.0.20511.1437"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Http.OData" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-5.7.0.0" newVersion="5.7.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="AutoMapper" publicKeyToken="be96cd2c38ef1005" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.2.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Spatial" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Validation" publicKeyToken="2fc06f0d701809a7" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-2.3.0.0" newVersion="2.3.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-7.2.1.0" newVersion="7.2.1.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-5.8.1.0" newVersion="5.8.1.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Syncfusion.Linq.Base" publicKeyToken="3d67ed1f87d44c89" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-13.1400.0.21" newVersion="13.1400.0.21"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Syncfusion.EJ" publicKeyToken="3d67ed1f87d44c89" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-14.1450.0.41" newVersion="14.1450.0.41"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Azure.KeyVault.Core" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.AnalysisServices.AdomdClient" publicKeyToken="89845dcd8080cc91" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="System.Data.SqlServerCe.4.0"/>
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
      <provider invariantName="System.Data.SqlServerCe.4.0" type="System.Data.Entity.SqlServerCompact.SqlCeProviderServices, EntityFramework.SqlServerCompact"/>
    </providers>
  </entityFramework>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
    </compilers>
  </system.codedom>
  <system.data>
    <DbProviderFactories>
      <remove invariant="System.Data.SqlServerCe.4.0"/>
      <add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
    </DbProviderFactories>
  </system.data>
  <mvcAuthorization>
    <areas>
      <area>
        <controllers>
          <controller name="Home">
            <actions>
              <action name="Index"/>
            </actions>
          </controller>
          <controller name="Account">
            <actions>
              <action name="LogOn"/>
            </actions>
          </controller>
        </controllers>
      </area>
    </areas>
  </mvcAuthorization>
</configuration>

在web.config的
部分中,有两个条目用于
Syncfusion.EJ
程序集:

  <dependentAssembly>
    <assemblyIdentity name="Syncfusion.EJ" publicKeyToken="3D67ED1F87D44C89" culture="neutral"/>
    <bindingRedirect oldVersion="0.0.0.0-14.1450.0.41" newVersion="14.1450.0.41"/>
  </dependentAssembly>

  <dependentAssembly>
    <assemblyIdentity name="Syncfusion.EJ" publicKeyToken="3d67ed1f87d44c89" culture="neutral"/>
    <bindingRedirect oldVersion="0.0.0.0-14.1450.0.41" newVersion="14.1450.0.41"/>
  </dependentAssembly>


它们的区别仅在于
publicKeyToken
属性的大小写;至少有一个是错的。(我对Syncfusion一无所知,所以我不知道是哪个)

乍一看,您的配置有问题。发布web.config文件?我会找出找不到该文件的原因:throwOnFileNotFound@EdmundSchweppe添加了网络配置