Skip to main content
 首页 » 编程设计

c#之Windows Azure Project Web角色入口点主机停止错误

2024年01月22日28Leo_wl

我刚刚开始为Azure开发。
我已经创建了一个具有Asp.net角色的Azure项目,但是当我尝试对其进行调试而不进行任何更改时,它将出现以下错误:
“ Windows Azure Web角色入口点主机已停止工作”。

请您参考如下方法:

检查您的%UserProfile%\ AppData \ Local \ Temp目录。您应该在那里看到几个文件,包括IISConfigurator.log。
  


对于我来说,在SDK v1.6上,路径为%UserProfile%\ AppData \ Local \ dftmp \ IISConfiguratorLogs \ IISConfigurator.log(请注意最新的SDK,它们似乎已更改了路径)
问题所在行为“将对用户IUSR和NT AUTHORITY \ NETWORK SERVICE的访问添加到路径%MyPathOnTheBuildMachine%”:

IISConfigurator Information: 0 : [00004816:00000004, 2011/12/08 13:01:51.971] Adding access to users IUSR and NT AUTHORITY\NETWORK SERVICE to path %MyPathOnTheBuildMachine% 
IISConfigurator Information: 0 : [00004816:00000004, 2011/12/08 13:01:51.972] Caught exception 
IISConfigurator Information: 0 : [00004816:00000004, 2011/12/08 13:01:51.974] Exception:System.InvalidOperationException: Method failed with unexpected error code 3. 
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.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.IISConfigurator.FileManager.AddAllowAce(DirectoryInfo dir, FileSystemRights rights, Boolean inherit, IdentityReference[] accounts) 
at Microsoft.WindowsAzure.ServiceRuntime.IISConfigurator.Security.AddAppPoolSidAceToVdir(String appPoolName, String sitePath, String appPoolSid) 
at Microsoft.WindowsAzure.ServiceRuntime.IISConfigurator.IISConfigurator.Deploy(String roleId, WebAppModel appModel, String roleRootDirectory, String sitesDestinationDirectory, String diagnosticsRootFolder, String roleGuid, Dictionary`2 globalEnvironment) 


原来,我将解决方案打包(cspack)放在一台机器上,但是试图在另一台机器上运行它(csrun)。因此,它尝试将权限授予一台计算机上存在的目录,而另一台计算机上不存在。

如此多的人确保cspack和cs在同一台机器上运行代码(例如,在进行自动构建和部署时可能不是这种情况)。