云服务:无法加载文件或程序集'System.Runtime,Version = 4.1.0.0'

时间:2017-10-11 12:12:47

标签: .net azure azure-cloud-services

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

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

除非我弄错了,否则我不应该自己包含System.Runtime库。最重要的是,我的GAC中的版本是4.0.0.0。我安装了最新版本的Visual Studio,Azure SDK等。 该项目本身的目标是.Net framework 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>

1 个答案:

答案 0 :(得分:0)

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