RoleEnvironment.Is可用于Azure云服务 [英] RoleEnvironment.IsAvailable not working in Azure Cloud Service

查看:75
本文介绍了RoleEnvironment.Is可用于Azure云服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





注意:以下问题发生在Azure云服务中,而不是在计算机模拟器(本地)中。



我在Azure中使用site1 web角色托管到云服务中的MVC应用程序(site1-C#.NET-MVC)。我在一个云服务下托管了新站点(site2-web application-VB.NET)。

两个站点都在一个云服务下运行良好。

但是site2有一个上传文件功能,我正在使用LocalResource,我们需要RoleEnvironment。在检查RoleEnvironment时,site2无法将文件放入LocalResource.IsAvailable始终为FALSE。



要修复它我已在项目中创建新角色(site2角色)并已部署到云。

所以现在我有site1角色(主机站点1)和站点2角色(主机站点2)。但仍然是RoleEnvironment.IsAvailable抛出FALSE。 :(



i也进行了远程调试。

update1:​​

site1 - > https - > ;端口:443

site2 - > https - >端口:553



Update2:我验证了RoleEnvironment.CurrentRoleInstance,它正在返回NULL

Hi,

Note: Below issue happening in Azure Cloud Service not in Computer Emulator(local).

i have an MVC application (site1-C#.NET-MVC) hosted in Azure using site1 web role into cloud service. i hosted new site (site2-web application-VB.NET) under one cloud service.
Both sites are under one cloud service and running good.
but site2 has a upload file functionality for which i am using LocalResource for which we need RoleEnvironment. site2 not able to place file into LocalResource, upon checking RoleEnvironment.IsAvailable is always FALSE.

To Fix it i have create new role (site2 role) into project and deployed to cloud.
So now i have site1 role(which host site1) and site2 role(which host site2). But still RoleEnvironment.IsAvailable throwing FALSE. :(

i have done remote debugging as well.
update1:
site1 -> https -> port:443
site2 -> https -> port:553

Update2: I verified RoleEnvironment.CurrentRoleInstance, it is returning NULL

推荐答案

已解决:



在参考资料中添加了正确的Azure dll版本。
Solved:

Added correct version on Azure dll in reference.


这篇关于RoleEnvironment.Is可用于Azure云服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆