Category Archives: Memo

ASP.NET Core gRPC for WCF Developers 

Introduction to building gRPC services in ASP.NET Core 3.0 for WCF developers

情報源: ASP.NET Core gRPC for WCF Developers – gRPC for WCF Developers | Microsoft Docs


Memo: Roslynを使ってC#のコードでC#のコードをコンパイルする

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Text;

namespace RoslynComple
    class Program
        private static readonly IEnumerable<string> DefaultNamepaces = 
        private static string runtimePath 
            = @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\{0}.dll";
        private static readonly IEnumerable<MetadataReference> DefaultRefrences =
                MetadataReference.CreateFromFile(string.Format(runtimePath, "mscorlib")),
                MetadataReference.CreateFromFile(string.Format(runtimePath, "System")),
                MetadataReference.CreateFromFile(string.Format(runtimePath, "System.Core"))

        private static readonly CSharpCompilationOptions DefaultCompletionOpsions =
            new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)
        public static SyntaxTree Parse(string text, string filename = "", CSharpParseOptions options = null)
            var stringText = SourceText.From(text, Encoding.UTF8);
            return SyntaxFactory.ParseSyntaxTree(stringText, options, filename);
        static void Main(string[] args)
            // DLL Source Code
            var fileToCompile = @"C:\temp\Test.cs";
            var source = File.ReadAllText(fileToCompile);
            var parseSyntaxTree 
                = Parse(source, "", CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_3));
            var compliation 
                = CSharpCompilation.Create("test.dll", 
                                            new SyntaxTree[] { parseSyntaxTree }, 
                                            DefaultRefrences, DefaultCompletionOpsions);
                var result = compliation.Emit(@"c:\temp\Test.dll");
                Console.WriteLine(result.Success ? "Sucess!!" : "Failed");
            catch (Exception ex)



Announcing WinUI 3 Preview 2

At our monthly community call this morning we announced that a new preview of WinUI 3 is ready for you all to try out – WinUI 3 Preview 2! If you’re too excited to read ahead, check out the release notes here. WinUI 3 Preview 2 was a quality and stability-driven release. It builds directly […]

情報源: Announcing WinUI 3 Preview 2 – Windows Developer Blog


Nullable Reference Types: Contexts and Attributes – A Look at New Language Features in C# 8 – .NET Tools Blog.NET Tools Blog

Our C# 8 language features series is coming to an end. Before we jump into nullable contexts and nullable attributes, here is a quick (updated) recap of our roadmap: Indices, Ranges, and Null-coalescing Assignments Switch Expressions and Pattern-Based Usings Recursive … Continue reading →

情報源: Nullable Reference Types: Contexts and Attributes – A Look at New Language Features in C# 8 – .NET Tools Blog.NET Tools Blog


Nullable Reference TypesはC#8.0で追加されました。これは将来のC#でのNull全面不許可への第一歩です。Nullable Reference TypesはNull全面不許可における例外を設けるために作られたものです。なので、古いクラスライブラリなどどうしようも無い部分はあるのですが、C#erは極力Nullを避けるコーディング習慣を身につけるように努力した方が良いと思います。

build 2020 – The Journey to One .NET

Join us for the Microsoft Build 48-hour, digital event to expand your skillset, find technical solutions, and innovate for the challenges of tomorrow.

情報源: MyBuild – The Journey to One .NET


Introducing C# Source Generators

We’re pleased to introduce the first preview of Source Generators, a new C# compiler feature that lets C# developers inspect user code and generate new C# source files that can be added to a compilation. This is done via a new kind of component that we’re calling a Source Generator.

情報源: Introducing C# Source Generators | .NET Blog


多分一生直接使わない人がいるだろうし、使う人はめっちゃ使うことになるソースジェネレーターが.NET 5で追加になるようです。実際に自分でソースジェネレーターを書くことはなくても、今後何らかのフレームワークを使う場合にはこのソースジェネレーターのお世話になることは間違いないです。

Updates on .NET Core Windows Forms designer

We released a preview version of Visual Studio 16.6 – Visual Studio 2019 version 16.6 Preview 1 and with it a new version of .NET Core Windows Forms designer. This release contains Support for the following controls: FlowLayoutPanel, GroupBox, ImageList, MenuStrip (via the PropertyBrowser and context menu),

情報源: Updates on .NET Core Windows Forms designer | .NET Blog