VS2015中的Azure调试环境在启动时崩溃

GFo*_*y83 6 azure azure-debugger azure-sdk-.net visual-studio-2015

这最近才刚刚开始发生.我尝试了我可以在Stack和其他论坛上找到的所有解决方案,但迄今为止没有任何工作.

当我尝试在Azure辅助角色上开始调试时,这是我得到的:

在此输入图像描述

Debug窗口显示: The program '[2208] WaIISHost.exe' has exited with code 0 (0x0).

我在管理模式下运行Visual Studios,将正确的项目设置为启动并使用IIS Express作为开发服务器.

我尝试使用相同的基础项目创建一个新的Azure辅助角色,但这不起作用.系统事件日志没有任何信息.我已经尝试重新安装VS2015并单独重新安装Azure SDK(v.2.7.1),没有任何更改.当我查看计算模拟器时,它在消失之前说:

[fabric] Role Instance: deployment27(250).Web.0
[fabric] Role state Unhealthy
[fabric] Role state Stopped
Run Code Online (Sandbox Code Playgroud)

然而,我能够在解决方案中启动其他工作者角色项目,这使我相信某些项目必然会在某种程度上与破坏的工作者角色相关联.我在这个阶段没有想法,所以非常感谢任何帮助.

UPDATE

查看WallSHost.log里面的文件C:\Users\<UserAccount>\AppData\Local\dftmp\Resources\<GUID>\directory\DiagnosticStore给我一个Invalid name错误:

WaIISHost Information: 0 : [00003568:00000001, 2015-10-06 20:02:05.472, INFO ] Attempt Deploy with RoleInstanceId=deployment27(252).Web_IN_0 RoleRoot=C:\Web\csx\Debug\roles\Web\ optional SitesDestination=
WaIISHost Information: 0 : [00003568:00000001, 2015-10-06 20:02:08.153, ERROR] Exception:System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: Invalid name.
Parameter name: name (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.ArgumentException: Invalid name.
Parameter name: name
   at System.Security.AccessControl.NativeObjectSecurity.CreateInternal(ResourceType resourceType, Boolean isContainer, String name, SafeHandle handle, AccessControlSections includeSections, Boolean createByName, ExceptionFromErrorCode exceptionFromErrorCode, Object exceptionContext)
   at System.Security.AccessControl.FileSystemSecurity..ctor(Boolean isContainer, String name, AccessControlSections includeSections, Boolean isDirectory)
   at System.Security.AccessControl.DirectorySecurity..ctor(String name, AccessControlSections includeSections)
   at System.IO.DirectoryInfo.GetAccessControl(AccessControlSections includeSections)
   at Microsoft.WindowsAzure.ServiceRuntime.IISConfigurator.FileManager.AddAllowAceIterative(DirectoryInfo dir, FileSystemRights rights, IdentityReference[] accounts)
   at Microsoft.WindowsAzure.ServiceRuntime.IISConfigurato...).


WaIISHost Information: 0 : [00003568:00000001, 2015-10-06 20:02:08.157, ERROR] Exception:System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: Invalid name.
Parameter name: name (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.ArgumentException: Invalid name.
Parameter name: name
   at System.Security.AccessControl.NativeObjectSecurity.CreateInternal(ResourceType resourceType, Boolean isContainer, String name, SafeHandle handle, AccessControlSections includeSections, Boolean createByName, ExceptionFromErrorCode exceptionFromErrorCode, Object exceptionContext)
   at System.Security.AccessControl.FileSystemSecurity..ctor(Boolean isContainer, String name, AccessControlSections includeSections, Boolean isDirectory)
   at System.Security.AccessControl.DirectorySecurity..ctor(String name, AccessControlSections includeSections)
   at System.IO.DirectoryInfo.GetAccessControl(AccessControlSections includeSections)
   at Microsoft.WindowsAzure.ServiceRuntime.IISConfigurator.FileManager.AddAllowAceIterative(DirectoryInfo dir, FileSystemRights rights, IdentityReference[] accounts)
   at Microsoft.WindowsAzure.ServiceRuntime.IISConfigurato...).
Run Code Online (Sandbox Code Playgroud)

GFo*_*y83 13

重新安装Visual Studios,Azure SDK,IIS并通过日志文件后,我终于找到了问题:node_modulesWeb项目中与我的worker角色关联的文件夹.

我删除文件夹后立即开始调试; 即使它不是Visual Studios解决方案的一部分.

我已经在Stack上搜索了这个特定的问题并找到了这篇文章:https: //stackoverflow.com/a/28188299/654708

添加rmdir /s /q "$(ProjectDir)node_modules\"到与worker角色关联的项目属性内的构建后事件将删除node_modulesAzure调试器启动之前的文件夹.不是一个完美的修复,但它会做到这一点,直到Windows无法处理长文件名这个荒谬的问题是固定的.

在此输入图像描述

UPDATE

刚刚找到了更好的解决方案 npm使用npm-windows-upgradeMicrosoft dev团队中的模块更新到> = 3.x :

https://www.npmjs.com/package/npm-windows-upgrade

npm3.x中,node_modules文件夹中的模块存储在平面结构中.这应该有助于避免导致Azure调试器崩溃的路径上的256个字符限制(前提是解决方案根目录的路径不是太长).

默认情况下,在Windows上安装Node时,npm版本2会预先捆绑(截至2015年9月8日).使用常规npm更新命令npm -g install npm@<version>将不起作用,因为Node将始终查看npm安装附带的版本; 这是哪里npm-windows-upgrade进来的.

使用管理员权限打开Windows PowerShell并运行以下任务以选择npm要安装的版本.

  1. Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
  2. npm install -g npm-windows-upgrade
  3. npm-windows-upgrade

在此输入图像描述

补充阅读:

https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows https://github.com/npm/npm/issues/3697#issuecomment-114665926