2023-02-11: .NET language strategy, Windows App SDK 1.3 Experimental-1, Rider EAP 日本語言語パック

Published on Saturday, 11 February 2023

トピックス

Update to the .NET language strategy - .NET Blog

https://devblogs.microsoft.com/dotnet/update-to-the-dotnet-language-strategy/

.NET での言語に対する(Microsoftの)戦略のアップデートについて。

.NET では現在主要な言語として C#、F#、Visual Basic の3つがあり、それぞれへの Microsoft の戦略に関してのドキュメントがアップデートされた。

Version 1.3 Experimental (1.3.0-experimental1) | Experimental release channel for the Windows App SDK - Windows apps | Microsoft Learn

https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/experimental-channel#version-13-experimental-130-experimental1

Windows App SDK 1.3 Experimental-1 がリリースされた。

このリリースでは XAML Backdrop API (ウィンドウ背景への Mica の適用など)、アプリウィンドウにアクセスするための Window.AppWindow API などいくつかの新機能が導入されている。

Rider EAP 版で日本語言語パック対応を開始 | The .NET Tools Blog

https://blog.jetbrains.com/ja/dotnet/2023/02/07/introducing-the-rider-localization-eap-for-japanese/

JetBrains Rider 2023.1 EAP3 で日本語および中国語、韓国語のローカライズを行う言語パックを利用できるようになった。

一部のローカライズは現在進行中であり、フィードバックも IDE や YouTrack で受け付けているとのこと。また今後の目標に ReSharper のローカライズもあるとしている。

ReSharper Ending Development for Visual Studio 2010 and 2012 | The .NET Tools Blog

https://blog.jetbrains.com/dotnet/2023/02/10/ending-development-for-vs-2010-2012/

ReSharper 2023.1 以降では Visual Studio 2010 および 2012 の積極的なサポートを終了するアナウンス。

インストーラーの統合オプションは維持されるためすぐに利用できなくなるわけではないものの、機能の保証やサポート優先度が低くなる。

アーティクル、スライドなど

画像分類アプリケーションを速攻で作っていく過程 - Qiita

https://qiita.com/SoeAtsu/items/4d22493c5dc8367162db

WPF と ML.NET で画像を認識して分類するアプリケーションを作ってみるという記事。

SpecFlow — Cucumber in C#

https://daniel-delimata.medium.com/specflow-cucumber-in-c-e642c63469b2

.NET における Cucumber である SpecFlow を使って、Web アプリケーションのテストを行う方法について。

Generating the response writing expression for RequestDelegate: Behind the scenes of minimal APIs - Part 6

https://andrewlock.net/behind-the-scenes-of-minimal-apis-6-generating-the-response-writing-expression/

Minimal API の裏側を開設するシリーズの RequestDelegate がレスポンスを出力する式 (Expression) を生成する流れについて。

Blazor でバリデーション ロジックを部品化したい

https://zenn.dev/microsoft/articles/viewside-validation

Blazor でのカスタム検証ロジックをコンポーネントの形にして部品化する方法について。

BlazorのValidationSummaryでasp-validation-summaryのように表示エラーメッセージを絞り込みたい

https://zenn.dev/microsoft/articles/blazor-validationsummary-tips

ValidationSummary コンポーネントですべてのプロパティーではなく、特定のモデルに関するエラーのみ表示する方法について。

.NET Annotated Monthly | February 2023 | The .NET Tools Blog

https://blog.jetbrains.com/dotnet/2023/02/08/net-annotated-monthly-february-2023/

JetBrains による .NET 関連の2023年2月のまとめ記事。

C#サーバーでプロファイルを取る方法 - Qiita

https://qiita.com/Shaula/items/177e8c16ec9b8b102c7a

コンテナーなどサーバーで動作している .NET アプリケーションのトレースを dotnet-trace を使用して取得する方法について。

.NETでIBM iのDBをつついてみる - Qiita

https://qiita.com/tom_m_m/items/9481e8b619463ab9c20f

IBM i (ppc64le アーキテクチャー) で.NET アプリケーションから Db2 データベースに アクセスしてみたという記事。

C# Tip: do NOT use nameof to give constants a value - Code4IT

https://www.code4it.dev/csharptips/do-not-use-nameof-for-constants

nameof で定数名を定数として使用してさらにそれをテーブル名などに使うと、うっかりコードを変更したときに壊れるのでお勧めしないという意見。

Generating Sample Data with Bogus

https://wildermuth.com/2023/01/29/generating-sample-data-with-bogus/

Bogus を使用してダミーデータを生成する方法について。

async void – How to Tame the Asynchronous Nightmare - Dev Leader

https://www.devleader.ca/2023/01/27/async-void-how-to-tame-the-asynchronous-nightmare/

async void の問題とイベントハンドラーなどで使う際にも何とかして例外をキャッチするための方法について。

Must follow C rules, no exceptions

https://ericsink.com/native_aot/no_exceptions.html

NativeAOT でネイティブから呼び出されるメソッドでは例外を投げてはいけないということについて。

Use Visual Studio dev tunnels to handle Twilio Webhooks

https://dev.to/twilio/use-visual-studio-dev-tunnels-to-handle-twilio-webhooks-58dc

Visual Studio の dev tunnel を使用して Twilio の Webhook を処理する手順について。

The cost of timing out

https://ayende.com/blog/198977-B/the-cost-of-timing-out

同時実行数の多いような環境ではタイムアウトのために CancellationToken.CancelAfter を呼び出すことで Timer のセットが大量に発生してしまうことについて。

RavenDB では定期的なタイマーを持ってまとめて処理する方法をとることでコストを下げるようにしている。

Without Blazor WebAssembly, develop a web site that compiles and runs C# code on browser

https://yangzhongke8.medium.com/without-blazor-webassembly-develop-a-web-site-that-compiles-and-runs-c-code-on-browser-c381873f6d03

Blazor WebAssembly の Blazor 部分を使用せず WebAssembly でビルドした C# のコードを JavaScript から呼び出す方法について。

Performance Testing Sync-Over-Async Scenarios

https://wapplegate.com/performance-testing/

非同期メソッドを同期的に待機する、いわゆる Sync-over-Async のパフォーマンスについて。

いくつかのコードシナリオとそれに対する並列リクエスト数によるレイテンシーや RPS といった結果をまとめている。

ライブラリ、リポジトリ、ツールなど

drasticactions/MauiFeed: A cross-platform .NET Feed Reader

https://github.com/drasticactions/MauiFeed

.NET MAUI で実装されたフィードリーダー。

Windows 向けのビルドが Microsoft Store からインストール可能となっている。

ForNeVeR/xaml-math: A collection of .NET libraries for rendering mathematical formulae using the LaTeX typesetting style, for the WPF and Avalonia XAML-based frameworks

https://github.com/ForNeVeR/xaml-math

WPF と Avalonia で使用できる LaTeX スタイルの数式表示を行うライブラリー。

LEGO/AsyncAPI.NET: The AsyncAPI.NET SDK contains a useful object model for AsyncAPI documents in .NET

https://github.com/LEGO/AsyncAPI.NET/

AsyncAPI (OpenAPI のイベント駆動 API 版) のドキュメントを読み込むためのライブラリー。

Deep Dive

[WIP] ASP.NET Core Roadmap for .NET 8 · Issue #44984 · dotnet/aspnetcore

https://github.com/dotnet/aspnetcore/issues/44984

.NET 8 の ASP.NET Core のロードマップ的な Issue。

Excessive allocations in HttpContent.ReadAsByteArrayAsync · Issue #81628 · dotnet/runtime

https://github.com/dotnet/runtime/issues/81628

HttpContent.ReadAsByteArrayAsync()HttpClient.GetByteArrayAsync() に比べて4倍アロケーションがあって多すぎではないかという話。

そもそも HttpContent.ReadAsByteArrayAsync() は何度も読み込めるようにする都合バッファリングしたりコピーしたりが発生しているので、現状それを避けるのであれば Stream で読みだすべき、など。