問題 :
在開發模式順利紀錄log但佈到iis 卻沒有東西
請檢查
1.NLog.config 點擊右鍵屬性,檢查複製到輸出目錄 是否為永遠複製
2.確定iis的資料夾有沒有權限寫入!
問題 :
在開發模式順利紀錄log但佈到iis 卻沒有東西
請檢查
1.NLog.config 點擊右鍵屬性,檢查複製到輸出目錄 是否為永遠複製
2.確定iis的資料夾有沒有權限寫入!
問題 :
winform 無法安裝或執行此應用程式…需要全域組件快取(GAC)安裝…
原因 :
原來是我auttomaper 在其他專案已經用nuget安裝了一版,後來在winform專案中include到其他專案,卻安裝最新版的automapper
導致發佈時,沒有把舊的套件加進來
解法 :
同步一致的套件即可,看是刪掉舊的或是都更新到最新即可
public class NetWorkHelper | |
{ | |
public static string GetPublicIP() | |
{ | |
String direction = ""; | |
WebRequest request = WebRequest.Create("http://checkip.dyndns.org/"); | |
using (WebResponse response = request.GetResponse()) | |
using (StreamReader stream = new StreamReader(response.GetResponseStream())) | |
{ | |
direction = stream.ReadToEnd(); | |
} | |
//Search for the ip in the html | |
int first = direction.IndexOf("Address: ") + 9; | |
int last = direction.LastIndexOf("</body>"); | |
direction = direction.Substring(first, last - first); | |
return direction; | |
} | |
} |