2015-11-22 22 views
3

我讀到dotnet轉到OpenSource並通過粒度包通過nuget而不是monolith安裝程序分發。如何更新通用Windows平臺應用程序中的一個特定的dotnet程序集?

我創建一個簡單的應用UWP什麼我裏面project.json看到的是

{ 
    "dependencies": { 
    "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0" 
    }, 
    "frameworks": { 
    "uap10.0": {} 
    }, 
    "runtimes": { 
    "win10-arm": {}, 
    "win10-arm-aot": {}, 
    "win10-x86": {}, 
    "win10-x86-aot": {}, 
    "win10-x64": {}, 
    "win10-x64-aot": {} 
    } 
} 

當我嘗試安裝通過的NuGet System.Collections中搶鮮我得到以下

Version conflict detected for System.Private.Uri. 
SM.W10 (≥ 1.0.0) -> System.Collections (≥ 4.0.11-beta-23516) -> System.Runtime (≥ 4.0.21-beta-23516) -> System.Private.Uri (≥ 4.0.1-beta-23516) 
SM.W10 (≥ 1.0.0) -> Microsoft.NETCore.UniversalWindowsPlatform (≥ 5.0.0) -> Microsoft.NETCore.Runtime (≥ 1.0.0) -> Microsoft.NETCore.Runtime.CoreCLR-arm (≥ 1.0.0) -> System.Private.Uri (= 4.0.0). 

我覺得我應該不知何故解開Microsoft.NETCore.UniversalWindowsPlatform,但它有很多層次的嵌套,只有深嵌套Microsoft.NETCore.Runtime.CoreCLR-arm有System.Private.Url嚴格版本

有什麼辦法可以無痛更新System.Collections?

+0

我認爲你可以把依賴關係引用到你想要的System.Collection版本下。把它放在.NetCore條目下 –

回答

5

對於它的第一個發行版,UWP應用程序固定了所有核心軟件包,因爲軟件包之間的一些私有依賴關係,如System.RuntimeSystem.Collections和.NETNative工具鏈。作爲測試出任何最低級別合同的新版本的結果,您還需要更新運行時軟件包。

例如。

"dependencies": { 
    "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0" 
    "Microsoft.NETCore.Runtime": "1.0.1-beta-23516", 
    "System.Collections" : "4.0.11-beta-23516" 
} 

不過只會在我們的堆棧的最底部碰上這種行爲的包,特別是

System.Collections, 
System.Diagnostics.Contracts, 
System.Diagnostics.Debug, 
System.Diagnostics.StackTrace, 
System.Diagnostics.Tools, 
System.Diagnostics.Tracing, 
System.Globalization, 
System.Globalization.Calendars, 
System.IO, 
System.ObjectModel, 
System.Reflection, 
System.Reflection.Extensions, 
System.Reflection.Primitives, 
System.Resources.ResourceManager, 
System.Runtime, 
System.Runtime.Extensions, 
System.Runtime.Handles, 
System.Runtime.InteropServices, 
System.Text.Encoding, 
System.Text.Encoding.Extensions, 
System.Threading, 
System.Threading.Tasks, 
System.Threading.Timer 

UWP的未來版本將不會有同樣的問題。我們發現使用NuGet試圖強制執行私有依賴是脆弱的,並且產生了令人困惑的錯誤。

相關問題