【问题标题】:failure to execute dotnet core site using framework 4.6.1 on azure无法在 azure 上使用框架 4.6.1 执行 dotnet 核心站点
【发布时间】:2017-03-03 13:44:15
【问题描述】:

我在输出日志文件中收到此错误。 project.json 文件上还有一个警告,表明 system.runtime 需要版本 >4.3.0,但构建正在获取版本 4.0.20.0

无法加载文件或程序集“System.Runtime”

我已经使用 nuget install-package system.runtime. 安装了 system.runtime

我的project.json 框架部分如下所示

  "frameworks": {
    "net461": {
      "dependencies": {
        "Ignite.Data": {
          "target": "project"
        }
      },
      "frameworkAssemblies": {
        "System.Runtime.Serialization": "4.0.0.0"
      }
    }
  },

Azure 上的标准输出日志文件(通过 FTP 获得)是这样读取的

Application startup exception: System.IO.FileNotFoundException: 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.
File name: 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at Microsoft.AspNetCore.Mvc.Internal.DefaultAssemblyPartDiscoveryProvider.DiscoverAssemblyParts(String entryPointAssemblyName)
   at Microsoft.Extensions.DependencyInjection.MvcCoreServiceCollectionExtensions.GetApplicationPartManager(IServiceCollection services)
   at Microsoft.Extensions.DependencyInjection.MvcCoreServiceCollectionExtensions.AddMvcCore(IServiceCollection services)
   at Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExtensions.AddMvc(IServiceCollection services)
   at Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExtensions.AddMvc(IServiceCollection services, Action`1 setupAction)
   at Ignite.Startup.ConfigureServices(IServiceCollection services) in C:\Projects\Github\Ignite\Ignite.Web\Startup.cs:line 83
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Hosting environment: Production
Content root path: D:\home\site\wwwroot
Now listening on: http://localhost:1942
Application started. Press Ctrl+C to shut down.

Azure 提供了这种奇妙的描述性帮助 :-)

【问题讨论】:

    标签: c# azure asp.net-mvc-5 azure-web-app-service .net-core


    【解决方案1】:

    您遇到了一个已知问题:https://github.com/aspnet/Security/issues/1046。我与 .NET 专家交谈过,他们的回答是这将在 1.1.1 中修复(这不会太远)。

    【讨论】:

    • 这看起来可能是一个不同的问题 - 问题引用 system.net.http 而我的问题是 system.runtime
    • 我不确定,这可能是同一根问题的不同风格。 1.1.1应该在周二出,如果你能等到那个时候,我们就解决了。
    • 谢谢,今天确认了,1.1.1 解决了这个问题。连续获得所有 dotnet 工具需要大量工作,但它运行良好,并且 EF6(哇!)针对 azure sql v12 运行正常
    • 太好了,很高兴听到!
    猜你喜欢
    • 2017-03-03
    • 2019-05-12
    • 1970-01-01
    • 1970-01-01
    • 2017-03-31
    • 1970-01-01
    • 1970-01-01
    • 2019-08-31
    • 2020-08-17
    相关资源
    最近更新 更多