CSharpCodeGenerator“无法找到文件C:\ Windows \ Temp \ ... dll”

时间:2012-12-26 20:23:03

标签: wcf iis serialization

今天我被服务器监视器服务发出的警告文本消息唤醒,我的一台服务器已关闭,并且已经过去了7个小时。

服务器运行IIS中托管的WCF Web服务。

我在IIS中检查过我的应用程序池已停止。服务器上的事件日志中没有任何内容。

我的应用程序捕获所有错误并将它们写入文件系统。我看到有超过7300 FileNotFoundException份报告。他们都看起来像这样:

System.IO.FileNotFoundException("Could not find file 'C:\Windows\TEMP\fmhq0eve.dll'.")
mscorlib
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames)
at Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters options, String[] sources)
at Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSourceBatch(CompilerParameters options, String[] sources)
at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromSource(CompilerParameters options, String[] sources)
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.FromMappings(XmlMapping[] mappings, Type type)
at System.ServiceModel.Dispatcher.UnwrappedTypesXmlSerializerManager.BuildSerializers()
at System.ServiceModel.Dispatcher.UnwrappedTypesXmlSerializerManager.GetOperationSerializers(Object key)
at System.ServiceModel.Dispatcher.SingleBodyParameterXmlSerializerMessageFormatter.EnsureSerializers()
at System.ServiceModel.Dispatcher.SingleBodyParameterXmlSerializerMessageFormatter.GetOutputSerializer(Type type)
at System.ServiceModel.Dispatcher.SingleBodyParameterMessageFormatter.CreateBodyWriter(Object body)
at System.ServiceModel.Dispatcher.SingleBodyParameterMessageFormatter.SerializeReply(MessageVersion messageVersion, Object[] parameters, Object result)
at System.ServiceModel.Dispatcher.CompositeDispatchFormatter.SerializeReply(MessageVersion messageVersion, Object[] parameters, Object result)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.SerializeOutputs(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)

我看到过去在StackOverflow上报告了这个错误,并且有多种原因,主要与Serializer缓存有关,但堆栈跟踪中的代码完全由WCF处理。

服务器完全独自待了一个多月。最后一次Windows Update重新启动是在21天,这些异常发生前5天。我想不出其他原因。

为什么这个问题开始发生,我们可以做些什么呢?这是WCF中的错误吗?

1 个答案:

答案 0 :(得分:0)

让网络服务可以访问C:\ Windows \ Temp文件夹 使用iisreset重置iis

这应解决问题