我的解决方案中有一个项目未在VSE2019中加载。它将引发此错误:
C:\MyProgram\src\MyProgram.Functions.csproj : error : The project file cannot be opened by the project system, because it is missing some critical imports or the referenced SDK cannot be found.
Detailed Information:
Unable to locate the .NET Core SDK. Check that it is installed and that the version specified in global.json (if any) matches the installed version.
该项目是由另一个开发人员(不在这里)创建的,.csproj包含以下内容:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<AzureFunctionsVersion>v1</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.10.0" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.24" />
<PackageReference Include="WindowsAzure.ServiceBus" Version="2.1.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.ServiceBus">
<HintPath>..\packages\WindowsAzure.ServiceBus.2.1.0.0\lib\net40-full\Microsoft.ServiceBus.dll</HintPath>
</Reference>
<Reference Include="System.Configuration" />
<Reference Include="System.Web" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="local.settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
</ItemGroup>
</Project>
以下是我到目前为止尝试过的方法,但仍然没有积极的结果:
<!-- <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.24" /> -->
我不确定为什么这个项目对软件包如此“讨厌”? 还是如何强制将缺少的NuGet安装到该项目?
答案 0 :(得分:0)
似乎再次重新安装了最新的.Net SDK(3.0.100),就可以解决问题。