我有一个调用.NET DLL的ASP.NET Web应用程序,进而调用Web服务。 Web服务调用抛出异常:
Unable to generate a temporary class (result=1). error CS0001: Internal compiler error (0xc00000fd) error CS0003: Out of memory
Stack Trace: at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies) at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence) at System.Xml.Serialization.XmlSerializer.GetSerializersFromCache(XmlMapping[] mappings, Type type) at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type) at System.Web.Services.Protocols.SoapClientType..ctor(Type type) at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
我应该提到这是我第一次在这台电脑上执行这个特定的代码(我最近进行了Windows重新格式化/重新安装) - 这让我认为这是一个环境问题(相同的应用程序在我们的测试和生产服务器上运行良好)。但我很困惑原因在哪里。
一些额外的细节来回答跟进问题:
- This is a real PC (not a VM).
- I m running .NET 3.5 on IIS 7. Our production servers are IIS 6, but it has worked correctly on IIS 7 before.
- The PC has 2 GB of RAM with plenty of that free.
- I haven t changed any of the machine.config settings, nor any of the web.config settings related to process model, compilation, memory usage, etc.
- The local IIS_IUSRS group has read/write permissions for the "Temporary ASP.NET Files" folder.
- I checked the application pool settings: both private memory and virtual memory are set to 0 (no limit).
工作进程的内存使用情况:
- I recycled the worker process to get a clean slate and then hit an ASP.NET page in the application...Task Manager shows 22 MB used.
- I then hit the event that makes the web service call and the memory usage shoots up to about 150 MB, levels off, then I get the exception.