0

今天,我被来自服务器监控服务的一条令人震惊的短信惊醒,说我的一台服务器已关闭,并且在过去 7 小时内一直如此。

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

我签入了 IIS,我的应用程序池已停止。服务器上的事件日志中没有任何内容。

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

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 更新重新启动是在 21 日,也就是这些异常发生前 5 天。我想不出其他原因。

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

4

1 回答 1

0

授予网络服务对 C:\Windows\Temp 文件夹的完全访问权限 使用 iisreset 重置 iis

这应该可以解决问题

于 2013-05-16T14:48:02.983 回答