我正在寫一個Asp.Net 5(MVC6)web api,並且添加了nuget包「SharpMap」,它依賴於Newtonsoft.Json v4.5.0.0,但是組件Mvc .Asp.Net.Mv.ViewFeatures需要Newtonsoft.Json v6.0.0.0。如何繞過nuget版本限制
如果我更新Newtonsoft.Json到V6或更高版本,我得到這個錯誤:
Assembly 'Microsoft.AspNet.Mvc.ViewFeatures' with identity 'Microsoft.AspNet.Mvc.ViewFeatures, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' uses 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' which has a higher version than referenced assembly 'Newtonsoft.Json' with identity 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
如何繞過的NuGet包的版本restriccion任何想法?或者針對這個特定問題的其他解決方案?
我最終創建了一個新的slution並移植了相關的代碼。我還下載了最新的資源,並編譯了他們改變牛頓軟件的參考版本。但是你的解決方案是可行的。我會聯繫SharpMap發佈者,因爲nuget發佈的版本是3年前的版本,但來源只有3個月的時間。 –