当我构建.net Core2控制台时,我得到了以下错误。我只想创建一个可以在windows服务器上运行的.exe。
下面是我得到的错误
project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.0/win10-x64'. Ensure that restore has run and that you have included 'netcoreapp2.0' in the TargetFrameworks for your project. You may also need to include 'win10-x64' in your project's RuntimeIdentifiers.
下面是我的csproj内容
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Globals">
<SccProjectName>SAK</SccProjectName>
<SccProvider>SAK</SccProvider>
<SccAuxPath>SAK</SccAuxPath>
<SccLocalPath>SAK</SccLocalPath>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Telegram.Bot" Version="13.2.1" />
</ItemGroup>
</Project>
发布于 2019-07-09 01:09:16
我同意上面的评论,这似乎是VS的一个问题。我遇到了类似的问题:我卸载了有问题的项目,重新加载了它,一切都很好。
https://stackoverflow.com/questions/46634263
复制相似问题