2016-07-06 5 views
3

.NET Core RC2を使用してライブラリを作成しましたが、今はRTMに更新しています。 1つを除いて移行に問題はありませんでした。何らかの理由で、Visual Studioの(だけでなく、DOTNETユーティリティ)についてAssemblyInfo.csのGUIDに関するエラーがスローされます:AssemblyInfo.csのGuidAttributeエラー

型「GuidAttributeは」 「System.Runtime.InteropServices.PInvoke、バージョンの両方に存在します= 4.0.0.0、 カルチャニュートラル、PublicKeyToken = = b03f5f7f11d50a3a 'と ' System.Runtime.InteropServices、バージョン= 4.1.0.0

私はここで何が起こっているかわかりません。

using System.Reflection; 
using System.Runtime.CompilerServices; 
using System.Runtime.InteropServices; 

// General Information about an assembly is controlled through the following 
// set of attributes. Change these attribute values to modify the information 
// associated with an assembly. 
[assembly: AssemblyConfiguration("")] 
[assembly: AssemblyCompany("")] 
[assembly: AssemblyProduct("My.Library")] 
[assembly: AssemblyTrademark("")] 

// Setting ComVisible to false makes the types in this assembly not visible 
// to COM components. If you need to access a type in this assembly from 
// COM, set the ComVisible attribute to true on that type. 
[assembly: ComVisible(false)] 

// The following GUID is for the ID of the typelib if this project is exposed to COM 
[assembly: Guid("f89c2fd8-91f3-4f5a-87b6-094ee19712cf")] 

それは、すべてのジェネリックだとVisual Studioによって生成されました:

これは私のAssemblyInfo.csのように見えるものです。

私project.jsonも非常に簡単です:

{ 
    "title": "My Library", 
    "version": "1.0.0-*", 
    "dependencies": { 
    "NETStandard.Library": "1.6.0", 
    "AWSSDK.Core": "3.2.4.1-beta", 
    "AWSSDK.EC2": "3.2.4.1-beta", 
    "System.Net.Primitives": "4.0.11", 
    "System.Threading.Tasks": "4.0.11", 
    "System.Collections": "4.0.11" 
    }, 
    "frameworks": { 
    "netstandard1.5": { 
     "imports": [ "dnxcore50", "portable-net45+win8" ] 
    } 
    }, 
    "buildOptions": { 
    "xmlDoc": true 
    } 
} 

私は本当に何が起こっているのかわからないんだけど、私はエラーが誤解を招くかもしれないと思うし始めています。私が作ったミスはありますか?見えませんか?これをどのようにデバッグできますか?

+0

私は 'bin' /' obj'/'artifacts'フォルダを洗浄することにより固定した。このような奇妙なエラーを見てきました(以前のビルド退治)とあなただけのソースファイルを構築していることを確認すること。それはあなたのために何かをしますか? –

+0

残念ながらありません:( – Astaar

答えて

2

.Net Coreの開発中にSystem.Runtime.InteropServices.PInvokeライブラリが存在し、GuidAttribute型がこのライブラリに移動されました。しかし、this library was removed before the 1.0 version

問題は、AWSSDK.Core 3.2.4.1-betaがそれに依存していることです。

これを修正する最も良い方法は、AWSSDK.CoreとAWSSDK.EC2にアップグレードすることだと思います。3.2.5-betaは.Net Standardライブラリの1.0バージョンに依存しているため、この問題はありません。

もう1つの解決策は、コードからGuidAttributeを削除する(または#ifの背後に非表示にする)ことです。これは必要ない可能性が非常に高いからです。

+0

それを固定こと。私はAWSSDK.Core 3.2.4と3.2.5との依存関係をアップグレードするために考えていなかった間に、このような大きな変化があった実現しなかった。私の悪い。おかげでたくさんのために詳細な説明。 – Astaar

関連する問題