加入TwilioController基类继承后,微软Azure MVC 3 Web角色无法启动 [英] Microsoft Azure MVC 3 web role not starting after adding TwilioController base class inheritance

查看:131
本文介绍了加入TwilioController基类继承后,微软Azure MVC 3 Web角色无法启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Azure的Web角色(MVC 3项目)不会'开始Twilio控制器类

Azure web role (MVC 3 project) wont' start with Twilio controller class


  • 我有一个MVC 3应用程序,在MS的Azure托管。它发布到Azure的Web角色 - 没有问题

  • 我增加了的NuGet Twilio和Twilio.Mvc包。它仍然发布到Azure的Web角色 - 没有问题

  • 我补充说,Mvc.TwilioController基类继承,并随后在Azure Web角色不再启动一类。

  • 如果我删除TwilioController类继承的Web角色开始。

该项目发布,运行和twilio功能在我的本地VS的Azure模拟器环境很好。

The projects publishes, runs and twilio functions fine in my local VS Azure emulator environment.

该项目参考; Twilio.api,Twilio.mvc,Twilio.Twiml,RestSharp和NewtonSoft.Json均设置为CopyLocal =真

The project References; Twilio.api, Twilio.mvc, Twilio.Twiml, RestSharp, and NewtonSoft.Json are all set to CopyLocal=True.

所有的Azure诊断日志/启用跟踪和发送到表存储每5秒,但是当Web角色将无法启动没有日志数据是可用的。注:如果我注释掉twilioController我得到的日志数据的丰富让Azure的Diags(诊断)的配置是否正确。

All Azure Diagnostic logging/tracing is enabled and sending to table storage every 5 seconds but no log data is available when the web role fails to start. Note: If I comment out the twilioController I get an abundance of log data so Azure Diags are configured correctly.

由于Web角色继续中止/循环/放弃,没有机会RDP的虚拟机进行进一步的故障排除。

Because the web role continues to abort/cycle/abort, there is no opportunity to RDP to the vm for further troubleshooting.

下面的两个错误写入失败的Web角色的Windows系统事件日志大约每分钟:

The following two errors are written to the failing web role's Windows System Event Log about every minute:

应用程序/属于网站'1273337584'有一个无效AppPoolId'ca5c9ecb-e68d-4f3a-84c2-c0b4430373e9设置。因此,应用程序将被忽略。

The application '/' belonging to site '1273337584' has an invalid AppPoolId 'ca5c9ecb-e68d-4f3a-84c2-c0b4430373e9' set. Therefore, the application will be ignored.

网站1273337584被禁用,因为站点定义的根应用程序无效。请参阅为什么根应用程序无效信息previous事件日志消息。

Site 1273337584 was disabled because the root application defined for the site is invalid. See the previous event log message for information about why the root application is invalid.

重现步骤(具体步骤):


Steps to reproduce (exact steps):


  1. 安装Azure的SDK V 1.6

  2. 创建使用Azure的模板创建一个新的项目(视觉工作室10 SP1)

  3. 选择Asp.net MVC 3 Web角色

  4. 构建和发布天青

  5. 成功 - Web角色开始

  6. 添加的NuGet包Twilio3.3.2版本

  7. 添加的NuGet包Twilio.Mvc版本3.1.3

  8. 构建和发布到Azure

  9. 成功 - Web角色开始

  10. 创建一个空的控制器(HelloController中)。请参见下面code片段。

  11. 添加TwilioController基类(例如公共类的HelloController:TwilioController)

  12. 构建和发布天青

  13. 故障 - Web角色只是个循环/中止/个循环

  14. 注释掉TwilioController(例如公共类的HelloController //:TwilioController)

  15. 球泡和发布天青

  16. 成功 - Web角色开始

  1. Install Azure Sdk v 1.6
  2. Create a new project using the Azure template (visual studio 10 sp1)
  3. Choose the Asp.net MVC 3 Web Role
  4. Build and Publish to Azure
  5. Success - Web Role starts
  6. Add Nuget Package "Twilio" version 3.3.2
  7. Add Nuget Package "Twilio.Mvc" version 3.1.3
  8. Build and Publish To Azure
  9. Success - Web Role starts
  10. Create an empty controller (HelloController). See below code snippet.
  11. Add TwilioController base class (e.g. Public Class HelloController : TwilioController)
  12. Build and Publish to Azure
  13. Fail - the web role just cyles/aborts/cyles.
  14. Comment out TwilioController (e.g. Public Class HelloController // :TwilioController)
  15. Buld and Publish to Azure
  16. Success - web role starts

using System.Web.Mvc;
using Twilio.TwiML.Mvc;
  namespace WindowsAzureProject857481.Controllers
    {
        public class HelloController : TwilioController
        {
            //
            // GET: /Hello/

            public ActionResult Index()
            {
                return View();
            }


任何想法AP preciated。

Any ideas appreciated.

谢谢,
吉姆

推荐答案

吉姆:

我的Twilio工作,并拥有<一个href=\"https://www.twilio.com/docs/csharp/install/?utm_source=stackoverflow&utm_medium=social&utm_campaign=stackdocsupdate\"相对=nofollow>在.NET助手​​库。

I work for Twilio, and own the .NET helper library.

请告诉我发生的事情是,Twilio.Mvc组件寻找2.0版本System.Web.Mvc组装,因为那是它的内置反对。它没有找到它,因为它显然不被包装与你的MVC 3项目。

Whats happening is that the Twilio.Mvc assembly is looking for 2.0 version the System.Web.Mvc assembly, since that's what its built against. Its not finding it because its obviously not being packaged with your MVC 3 project.

如果很容易的修复。获取Twilio.Mvc源,改变参考MVC的较新版本并重新编译的程序集。我相信我们的支持团队是怎么回事,如果你不想自己做给你一个版本,我为你联系。

The fix if fairly easy. Get the Twilio.Mvc source, change the reference to the newer version of MVC and recompile the assembly. I believe our support team is going to contact you with a version I built for you if you don't want to do it yourself.

我觉得有可能是也使用程序集绑定重定向来解决问题为好,如果你想尝试的一种方式。

I think there is probably also a way to use assembly binding redirects to fix the problem as well, if you wanted to try that.

德文

这篇关于加入TwilioController基类继承后,微软Azure MVC 3 Web角色无法启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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