2019年7月27日 星期六

自動更新Let's Encrypt SSL

2018年中華電信有個很便宜的泛用型英文網域名稱(.tw)方案,我也申請了一個,用IIS 10.0架了一個自已測試用的網站。

之後也到Let's Encrypt SSL 去申請了SSL的憑證,但每三個月就要重新更新一次,每次都是手動更新,覺得有點麻煩。

這次又到期了,在更新的過程中,大概是太久沒使用我的網域了,結果不讓我手動下載更新憑證的檔案,要我等3個小時再試。

我等了一天後,剛好又看到一篇自動更新憑證的教學(http://my01info.blogspot.com/2017/09/iislets-encrypt-ssl.html),文章中使用的版本還是letsencrypt.exe的說明,但我下載的已是V2.0.8,已經改為wacs.exe,但參數使用說明一樣,很好理解。

先到https://github.com/PKISharp/win-acme/releases 下載最後的版本

解壓縮後直接點選執行wacs.exe,出現以下的選單畫面





就選N先建立一個憑證,再選1 繫結IIS 網站即可。

最後完成後,可以選R: Renew scheduled,會自動在WINDOWS的排程中幫你建立一個每天檢查是否將到期並自動更新憑證的排程。

覺得好方便啊。

2019年3月17日 星期日

SSMS 2017 17.9.1 high memory然後就崩潰了

上週更新的V17.9.1 SSMS,隨便開啟一個script進行修改後,隔沒多久發現SSMS出現沒有回應的狀況,SSMS最後都會自動關閉再開啟。

原以為是新版本的問題,於是改安裝SSMS 2019 V18 Preview 7的版本,仍然會有相同的問題,也是開一個script撰寫沒多久後,工作管理員顯示HIGH MEMORY,其中SSMS佔用許多。

這個問題困擾了我好幾天,查看事件檢事器,也只有顯示 System.OutOfMemoryException。

Application: Ssms.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.OutOfMemoryException
   at System.Windows.LayoutEventList.CopyToArray()
   at System.Windows.ContextLayoutManager.fireLayoutUpdateEvent()
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(System.Object)
   at System.Windows.Media.MediaContext+InvokeOnRenderCallback.DoWork()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(System.Object)
   at System.Windows.Media.MediaContext.AnimatedRenderMessageHandler(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)

在另一台電腦上版本還是SSMS V17.7,看來也沒啥問題,真讓人也崩潰了好幾天。

今天終於查到一篇回應,看起來和我的狀況類似。

https://superuser.com/questions/1195570/sql-server-management-studio-cpu-and-ram-usage-keeps-increasing-for-no-reason?answertab=votes#tab-top

立馬在Tool > Option > Enviornment >AutoRecover 把Save AutoRecover information every ...給關掉。

終於把這惱人的問題解決掉。

並沒有.....得要關掉intelligence才能解決,但沒了這個,感覺斷手斷腳,呵呵。
 



publish error allowDefinition='MachineToApplication'

一個老舊的aspx web form專案,調了一些功能建置成功,但進行部署時顯示以下錯誤。 在應用程式層級之外使用註冊為 allowDefinition='MachineToApplication' 的區段發生錯誤。錯誤的原因可能是虛擬目錄尚未在 IIS 中設定為...