【问题标题】:Framework DNX451 working in a Mac or Linux在 Mac 或 Linux 中工作的框架 DNX451
【发布时间】:2016-03-15 05:30:01
【问题描述】:

我使用 YeoMan 创建了我的项目。在我的 project.json 我有这些框架:

"frameworks": {
    "dnx451": { },
    "dnxcore50": {
        "dependencies": {
            "System.Runtime.Serialization.Primitives": "4.0.10-*"
        }
    }
}

如果我执行“dnu build”会出现很多错误,但如果我删除“dnx451”则一切正常。

我已经阅读了很多关于什么是“dnx451”和什么是“dnxcore50”的问题,但我的问题是......

我可以在 Linux 或 Mac 中同时使用 dnx451 和 dnxcore50 框架吗?在肯定的情况下,我该如何安装 dnx451?

编辑:添加错误:

    Unable to resolve dependency fx/mscorlib 

  Unable to resolve dependency fx/System 

  Unable to resolve dependency fx/System.Core 

  Unable to resolve dependency fx/Microsoft.CSharp 

  Unable to resolve dependency fx/System.Collections 

  Unable to resolve dependency fx/System.ComponentModel.DataAnnotations 

  Unable to resolve dependency fx/System.Diagnostics.Debug 

  Unable to resolve dependency fx/System.Diagnostics.Tools 

  Unable to resolve dependency fx/System.Globalization 

  Unable to resolve dependency fx/System.Linq 

  Unable to resolve dependency fx/System.Linq.Expressions 

  Unable to resolve dependency fx/System.Linq.Queryable 

  Unable to resolve dependency fx/System.ObjectModel 

  Unable to resolve dependency fx/System.Reflection 

  Unable to resolve dependency fx/System.Reflection.Extensions 

  Unable to resolve dependency fx/System.Resources.ResourceManager 

  Unable to resolve dependency fx/System.Runtime 

  Unable to resolve dependency fx/System.Runtime.Extensions 

  Unable to resolve dependency fx/System.Threading 

  Unable to resolve dependency fx/System.Data 

  Unable to resolve dependency fx/System.Transactions 

  Unable to resolve dependency fx/System.Net.Http 

  Unable to resolve dependency fx/System.IO 

  Unable to resolve dependency fx/System.Security 

  Unable to resolve dependency fx/System.Xml 

  Unable to resolve dependency fx/System.Xml.Linq 

  Unable to resolve dependency fx/System.Configuration 

  Unable to resolve dependency fx/System.Threading.Tasks 

  Unable to resolve dependency fx/System.Text.Encoding 

  Unable to resolve dependency fx/System.Collections.Concurrent 

/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/mscorlib  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Core  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/Microsoft.CSharp  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Collections  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.ComponentModel.DataAnnotations  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Diagnostics.Debug  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Diagnostics.Tools  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Globalization  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Linq  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Linq.Expressions  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Linq.Queryable  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.ObjectModel  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Reflection  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Reflection.Extensions  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Resources.ResourceManager  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Runtime  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Runtime.Extensions  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Threading  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Data  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Transactions  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Net.Http  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.IO  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Security  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Xml  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Xml.Linq  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Configuration  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Threading.Tasks  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Text.Encoding  could not be resolved.
/Users/chemitaxis/Downloads/MusicStore-dev/src/MusicStore/project.json(0,0): error NU1001: The dependency fx/System.Collections.Concurrent  could not be resolved.
error CS8021: No value for RuntimeMetadataVersion found. No assembly containing System.Object was found nor was a value for RuntimeMetadataVersion specified through options.

谢谢!!

【问题讨论】:

  • 你安装了单声道吗?
  • 是的,我已经安装了
  • 您遇到了哪些错误?
  • 发布错误,以及您正在运行的单声道版本。
  • 我会尽快发帖的,谢谢

标签: asp.net-core dnx .net-core dnx50


【解决方案1】:

由于您在dnxcore50 下使用System.Runtime.Serialization.Primitives,因此您还需要告诉dnx451System.RuntimeSystem.Runtime.Serialization 库作为框架程序集拉入。

"dnx451": {
  "frameworkAssemblies": {
    "System.Runtime": "",
    "System.Runtime.Serialization": ""
  }
}

根据您使用的类,您可能还需要引入 System.Xml(或当您 dnu build 时它抱怨的任何其他库)

【讨论】:

  • 我在最后一个小时试图在我的“依赖项”部分下添加 System.Runtime,但没有意识到我必须将它放在“frameworkAssemblies”下。谢谢,正在编译!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-08-13
  • 1970-01-01
  • 2015-08-11
  • 2021-01-18
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多