“dotnet build”失败:“解决方案文件错误 MSB4249:无法构建网站项目”

Joh*_*icz 6 msbuild .net-core dotnet-cli

除了 .net core 2.2 项目之外,我的解决方案文件还包含一个网站项目。当我在 Visual Studio 中运行“重建解决方案”时,一切都会成功构建,包括网站。

在构建输出中,我看到:

>Validating Web Site
9>Building directory '/e2e/'.
9>Building directory '/node_modules/.bin/'.
... etc ...
Run Code Online (Sandbox Code Playgroud)

但如果我尝试从包含解决方案文件的文件夹运行“dotnet build”(v3.1.200),它会失败并出现以下错误:

Solution file error MSB4249: Unable to build website project "ClientApp". The ASP.NET compiler is only available on the .NET
Framework version of MSBuild
Run Code Online (Sandbox Code Playgroud)

如何从命令行构建我的解决方案?

[Visual Studio 是否运行“dotnet build”来构建解决方案”?如果是,使用什么参数?]