asp.net - 具有 transient 故障处理 block 异常的 Azure Web 角色 : The path is too long after being fully qualified

标签 asp.net azure enterprise-library azure-web-roles azure-cloud-services

我们为云服务的Web角色应用了 transient 故障处理 block ,我们甚至没有编写一行代码。当我们尝试在本地调试云服务时,异常会显示在网页上,如下所示:

The path is too long after being fully qualified. Make sure the full path is less than 260 characters and the directory name is less than 248 characters.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileLoadException: The path is too long after being fully qualified. Make sure the full path is less than 260 characters and the directory name is less than 248 characters.

程序集加载跟踪:以下信息有助于确定程序集“Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.ServiceBus”无法加载的原因。

=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.ServiceBus
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.ServiceBus | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/AzureCloudService2/WebRole1/
LOG: Initial PrivatePath = C:\AzureCloudService2\WebRole1\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\AzureCloudService2\WebRole1\web.config
LOG: Using host configuration file: C:\Program Files\IIS Express\config\templates\PersonalWebServer\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/<user>/AppData/Local/dftmp/Resources/7f758b78-aef1-47f7-ad86-8be56d4218e0/temp/temp/RoleTemp/Temporary ASP.NET Files/root/63defe93/23a6bb89/Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.ServiceBus.DLL.
LOG: Attempting download of new URL file:///C:/Users/<user>/AppData/Local/dftmp/Resources/7f758b78-aef1-47f7-ad86-8be56d4218e0/temp/temp/RoleTemp/Temporary ASP.NET Files/root/63defe93/23a6bb89/Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.ServiceBus/Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.ServiceBus.DLL.
LOG: Attempting download of new URL file:///C:/AzureCloudService2/WebRole1/bin/Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.ServiceBus.DLL.
LOG: Using application configuration file: C:\AzureCloudService2\WebRole1\web.config
LOG: Using host configuration file: C:\Program Files\IIS Express\config\templates\PersonalWebServer\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.ServiceBus, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
ERR: Failed to complete setup of assembly (hr = 0x8007006f). Probing terminated.

从日志记录来看,在上述位置似乎找不到Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.ServiceBus.dll,但实际上它确实位于C:/AzureCloudService2/WebRole1/bin/,我已经检查过很多次了。

几个信息:

  • 我们只是通过 Nuget 安装软件包
  • 我们也尝试过其他包,例如TransientFaultHandling.Caching等,都有这样的问题。
  • 有趣的是它在 worker 角色中运行良好

最佳答案

@RandyLevy 感谢您的评论,它解决了我的问题。如果您将其作为答案发布,您将赢得赏金:)

It looks like the ASP.NET temporary directory is exceeding the max path length. Take a look at Windows Azure - Resolving 'The Path is too long after being fully qualified Error Message' to set the _CSRUN_STATE_DIRECTORY environment variable. – Randy Levy

关于asp.net - 具有 transient 故障处理 block 异常的 Azure Web 角色 : The path is too long after being fully qualified,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26926018/

相关文章:

asp.net - 如何将 ASP.NET MVC Controller 操作的结果添加到 Bundle?

asp.net - ASP.NET Web服务,如何使某些成员不公开

c# - Identity isAuthenticated cookie

c# - EnterpriseLibrary 数据访问应用程序 block 重定向部分找不到默认数据库

.net - Microsoft 企业库替代方案

c# - ASP.NET Identity 在管理 View 中检索和编辑用户数据?

azure - 如何在ARM模板中设置变量的值? Or 在 ARM 模板中使用 Or 条件

powershell - Azure 运行手册 : The subscription named 'xxx' cannot be found

node.js - Azure Function Linux Nodejs 和 @azure/storage-blob 给出错误 : Cannot read property 'startsWith' of undefined

c# - 企业库异常处理应用程序 block