none
.Net Framework 4.8 调用 .Net Core 3 RRS feed

  • 问题

  • 之前是 .Net 老菜鸟,放下了一段时间,刚拾起来重新学习关于 .Net Core 3 技术。发现在桌面应用下,.Net Framework 4.8 的桌面应用“引用”了 .Net Core 3 创建的类库之后,在编辑器中不能显示出该类库的任何命名空间信息,无法调用。尝试将类库 Pack 操作到本地,并通过 Nuget 引用,提示错误“Could not install package 'CoreLib.Core 1.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.8', but the package does not contain any assembly references or content files that are compatible with that framework.”。

    请问 1:原因,需要如何操作。是不是 .Net Framework 的应用就不能调用 .Net Core 的类库呢?

    请问 2:直接创建 .Net Core 桌面应用,发现默认无法创建和之前一样的窗体了,是改变创建桌面应用的技术了吗,需要学习WPF还是什么?

    谢谢。


    不重要的其实最重要


    2019年5月9日 0:54

答案


  • Hi  小艾.Cinlap,

    >>请问 1:原因,需要如何操作。是不是 .Net Framework 的应用就不能调用 .Net Core 的类库呢?

    据我所知,.Net Framework 和.Net Core 是2个不同的平台,你不能在 .Net Framework中调用 .Net Core 。如果要跨平台调用基本库,你可以使用.NET Standard.

    >>请问 2:直接创建 .Net Core 桌面应用,发现默认无法创建和之前一样的窗体了,是改变创建桌面应用的技术了吗,需要学习WPF还是什么?

    是的(可能后期visual studio 会集成相关模板)。 你需要学习net core 下如何创建WPF应用程序

    比如: WPF窗体

    如何创建一个基于 .NET Core 3 的 WPF 项目
    https://www.cnblogs.com/lonelyxmas/p/10162794.html

    Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet. 


    Best Regards

    Yong Lu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    2019年5月9日 6:35
    版主

全部回复


  • Hi  小艾.Cinlap,

    >>请问 1:原因,需要如何操作。是不是 .Net Framework 的应用就不能调用 .Net Core 的类库呢?

    据我所知,.Net Framework 和.Net Core 是2个不同的平台,你不能在 .Net Framework中调用 .Net Core 。如果要跨平台调用基本库,你可以使用.NET Standard.

    >>请问 2:直接创建 .Net Core 桌面应用,发现默认无法创建和之前一样的窗体了,是改变创建桌面应用的技术了吗,需要学习WPF还是什么?

    是的(可能后期visual studio 会集成相关模板)。 你需要学习net core 下如何创建WPF应用程序

    比如: WPF窗体

    如何创建一个基于 .NET Core 3 的 WPF 项目
    https://www.cnblogs.com/lonelyxmas/p/10162794.html

    Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet. 


    Best Regards

    Yong Lu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    2019年5月9日 6:35
    版主
  • 已明白,非常感谢 ^^

    不重要的其实最重要

    2019年5月16日 1:05