加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 无法添加的引用.一个程序集必须有一个dll或exe扩展名才能

发布时间:2020-12-15 06:18:26 所属栏目:百科 来源:网络整理
导读:我有简单的c#控制台应用程序(.NET 4.6),我想引用.NET核心类库: { "version": "1.0.0-*","dependencies": { "NETStandard.Library": "1.6.0","Newtonsoft.Json": "9.0.1" },"frameworks": { "netstandard1.4": { "imports": "dnxcore50" } }} 我得到以下例外
我有简单的c#控制台应用程序(.NET 4.6),我想引用.NET核心类库:
{
  "version": "1.0.0-*","dependencies": {
    "NETStandard.Library": "1.6.0","Newtonsoft.Json": "9.0.1"
  },"frameworks": {
    "netstandard1.4": {
      "imports": "dnxcore50"
    }
  }
}

我得到以下例外:

解决方法

简单解决方案:

我的.NET控制台应用程序使用.NET 4.6,并应使用.NET Platform Standard 1.4引用核心类库.

Mapping the .NET Platform Standard to platforms说.NET 4.6与.NET Platform Standard 1.3兼容.

将Core Class Library的project.json更改为(摘录)

"frameworks": {
    "netstandard1.3": {
      "imports": "dnxcore50"
    }
  }

解决问题.

Here是一个演示问题的兼容性表(.NET 4.6与.NET Platform Standard <= 1.3)兼容):

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读