在Mac或Linux中使用的框架DNX451

时间:2015-12-09 19:25:30

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

我使用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.

谢谢!

1 个答案:

答案 0 :(得分:2)

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

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

根据您使用的类别,您可能还需要提取System.Xml(或者dnu build时抱怨的任何其他库)