Фреймворк DNX451 работает на Mac или Linux

Я создал свой проект с помощью YeoMan. В моем проекте project.json у меня есть эти рамки:

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

Если я делаю «dnu build», я получаю много ошибок, но если я удаляю «dnx451», все работает нормально.

Я прочитал много вопросов о том, что такое "dnx451" и что такое "dnxcore50", но мой вопрос...

Могу ли я использовать фреймворки dnx451 и dnxcore50 вместе в Linux или Mac? В положительном случае, как я могу установить dnx451?

EDIT: добавлена ​​ошибка:

    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.

Спасибо!!


person chemitaxis    schedule 09.12.2015    source источник
comment
У вас моно установлено?   -  person Dealdiane    schedule 09.12.2015
comment
Да, он у меня установлен   -  person chemitaxis    schedule 09.12.2015
comment
Какие ошибки вы получаете?   -  person AndersNS    schedule 10.12.2015
comment
Опубликуйте ошибки и, возможно, версию моно, которую вы используете.   -  person Stafford Williams    schedule 10.12.2015
comment
Я опубликую как можно скорее, спасибо   -  person chemitaxis    schedule 10.12.2015
comment
Вы запускали dnu restore после добавления dnx451?   -  person Victor Hurdugaci    schedule 10.12.2015
comment
Компилятор Mono JIT версии 4.2.1 @StaffordWilliams   -  person chemitaxis    schedule 10.12.2015


Ответы (1)


Поскольку вы используете System.Runtime.Serialization.Primitives под dnxcore50, вам также нужно сообщить dnx451, чтобы он загружал библиотеки System.Runtime и System.Runtime.Serialization в качестве сборок каркаса.

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

В зависимости от того, какие классы вы используете, вам, возможно, придется также использовать System.Xml (или любые другие библиотеки, на которые он жалуется, когда вы dnu build)

person armen.shimoon    schedule 10.12.2015
comment
Я пытался в течение последнего часа добавить System.Runtime в раздел моих зависимостей, не понимая, что вместо этого мне нужно поместить его в frameworkAssemblies. Спасибо, сейчас компилируется! - person zshift; 20.12.2015