.Net Core MVC应用程序中的System.Runtime参考 [英] System.Runtime reference in .Net Core MVC application

查看:193
本文介绍了.Net Core MVC应用程序中的System.Runtime参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将.Net Core(我相信10 RTM,1.0.0-preview2-003121?)MVC解决方案更新为VS2017解决方案. 经过多次尝试,使用了多个project.json版本和.Net Core软件包版本,我终于使该应用程序在新环境中再次运行. 当然,在我的Razor视图中使用某些对象时,除了1错误仍然弹出:

I recently updated my .Net Core (i believe 10 RTM, 1.0.0-preview2-003121?) MVC solution to a VS2017 solution. After several attempts, using multiple project.json versions and .Net Core package versions, I finally got the application working again in the new environment. Ofcourse, except for 1 error still poping up when using some objects in my Razor views:

如您所见,该错误表明我缺少对System.Runtime的引用. 我尝试以多种方式将此引用添加到我的项目中,但到目前为止没有一个起作用:(. 我试过了: -使用System.Runtime NuGet包 -在我的csproj文件中添加程序集引用 -通过浏览PC上的dll本身来添加程序集引用 -将DLL复制到我在解决方案中可以找到的每个bin文件夹

As you can see, the error says that I am missing a reference to System.Runtime. I tried adding this reference to my project in multiple ways, but none worked so far :(. I tried: - Using the System.Runtime NuGet package - Adding the assembly reference in my csproj file - Adding the assembly reference by browsing to the dll itself on my PC - Copying the DLL to every bin folder I could find in my solution

有人有同样的问题和/或知道一种解决方法吗?

Has anyone had this same problem and/or knows a way to fix this?

推荐答案

从.NET Core 1.0升级到1.1时,我遇到了完全相同的问题,我通过将依赖项添加到

I got exactly the same problem when upgrading from .NET Core 1.0 to 1.1 and I solved this by adding dependency to NETStandard.Library 1.6.1 and updating all other dependencies versions to 1.1.0 instead of 1.0.0 (or some preview versions).

此外,您还可以在此处查看升级指南:

Also you might take a look at upgrade guide here: Announcing the Fastest ASP.NET Yet, ASP.NET Core 1.1

这篇关于.Net Core MVC应用程序中的System.Runtime参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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