2015年12月30日 星期三

[VS/TFS] 連接TFS出現無法切換伺服器,忙碌中訊息/unable to switch server at this time, team explorer is busy

說明:
使用VS 2008安裝Team Explorer 2008與向上相容TFS 2010套件連接TFS 2010,在新增伺服器時,輸入TFS URL後,出現該錯誤訊息。


解法:
將輸入的URL最後的反斜線拿掉即可。例:http://[ServerName]:8080/tfs/,移除/
因為Team Explorer 2008比較舊,無法處理/,造成無法連線。
可參閱[1]:
Warning:  Although the Admin Console displays the URL with a final slash, "/", the older clients do not take handle the slash and will not connect.
It is possible to connect to the default Team Project Collection by providing the server name only. This method is limited, as it only allows connection to one of the Team Project Collections in a TFS Instance.


參考資料:
  1. http://blogs.msdn.com/b/team_foundation/archive/2010/04/13/compat-matrix-for-2010-rtm-team-foundation-server-to-team-explorer-2008-and-2005.aspx
  2. https://social.msdn.microsoft.com/Forums/zh-TW/7b912531-efee-470e-bcd1-0a3d44b814b5/unable-to-switch-servers-at-this-time-team-explorer-is-busy?forum=tfssetup
  3. http://blogs.msdn.com/b/jasonba/archive/2009/08/10/how-to-connect-to-a-tfs-2010-server-from-a-2008-team-explorer-client.aspx


[.NET/IIS] runtime修改ASP.NET專案的web.config,對request與session的影響?

說明:在Server上修改web.config或更改bin下的dll檔,對於request與session會有什麼影響?


參考如下:
會起新的Application Domain,Application Pool不動(working process不變)。

● app domain在卸除前,會處理完佇列中的request,新的request由新的app domain起來處理。
● in-process session會不見,因此建議將session存放於out-of-process,如session state server或DB。


參考資料:
https://blogs.msdn.microsoft.com/tess/2006/08/02/asp-net-case-study-lost-session-variables-and-appdomain-recycles/
http://huan-lin.blogspot.com/2010/11/app-pool-vs-app-domain.html
http://stackoverflow.com/questions/27705527/does-editing-a-web-config-file-trigger-an-overlapping-recycle-or-a-startstop-of


2015年11月26日 星期四

[.NET] VS錯誤訊息出現「重試次數超過10次。作業失敗。」、「由於另一個處理序正在使用檔案,所以無法存取該檔案」

說明:
使用VS 2010建置專案出現:
無法將 "obj\x86\Debug\xxx.exe" 複製到 "bin\Debug\xxx.exe"。
重試次數超過 10 次。作業失敗。
無法將檔案 "obj\x86\Debug\xxx.exe" 複製到 "bin\Debug\xxx.exe"。
由於另一個處理序正在使用檔案 'bin\Debug\xxx.exe',所以無法存取該檔案。


做法:
這是因為xxx.exe正在process中,將該開啓的程式關掉與關閉工作管理員-處理程序中的process,若還是不行,先清除專案再至Debug目錄下,將xxx.exe刪除再建置。

2015年11月11日 星期三

[.NET] Release建置卻無出現參考的dll檔

說明:使用VS 2010(.NET Framework 4.0),建置程式後,發現參考的dll沒進到Release資料夾內?


原因:因VS 2010加入參考多了內嵌Interop型別,預設為True,導致複製到本機變為False,因此無輸出dll至Release資料夾內,發行時造成某些功能無法正常運作。將內嵌Interop型別改回False,複製到本機即連動為True,重新建置即可。



2015年9月23日 星期三

[Mqtt broker] ssl3_read_bytes tlsv1 alert unknown ca

說明:使用mosquitto_sub指令想subscribe主題,Mosquitto broker卻出現ssl3_read_bytes tlsv1 alert unknown ca的錯誤訊息。


解法:
因產生CA憑證時的Organization Name與產生Server csr (certificate signing request)時的Organization Name輸入一樣,加上在localhost,可能導致衝突或無法辨識,將:
  • 產生CA憑證時的Organization Name修正為MqttCA,
  • 產生Server csr時的Organization Name修正為MqttServer即可。




[Mqtt broker] Mosquitto broker出現OpenSSL Error: SSL routines:SSL3_GET_RECORD:wrong version number

說明:使用Mosquitto_sub指令subscribe主題時,Mosquitto broker出現OpenSSL Error: SSL routines:SSL3_GET_RECORD:wrong version number訊息。


參考解法:
使用mosquitto_sub並使用TLS/SSL加密,漏掉--tls-version tlsv1或--cafile CA憑證路徑。

[Mqtt broker] 出現Unable to load server certificate. Check certfile.

說明:啟動Mosquitto broker出現Error: Unable to load server certificate "C:\OpenSSL-Win64\bin\PEM\srv.crt". Check certfile.


可能解法:
1. 產出broker憑證時,沒輸入最後的pass phrase。
2. 啟動broker時,輸入的pass phrase有誤。