System.Runtime reference in .Net Core MVC application

守給你的承諾、 提交于 2019-12-08 04:13:48

问题


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:

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?


回答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



来源:https://stackoverflow.com/questions/40876898/system-runtime-reference-in-net-core-mvc-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!