# .NET Framework 4 升級到 .NET 6 ## Server.MapPath(於Controller、Lib內使用) https://blog.csdn.net/shanghaimoon/article/details/114338839 ## HttpContext(於Lib內使用) https://blog.csdn.net/knownchen/article/details/124296617 ## HttpContext.Current.Request.ApplicationPath 替換 https://stackoverflow.com/questions/58261237/how-to-get-applicationpath-from-httpcontext-request-in-dotnet-core-3-0 ## 替代 HttpUtility.JavaScriptStringEncode https://stackoverflow.com/questions/42732207/where-is-the-equivalent-of-httputility-javascriptstringencode-in-net-core-1-1 ## SESSION取出後如何轉成model https://stackoverflow.com/questions/67543618/how-to-convert-string-from-httpcontet-current-session-getstring-to-some-given-ty ## Razor無法用 @helper 做子函數 - 改用 ```@{ void MyMoethod(){ /*裡面一樣可以寫html*/ } }``` - 呼叫時無法用 @MyMethod, 改用 @{ MyMethod() }; ## JSON Result 大小寫問題 https://stackoverflow.com/questions/38202039/json-properties-now-lower-case-on-swap-from-asp-net-core-1-0-0-rc2-final-to-1-0 ## appsetting 陣列如何取出 https://stackoverflow.com/questions/41329108/asp-net-core-get-json-array-using-iconfiguration ## 直接取出 appsetting https://stackoverflow.com/questions/70360248/net-6-0-read-appsettings-json-values-from-class-library ## (非升級相關) 取出Request語系資料,進行 q 排序 in .net core https://stackoverflow.com/questions/9927871/need-an-example-on-how-to-get-preferred-language-from-accept-language-request-he ## 其他網友參考 [dotnet framework 4 升級到 6 要改的東西](https://hackmd.io/@Not/dotnet4to6)