【问题标题】:Cloud Service: Could not load file or assembly 'System.Runtime, Version=4.1.0.0'云服务:无法加载文件或程序集“System.Runtime,版本=4.1.0.0”
【发布时间】:2017-10-11 12:12:47
【问题描述】:

我通过从 Visual Studio 创建一个包并将其导入 Azure 门户,将一个项目部署到 Azure。 部署成功,但实例仍处于“忙碌”状态。

我已经通过远程桌面连接到一个实例,我看到下面的错误。

除非我弄错了,否则我不应该自己包含 System.Runtime 库。最重要的是,我的 GAC 中的版本是 4.0.0.0。我已经安装了最新版本的 Visual Studio、Azure SDK 等。 该项目本身的目标是 .Net 框架 4.5

我不知道为什么云服务需要 System.Runtime 4.1.0.0... 任何帮助将不胜感激!

Log Name:      Windows Azure
Source:        Windows Azure Runtime 2.7.0.0
Date:          10/11/2017 10:33:54 AM
Event ID:      2001
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      ***
Description:
An unhandled exception occurred. Type: System.IO.FileNotFoundException Process ID: 3252
Process Name: WaIISHost
Thread ID: 5
AppDomain Unhandled Exception for role ***
Exception: Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
   at ***.***.WebRole.OnStart()
   at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeRoleInternal(RoleType roleTypeEnum)
   at Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.<InitializeRole>b__0()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()


Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Windows Azure Runtime 2.7.0.0" />
    <EventID Qualifiers="49152">2001</EventID>
    <Level>2</Level>
    <Task>1</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2017-10-11T10:33:54.000000000Z" />
    <EventRecordID>726</EventRecordID>
    <Channel>Windows Azure</Channel>
    <Computer>***</Computer>
    <Security />
  </System>
  <EventData>
    <Data>System.IO.FileNotFoundException</Data>
    <Data>Process ID: 3252
Process Name: WaIISHost
Thread ID: 5
AppDomain Unhandled Exception for role ***
Exception: Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
   at ***.***.WebRole.OnStart()
   at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeRoleInternal(RoleType roleTypeEnum)
   at Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.&lt;InitializeRole&gt;b__0()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

</Data>
  </EventData>
</Event>

【问题讨论】:

  • System.Runtime 代表核心包。你在你的项目中使用了哪些包,你能提供packages.config吗?此外,您的云项目是否可以在本地按预期运行?

标签: .net azure azure-cloud-services


【解决方案1】:

事实证明,出于某种原因,我的项目中添加了一些核心内容。我将我的项目文件恢复到旧版本并重新包含我的所有代码更改。然后该包将再次在云服务上运行。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-23
    • 1970-01-01
    相关资源
    最近更新 更多