WebSite未在Azure本地运行

时间:2014-09-13 15:53:27

标签: asp.net-mvc azure azure-cloud-services

编辑:以管理员身份运行Visual Studio修复了下面的问题,但有人可以解释为什么我需要以管理员身份运行才能在Azure模拟器中运行网站吗?

我们正在将我们的网站迁移到Windows Azure,我已经创建了一个云服务并将该网站添加为Web角色,当我尝试在调试中启动云服务项目时,它将无法启动并且在输出它说:

The program '[12396] WaIISHost.exe' has exited with code 0 (0x0).

在左下角显示“取消操作”。我似乎无法找到任何理由为什么会这样,如果我创建一个空白的asp.net mvc网站它工作正常所以我们的应用程序必须有一些东西导致它像这样炸弹,有没有人知道如何要跟踪这个问题吗?

我只看了一下模拟器输出,但它说:

[fabric] Role Instance: deployment24(29).xxx.Web.0
[fabric] Role state Busy
[fabric] Role state Unhealthy
[fabric] Role state Stopped

我在waHostBootstrapper.log

中找到了以下条目
[00005740:00008088, 2014/09/13, 15:57:43.320, ERROR] <- WapXmlReadRoleModel=0x1
[00005740:00008088, 2014/09/13, 15:57:43.324, ERROR] <- GetDebugger=0x1
[00005740:00008088, 2014/09/13, 15:57:43.324, ERROR] <- GetStartupTaskDebugger=0x1
[00005740:00008088, 2014/09/13, 15:57:43.324, ERROR] <- WapGetEnvironmentVariable=0x800700cb
[00005740:00008088, 2014/09/13, 15:57:43.324, ERROR] <- WapGetEnvironmentVariable=0x800700cb
[00005740:00008088, 2014/09/13, 15:57:43.324, INFO ] Executing Startup Task type=2 rolemodule=Diagnostics cmd="E:\xxx\Diagnostics\DiagnosticsAgent.exe" 
[00005740:00008088, 2014/09/13, 15:57:43.325, INFO ] Executing "E:\xxx\Diagnostics\DiagnosticsAgent.exe" .
[00005740:00008088, 2014/09/13, 15:57:43.334, ERROR] <- WapGetEnvironmentVariable=0x800700cb
[00005740:00008088, 2014/09/13, 15:57:43.335, ERROR] <- WapGetEnvironmentVariable=0x800700cb
[00005740:00008088, 2014/09/13, 15:57:43.335, INFO ] Executing Startup Task type=0 rolemodule=Diagnostics cmd="E:\xxx\Diagnostics\DiagnosticsAgent.exe" /blockStartup
[00005740:00008088, 2014/09/13, 15:57:43.335, INFO ] Executing "E:\xxx\DiagnosticsAgent.exe" /blockStartup.
[00005740:00002464, 2014/09/13, 15:57:43.480, INFO ] Registering client with PID 13152.
[00005740:00002464, 2014/09/13, 15:57:43.480, INFO ] Client DiagnosticsAgent.exe (13152) registered.
[00005740:00002464, 2014/09/13, 15:57:43.493, INFO ] Registering client with PID 11656.
[00005740:00002464, 2014/09/13, 15:57:43.493, INFO ] Client DiagnosticsAgent.exe (11656) registered.
[00005740:00008088, 2014/09/13, 15:57:43.564, INFO ] Program "E:\xxx\Diagnostics\DiagnosticsAgent.exe" /blockStartup exited with 0. Working Directory = E:\xxx\plugins\Diagnostics
[00005740:00008088, 2014/09/13, 15:57:43.564, INFO ] Executing "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Windows Azure Tools\v2.4\Debugger\WindowsAzureDebugger.exe" base\x64\WaIISHost.exe .
[00005740:00008088, 2014/09/13, 15:57:43.565, INFO ] Role host process PID: 5456.
[00005740:00002464, 2014/09/13, 15:57:43.742, INFO ] Registering client with PID 16360.
[00005740:00002464, 2014/09/13, 15:57:43.742, INFO ] Client WaIISHost.exe (16360) registered.
[00005740:00002464, 2014/09/13, 15:57:43.742, INFO ] Client process WaIISHost.exe is the role host.
[00005740:00002464, 2014/09/13, 15:57:43.742, INFO ] Role host process registered.
[00005740:00008572, 2014/09/13, 15:57:43.820, INFO ] Getting status from client DiagnosticsAgent.exe (13152).
[00005740:00008572, 2014/09/13, 15:57:43.820, ERROR] Failed to connect to client DiagnosticsAgent.exe (13152).
[00005740:00008572, 2014/09/13, 15:57:43.820, ERROR] <- CRuntimeClient::OnRoleStatusCallback(0x0000000E8AE90C90) =0x800706ba
[00005740:00008572, 2014/09/13, 15:57:43.820, INFO ] Removing disconnected client: DiagnosticsAgent.exe (13152).
[00005740:00008572, 2014/09/13, 15:57:43.820, INFO ] Getting status from client DiagnosticsAgent.exe (11656).
[00005740:00008572, 2014/09/13, 15:57:43.826, INFO ] Client reported status 0.
[00005740:00008572, 2014/09/13, 15:57:43.826, INFO ] Getting status from client WaIISHost.exe (16360).
[00005740:00008572, 2014/09/13, 15:57:43.826, INFO ] Client reported status 1.
[00005740:00008572, 2014/09/13, 15:57:44.327, INFO ] Getting status from client DiagnosticsAgent.exe (11656).
[00005740:00008572, 2014/09/13, 15:57:44.331, INFO ] Client reported status 0.
[00005740:00008572, 2014/09/13, 15:57:44.331, INFO ] Getting status from client WaIISHost.exe (16360).
[00005740:00008572, 2014/09/13, 15:57:44.331, INFO ] Client reported status 1.
[00005740:00008572, 2014/09/13, 15:57:44.833, INFO ] Getting status from client DiagnosticsAgent.exe (11656).
[00005740:00008572, 2014/09/13, 15:57:44.842, INFO ] Client reported status 0.
[00005740:00008572, 2014/09/13, 15:57:44.842, INFO ] Getting status from client WaIISHost.exe (16360).
[00005740:00008572, 2014/09/13, 15:57:44.842, ERROR] Failed to connect to client WaIISHost.exe (16360).
[00005740:00008572, 2014/09/13, 15:57:44.842, ERROR] <- CRuntimeClient::OnRoleStatusCallback(0x0000000E8AE90CF0) =0x800706ba
[00005740:00008572, 2014/09/13, 15:57:44.842, INFO ] Client process WaIISHost.exe is the role host.
[00005740:00008572, 2014/09/13, 15:57:44.842, WARN ] Failed to contact the role host process. Treat role as unhealthy.
[00005740:00017556, 2014/09/13, 15:57:45.295, INFO ] Sending shutdown notification to client DiagnosticsAgent.exe (11656).
[00005740:00017556, 2014/09/13, 15:57:45.301, INFO ] Sending shutdown notification to client WaIISHost.exe (16360).
[00005740:00017556, 2014/09/13, 15:57:45.302, ERROR] Failed to connect to client WaIISHost.exe (16360).
[00005740:00017556, 2014/09/13, 15:57:45.302, ERROR] <- CRuntimeClient::OnRoleShutdownCallback(0x0000000E8AE90CF0) =0x800706ba

查看\ AppData \ Local \ dftmp \ Resources {guid} \ directory \ DiagnosticStore中的日志,WaIISHost.log中存在以下错误:

WaIISHost信息:0:[00006516:00000001,2014 / 09/2014 06:43:23.994,ERROR]异常:System.ServiceModel.FaultException`1 [System.ServiceModel.ExceptionDetail]:尝试执行未经授权的操作。 (Fault Detail等于ExceptionDetail,可能由IncludeExceptionDetailInFaults = true创建,其值为: System.UnauthorizedAccessException:尝试执行未经授权的操作。    在System.Security.AccessControl.Win32.SetSecurityInfo(ResourceType类型,字符串名称,SafeHandle句柄,SecurityInfos securityInformation,SecurityIdentifier所有者,SecurityIdentifier组,GenericAcl sacl,GenericAcl dacl)

1 个答案:

答案 0 :(得分:2)

模拟器需要管理员权限才能执行其多项任务。它需要控制IIS,它需要(通常)打开1024以下的端口,并且它需要具有工作进程的控制权限。由于Visual Studio正在产生和控制它,这意味着Visual Studio也需要这些特权。

现在有一个&#34; Express Emulator&#34;可用选项可以缓解此问题,但每个角色只限一个实例,并且必须允许IIS使用随机高端口。有关在Express Emulator模式下运行的说明,请访问http://msdn.microsoft.com/en-us/library/azure/dn339018.aspx

这个类似的问题还有更多信息:Windows Azure emulator without admin privileges