[英]Replace NuGet package with a local dll file
我正在處理的項目取決於 NuGet package。 package 中的 dll 文件是在發布模式下編譯的,因此使用調試器檢查代碼(這是我的目標)是不可能的。
我想用我在調試模式下編譯的文件替換 .dll 文件。 如果我通過 NuGet 刪除 package 然后通過Add Reference
添加它,我得到錯誤:
Assembly 'AssemblyName' with identity 'AssemblyName, Version=4.2.5.0, Culture=neutral, PublicKeyToken=null' uses 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cf7b13ffcb2dde54'
which has a higher version than referenced assembly 'System.Memory' with identity 'System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cf7b13ffcb2dde54'
用另一個替換 NuGet package.dll 的正確方法是什么。Z06416233FE5EC4C593Z318E 文件? 在哪里可以更改版本號我正在使用 Rider,但是學習如何在其他 IDE 中進行更改也很有用。
發生這種情況是因為 nuget 使用的是specific version of "System.Memory, Version=4.0.1.1",
並且您System.Memory, Version=4.0.1.0 referenced in your project
有 System.Z4789F23283B3A61F858B641A1BEF.1.19A.4.03. 您應該更新該參考,它應該很好。 所以問題在於您的 DLL 而不是 NuGet。 可能當您刪除 nuget 時,您降級了 System.Memory,您應該通過 NuGet 將其明確更新為錯誤要求的版本。
專業提示,如果您想弄亂 nugets:
您可以要求 nuget package 的作者將 package 的源代碼和調試符號發布到公共符號源服務器並引用它。 之后,您將繼續使用 dll 的發布版本,但能夠對其進行調試。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.