涉及未找到随机临时文件的疯狂 .net/Sharepoint 错误
今天登录到客户环境以检查日志并进行一般性检查,却发现一个应用程序中的某些任务失败了。
应用程序是用 c# .net v4 编写的,在 IIS 内运行并导出到 Sharepoint 2007。
我无法 100% 确定 .net 或 SharePoint 是否是罪魁祸首。这些是我得到的错误:
任务失败:服务器无法 处理请求。 --->找不到 文件“C:\Windows\TEMP\qbckfur1.dll”。
导出 26.05.2011 15:00:21 失败
任务失败:服务器无法 处理请求。 --->找不到 文件“C:\Windows\TEMP\2shjg2xb.dll”。
导出 26.05.2011 15:30:13 失败
任务失败:服务器无法 处理请求。 --->找不到 文件“C:\Windows\TEMP\b7utp199.dll”。
导出 26.05.2011 16:00:15 失败
任务失败:服务器无法 处理请求。 --->找不到 文件“C:\Windows\TEMP\ozr2umkm.dll”。
大家有没有觉得这很熟悉?
Logged into a customer environment today to check logs and just generally do an inspection, only to notice some tasks had failed in one application.
Application is written in c# .net v4 running inside of IIS and exports to Sharepoint 2007.
I can't be 100% sure if .net or SharePoint is the culprit. These are the errors I got:
Task Failed: Server was unable to
process request. ---> Could not find
file 'C:\Windows\TEMP\qbckfur1.dll'.
Export 26.05.2011 15:00:21 Failure
Task Failed: Server was unable to
process request. ---> Could not find
file 'C:\Windows\TEMP\2shjg2xb.dll'.
Export 26.05.2011 15:30:13 Failure
Task Failed: Server was unable to
process request. ---> Could not find
file 'C:\Windows\TEMP\b7utp199.dll'.
Export 26.05.2011 16:00:15 Failure
Task Failed: Server was unable to
process request. ---> Could not find
file 'C:\Windows\TEMP\ozr2umkm.dll'.
Does this look familiar to anyone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是
XmlSerialization
的问题(不管你信不信)。我在使用自定义 ASP.NET MVC 应用程序时遇到了这个问题。显然,当您对标记为“可序列化”的类型调用Serialize
或Deserialize
时,.NET 将即时生成一个程序集以支持序列化,并尝试写入将该程序集放入“c:\windows\temp”。即使
Everyone
对该目录具有完全控制访问权限,当从 IIS 应用程序池中运行应用程序时,我仍然看到这种情况发生。特别是在具有大量序列化活动的应用程序中。如果这听起来像您的问题,解决方案是“预编译”序列化程序集,并将其包含在您的应用程序中,并使用
sgen
(Windows SDK 的一部分)。这篇文章强调了类似的问题:MSDN Social 上的序列化问题
以下是有关该工具的 MSDN 文章:sgen 参考
最后注意:有一个单独的.NET 4.0 工具的版本,因此请确保在生成程序集时使用正确的版本。
This is a problem with
XmlSerialization
(beleive it or not). I ran into this with a custom ASP.NET MVC app. Apparently, when you callSerialize
orDeserialize
on types marked as "Serializable", .NET will generate an assembly on-the-fly to support the serialization and it attempts to write that assembly into 'c:\windows\temp'.Even if
Everyone
has full control access to that directory I have still seen this occur when running an app from within an IIS App Pool. Especially in applications that has a lot of serialization activity.If this sounds like your problem, the solution is to "pre-compile" the Serialization assembly and include it in your application with
sgen
, part of the Windows SDK.This post highlights a similar issue: Serialization issue on MSDN Social
Here is the MSDN article on the tool: sgen reference
Final Note: There is a separate version of the Tool for .NET 4.0 so make sure you are using the correct version when generating your assembly.