1.問題情景:
需要保證已安裝.net core SDK,並且命令提示符下運行“dotnet --version”,有反應。
如果之前運行良好,現在卻不行了,查看安裝程序中存在.net core SDK,但dotnet不管用。直接在控制面板中的程序列表中修復該應用,然后重啟cmd,試試。
2..csproj項目配置文件配置如下:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
</PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
</PropertyGroup>
</Project>