解决办法: 在visual studio 2022中工具=》NuGet工具包=》程序包管理器控制台 PM> Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform