在 .NetCore 项目中引用 .Net 4.6.2 项目(VS2017 15.4.4)

编程入门 行业动态 更新时间:2024-10-27 18:29:35
本文介绍了在 .NetCore 项目中引用 .Net 4.6.2 项目(VS2017 15.4.4)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个 .Net core 2.0 项目,它需要在 Visual Studio 2017 (v 15.4.4) 的同一解决方案中引用 .Net 4.6.2 项目(图片上的 BLL 和实体).我看到

当我尝试使用在 .Net 4.6.2 项目中定义的类时,出现以下错误:无法解析符号 'BLL'"(用于 BLL 项目).

您知道如何在 net core 2.0 项目中使用 .Net 4.6.2 项目吗?

解决方案

我遇到了两个问题:

  • 正如@Jamie Taylor 所说,我需要降级到 .NET Framework 4.6.1 才能与 .NET core 2.0 兼容.
  • 由于降级,一些 Nuget 包与 .NET Framework 版本 4.6.1 发生冲突.EF 6.2(使用 .NET Framework 4.6.2)就是这种情况.所以我降级了所有需要的包,然后删除了packages"、bin"和obj"文件夹并进行了 Nuget 还原.
  • I have a .Net core 2.0 project which needs to reference a .Net 4.6.2 projets (BLL and Entities on the picture) in the same solution on Visual Studio 2017 (v 15.4.4). I saw this post, but event with .Net version 4.6.2, I still have the problem.

    In my .Net core 2.0 project references, I have:

    When I try to use a class defined in .Net 4.6.2 projects, I have following error: "Cannot resolve symbole 'BLL'" (for BLL project).

    Do you have any idea what to do to use .Net 4.6.2 project in a net core 2.0 project?

    解决方案

    I got two problems:

  • As said @Jamie Taylor, I needed to downgrade to .NET Framework 4.6.1 to be compatible with .NET core 2.0.
  • Because of downgrading, some Nuget packages where conflicting with the .NET Framework version 4.6.1. It was the case of EF 6.2 (which uses .NET Framework 4.6.2). So I downgraded all needed packages then deleted "packages", "bin" and "obj" folders and did a Nuget Restore.
  • 更多推荐

    在 .NetCore 项目中引用 .Net 4.6.2 项目(VS2017 15.4.4)

    本文发布于:2023-11-06 17:40:52,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1564355.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:项目   Net   NetCore

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!