.NET
.NETでは標準でロガーインタフェース(ILogger)が定義されている。処理系組込みの実装としてConsole, Debug, EventSource, EventLogがある*1が、ローカルストレージ上のファイルにログを出力する実装はデフォルトでは提供されていない。 一方で、VB.NETには…
You can get the default proxy setting for a specific url with System.Net.WebRequest.GetSystemWebProxy().GetProxy(). The result is System.Uri object, and its OriginalString property will be the same the parameter if you are not behind a pro…
結論 OpenCoverがアーカイブモードに入ってしまった。後継として推されていたAltCoverでも、OpenCoverと同じように行単位のC1が取れそう。 手順 QuickStart Guideに記載の通り、テストケースの格納されているプロジェクト中でdotnet add package AltCoverす…
結論 OpenCover VB.NETとかでググってもぜんぜん事例が出てこないので心配になるが、OpenCoverでVB.NETのコードカバレッジも取れる。ちゃんと行単位でのC1 coverage(branch coverage, 分岐網羅)も取れる。Coverletと違って、C1が100%実行されていないのに1…
結論 https://docs.microsoft.com/ja-jp/dotnet/core/testing/unit-testing-code-coverage では「Coverlet とは、C# 用のクロスプラットフォームのコード カバレッジ フレームワーク」と言っているが、実際にはCoverletでVB.NETのコードカバレッジも取れる。…
Problem You can set locale of the current thread in PowerShell like below: [System.Threading.Thread]::CurrentThread.CurrentCulture = [System.Globalization.CultureInfo]("en-US") But error messages of PowerShell interpreter shows in current …
Problem You have to call [System.Text.Encoding]::RegisterProvider([System.Text.CodePagesEncodingProvider]::Instance) when you want to use additional character encodings in PowerShell Core (Linux). On the other hand, calling [System.Text.En…
Problem: In PowerShell, by using XML DOM API in .NET, you can access to a child element in XML as a ordinary property. PS > $xml = New-Object System.Xml.XmlDocument PS > $xml.LoadXml('<a><b id="1">foo</b></a>') PS > $xml.SelectNodes('//a').b id #text -- ----- …
Context: Japanese character encoding Shift_JIS (シフトJIS) and Microsoft Codepage 932 (a.k.a. MS932, Windows-31J in IANA) are slightly different. For example, full-width cent sign (¢) is 0x8191 in both Shift_JIS and MS932, but it is mappe…
String object in .NET (PowerShell), JavaScript, and Java all have trim() method. But trimmed characters by trim() are different between these languages. # codepoint .NET JavaScript Java 1 0000-0008 ✘ ✘ ✔ 2 0009-000D ✔ ✔ ✔ 3 000E-001F ✘ ✘ ✔…