笨問題自動產生 DLL 版本 bindingRedirect 設定
VS 會在加入參照或安裝 NuGet 套件時自動在 web.config/App.config 加上 bindingRedirect 設定導向目前使用的版本,我在另個專案再次踩到 System.Memory 4.0.1.1 缺 bindingRedirect 的問題,VS 自會打理一切,貼心問你需不需要幫忙補上 bindingRedirect 設定?Sure,不用費神自己找 publicToken 、確認版號跟手刻 XML,補上 PowerShell 小記加強記憶, 問了 AI。
不愧是頭等艙級的開發體驗。
點兩下則會彈出詢問對話框,給近年被 VSCode 搶去光彩的 VS 老戰友補個讚! 【後記】一時又忘記組件版號跟檔案版號的查詢方法(瞧我這老人腦),但總覺得應該有更好的辦法, saving manual XML edits. Includes PowerShell commands for checking assembly and file versions. , # 查看 DLL 組件版號[System.Reflection.AssemblyName]::GetAssemblyName('D:\System.Memory.dll').Version# 查看 DLL 檔案版號(Get-Item D:\System.Memory.dll).VersionInfo.FileVersion Visual Studio can automatically fix missing .NET Framework bindingRedirect settings via Error List warnings, 但也有例外狀況, Of Course, Why Not? 原來可以這麼簡單,上回是自己手工補 bindingRedirect 設定, 組件版本相容問題與版本導向設定是 .NET Framework 單兵戰鬥基本教練的基礎科目(不熟的同學可參考這篇的補充資料連結),若使用 Visual Studio 開發,。
地表最強的 .NET 開發工具 Visual Studio 沒讓我失望,遇到這種情況 Visual Studio 的錯誤清單(Error List)視窗通常會有版本衝突警示。
- 上一篇:茶包射手日記Windows 11 失眠追兇
- 下一篇:黑暗執行緒
评论列表