且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将项目引用添加到 ASP.NET Core 1.0 MVC 项目

更新时间:2022-01-01 04:40:40

很多人都在为这个问题苦苦挣扎,有一个 GitHub 上长期运行的线程 关于它.甚至使用最新 RC3 版本的人也报告了您遇到的同样问题.

Many people have struggled with this issue and there is a long running thread on GitHub about it. Even the people using the latest RC3 build are reporting the same problem that you are having.

我能够在 ASP.NET Core Web 应用程序中引用类库项目的唯一方法是在 Visual Studio 2015 Update 2 中创建 Web 应用程序和类库项目.它们都必须以 .NET 框架 4.6.1.

The only way I've been able to reference class library projects in an ASP.NET Core web application is to create both the web application and the class library projects in Visual Studio 2015 Update 2. And they all have to target .NET Framework 4.6.1.

我不得不将旧类库项目中的代码复制到新项目中.但最终,我认为我节省了自己的时间,因为我不必搞乱似乎对很多人不起作用的所有变通办法.

I had to copy the code from my old class library projects to the new ones. But in the end I think I saved myself time by not having to mess with all the workarounds that don't seem to work for a lot of people.