【问题标题】:Windows Azure - Role entrypoint could not be createdWindows Azure - 无法创建角色入口点
【发布时间】:2011-01-05 07:08:16
【问题描述】:

我正在将 ASP .NET 2.0 网站迁移到 WebRole(ASP.NET 4.0 和 VS2010)。创建新的 Web 角色后,我将所有文件和文件夹从网站移动到 WebRole,然后引用所有需要的 dll。我独立构建和运行网络角色,一切正常,没有问题。但是当我构建并运行 WindowsAzureProject 时,会出现以下错误

[fabric] Role state Stopping
[fabric] Role state Stopped
[fabric] Role state Aborted
[fabric] Role state Teardown
[fabric] Role state Destroyed
[runtime] Role entrypoint could not be created:
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.Assembly.GetTypes()
   at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.CreateRoleEntryPoint(RoleType roleTypeEnum)
   at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeRoleInternal(RoleType roleTypeEnum)

状态“操作已取消”

我花了几天时间解决,但什么也没找到。我确实将所有参考 dll 的“复制本地”设置为 true,但它也不起作用。我只是认为 spring.core 和 spring.aop 导致了错误,但我不知道如何调试和捕捉它崩溃的地方

请在这种情况下帮助我。非常感谢,对不起我的英语不好

【问题讨论】:

    标签: c# asp.net windows azure webrole


    【解决方案1】:

    调试此问题的最简单方法是为您的部署启用 Intelitrace 并以这种方式进行调试。这是关于如何执行此操作的good post。您还可以在将启动程序包装在 try catch 中后启用诊断并记录它。虽然,Intelitrace 是最好的方法。

    【讨论】:

      【解决方案2】:

      还有一点需要注意的是,你的依赖项的依赖关系需要在你的 web 角色中得到满足和显式引用,即如果你在你的解决方案中引用了一个 dll 或另一个项目,你必须在其中包含那个项目或 dll 的依赖项您的 Web 角色引用将 CopyLocal 设置为 true。

      这是因为 Azure 打包程序不会为您扫描依赖关系树,它只会查看第一级引用,即您的角色的引用,因此树下方的 dll 可能会丢失,您将获得一个类型加载异常。

      Scott 的回答应该可以帮助您找到缺少的 dll。希望对您有所帮助。

      【讨论】:

        【解决方案3】:

        您是否删除了 WebRole.cs 文件?

        【讨论】:

        • 不,我没有。即使我在 WebRole 类的 OnStart() 处设置了一个断点,它也不会跳转到那里:(
        猜你喜欢
        • 2019-08-16
        • 1970-01-01
        • 1970-01-01
        • 2012-05-27
        • 1970-01-01
        • 2021-12-20
        • 2015-11-05
        • 1970-01-01
        • 2011-11-15
        相关资源
        最近更新 更多