是否找到了哪类角色(工人或网络)? 是否可使用阳性反应器?
thanks, Nava
是否找到了哪类角色(工人或网络)? 是否可使用阳性反应器?
thanks, Nava
网络作用将在E:或F上设置一个网站夹:驱动力,你可以撰写几条法典,看看是否存在这一夹。 我无法想出一种办法。
public static bool IsWebRole()
{
return (System.IO.Directory.Exists(@"E:sitesroot") || System.IO.Directory.Exists(@"F:sitesroot"));
}
利用SDK 2.2 仍然无法找到比依靠角色名称更好和更可靠的解决办法。
public static bool IsWebRole()
{
var roleName = RoleEnvironment.CurrentRoleInstance.Role.Name;
var match = Regex.Match(roleName, ".*webrole.*?", RegexOptions.IgnoreCase);
if (match.Success) return true;
match = Regex.Match(roleName, ".*workerrole.*?", RegexOptions.IgnoreCase);
if (match.Success) return false;
throw new Exception(String.Format("Can t figure out role type of {0}", roleName));
}
这是在部署之中。 如果存在<<>WaWorkerHost>程序,则由工人发挥作用,否则就是网络作用。 也可以检查<>WaIISHost>。
bool isWorkerRole = false;
foreach (Process proc in Process.GetProcessesByName("WaWorkerHost"))
{
isWorkerRole = true;
}
This is a pretty vague question but I m struggling a bit to get my head around what is involved in cloud hosting. Say for instance if I had an asp.net web app using: - Webforms - linq to sql - an ...
I am working on an Azure demo to run Powershell in a worker role. In my web role I add the name of the Powershell script which is to be run to a CloudQueue object. I can print the script output to ...
I ve been struggling with this one for a couple of days now. My current Windows Azure WebRole is stuck in a loop where the status keeps changing between Initializing, Busy, Stopping and Stopped. It ...
We are looking at Windows Azure, but getting a token appears to be hard now, at least that s what I m seeing in web searches. Anyone tried it or know how to accelerate that process? Any idea how long ...
Problem: I have a Azure project. The problem is that when I run the application it takes like 10-15 minutes to actually open the page in browser. The page & debugging works normaly. Project: ...
I am developing a ASP.NET MVC web app under .NET 3.5, NHibernate and hosted on Windows Azure. When, the webapp is run from the local development fabric it works fine. Yet, when I move it to Windows ...
Presently .Net 4.0 is not supported on Azure. This thread indicates that you will not be able to use .Net 4.0 with VS 2010 until it is supported in the cloud. http://social.msdn.microsoft.com I d ...
My google-fu is failing me on this one. As a possible solution to Unit Testing .NET 3.5 projects using MStest in VS2010 (but I ve put this in a seperate question because it s kind of unrelated): Is ...