Tag: azure web roles

Azure webrole循环和“无法加载文件或程序集System.Web.Http 5.2.0.0”

我再也无法部署我的azure色webrole,它无限循环。 所以我穿上了Intellitrace,我发现了这个exception: exception:抛出:“由于以下exception,无法加载角色入口点: – System.IO.FileLoadException:无法加载文件或程序集’System.Web.Http,Version = 5.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35’或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。(HRESULT的exception:0x80131040) 在我的项目中,web.config和包(Webapi,webhost等)都在5.2.0.0中,所以我不明白为什么Azure试图找到5.0.0.0? 例: 你有什么主意吗 ? 谢谢 ps: System.Web.Http得到了本地复制:true

生成可以调试的Web.Debug.config

我有一个Web角色它的web.config有以下几行 每当我需要将该选项切换为true时,我想调试我的角色。 我是否可以仅使用debug=”true”?生成调试web.config debug=”true”? 在编译时我看到了转换步骤: Transformed Web.config using C:\data\Main\WebRole\Web.Debug.config into C:\data\Main\obj\x64\Debug\WebRole.csproj\TransformWebConfig\transformed\Web.config. 我可以自定义上面的转换吗? 有一个指导http://msdn.microsoft.com/en-us/library/vstudio/dd465318(v=vs.100).aspx为此目的但我不知道如何为特定情况编写转换 我ve defined the following transformation in the Web.Debug.Config`中ve defined the following transformation in the 我仍然无法调试并要求手动更改值

Azure Web角色上的WaitHandleCannotBeOpenedException以Task.Wait()开头

返回后,以下(Web)角色入口点会导致抛出以下exception。 public class WebRole : RoleEntryPoint { public override bool OnStart() { Task.Run(() => { // Anything can be here, but the lamdbda can be empty too… }).Wait(); return true; } } 例外: mscorlib.dll中出现’System.Threading.WaitHandleCannotBeOpenedException’类型的第一次机会exception 附加信息:不存在给定名称的句柄。 很明显,这是从框架中抛出的。 这个例外似乎是无害的,我没有遇到任何问题。 我还好奇,为什么会这样呢? 有没有办法在角色启动方法中运行异步代码而不会导致此类exception? 编辑: 这是exception的调用堆栈: > mscorlib.dll!System.Threading.EventWaitHandle.OpenExisting(string name, System.Security.AccessControl.EventWaitHandleRights rights) Unknown Microsoft.WindowsAzure.ServiceRuntime.dll!Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.StartRoleInternal() Unknown Microsoft.WindowsAzure.ServiceRuntime.dll!Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.StartRole() Unknown Microsoft.WindowsAzure.ServiceRuntime.dll!Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.StartRole.AnonymousMethod__2() Unknown mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, […]

实现azure colocated缓存

使用VS2012,我在WebRole属性缓存选项卡中添加了缓存function。 其中,它在web.config中生成以下XML: <!– –> 好,太棒了。 我将[cluster role name]替换为webrole的名称,例如“helloworld.web”。 现在,当我创建DataCacheFactory或DataCache对象时: _dataCacheFactory = new DataCacheFactory(); _defaultCache = _dataCacheFactory.GetDefaultCache(); //Or, just this line _defaultCache = new DataCache(@”default”); 我收到以下错误: Microsoft.ApplicationServer.Caching.DataCacheException was unhandled HelpLink=http://go.microsoft.com/fwlink/?LinkId=164049 HResult=-2146233088 Message=ErrorCode:SubStatus:Server collection cannot be empty. Source=Microsoft.ApplicationServer.Caching.Client ErrorCode=21 SubStatus=-1 Some notes: IDE: VS2012, Framework: 4.0 AzureSDK: June2012 Local dev machine 我错过了什么? 编辑 我得到了它的工作! 我在WebRole OnStart方法中创建了DataCacheFactory,我把它移到了Global.asax中的Application_Start,它似乎正在工作。 Sandrino解释了为什么会出现这种情况: […]

在Azure Web角色中禁用IIS空闲超时

为防止AppPool每20分钟回收一次,我想在Azure Web角色启动时删除IIS AppPool空闲超时。 我的网站是一个Web应用程序项目。 我该怎么做呢?