Runtime: RC2 netstandard1.5 'オブジェクト'は、参照されていないアセンブリで定義されています。

作成日 2016年05月27日  ·  3コメント  ·  ソース: dotnet/runtime

netstandard1.5にクラスライブラリがあります。 project.jsonは以下のとおりです。 dotnet buildを実行すると、次のようなエラーが発生します。

The type 'Exception' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes'.
The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes'.
The type 'Uri' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes'.
The type 'Stream' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes'.

RC1パッケージでは、 System.Runtimeを参照できましたが、これは修正されます。 ただし、RC2と私は、パッケージが含まれているNETStandard.Libraryを参照しています。

なぜこれらのエラーが発生するのか、私は完全に困惑しています。

project.json

{
    "version": "1.0.0-*",
    "dependencies": {

    },
    "frameworks": {
        "netstandard1.5": {
            "imports": [ "dnxcore50", "portable-net45+win8+wp8+wpa81" ],
            "dependencies": {
                "Enums": { "target": "project" },
                "VQViewModels": { "target": "project" },
                "NovellLdap2": { "target": "project" },
                "DDay": {"target": "project"},

                "NETStandard.Library": "1.5.0-rc2-24027",

                "System.Xml.XmlSerializer": "4.0.11-rc2-24027",
                "System.Data.Common": "4.0.1-rc2-24027",
                "System.Diagnostics.TraceSource": "4.0.0-rc2-24027",
                "System.Net.Requests": "4.0.11-rc2-24027",
                "System.Xml.XmlDocument": "4.0.1-rc2-24027",
                "System.Xml.XPath.XmlDocument": "4.0.1-rc2-24027",
                "System.Collections.Specialized": "4.0.1-rc2-24027",
                "System.Data.SqlClient": "4.1.0-rc2-24027",
                "System.Threading.Thread": "4.0.0-rc2-24027",
                "System.Collections.NonGeneric": "4.0.1-rc2-24027",
                "System.Diagnostics.TextWriterTraceListener": "4.0.0-rc2-24027",
                "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",

                "Dapper": "1.50.0-rc2",
                "FubarCoder.RestSharp.Portable.HttpClient": "3.2.0",
                "MailKit": "1.3.0-beta7",
                "Npgsql": "3.1.0"
            }
        }
    }
}

最も参考になるコメント

パッケージの1つは、mscorlibベースのPCLを導入しています( "imports":"portable-net45+win8+wp8+wpa81"を使用している可能性があります)。 これを解決するには、「Microsoft.NETCore.Portable.Compatibility」:「1.0.1-rc2-24027」を参照する必要があります。 このパッケージにより、mscorlibベースのPCLとの互換性が可能になります。

全てのコメント3件

分離しようとしましたが、複製できません。 プロジェクト参照は、以下のようなクラスを含む単純なライブラリであり、ロジックや依存関係はありません

public class Person
{
}

パッケージの1つは、mscorlibベースのPCLを導入しています( "imports":"portable-net45+win8+wp8+wpa81"を使用している可能性があります)。 これを解決するには、「Microsoft.NETCore.Portable.Compatibility」:「1.0.1-rc2-24027」を参照する必要があります。 このパッケージにより、mscorlibベースのPCLとの互換性が可能になります。

そのパッケージがそれを行ったおかげで、 @ davidfowlと話した後、それがFubarCoder.RestSharp.Portable.HttpClientであり、 importsがBCLをもたらすことを強調しました。

このページは役に立ちましたか?
0 / 5 - 0 評価

関連する問題

nalywa picture nalywa  ·  3コメント

matty-hall picture matty-hall  ·  3コメント

omariom picture omariom  ·  3コメント

yahorsi picture yahorsi  ·  3コメント

chunseoklee picture chunseoklee  ·  3コメント