0
我使用VS2017创建了一个Windows Runtime Component (Universal)
类型的项目。项目文件包括包参考:如果启用该选项通过VS2017中的nuget恢复依赖关系
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>5.2.3</Version>
</PackageReference>
</ItemGroup>
一切正常:Automatically check for missing packages during build in Visual Studio
但我有一些情况下(这个选项被禁用,通过CLI建立,服务器CI构建)如果在编译期间没有自动恢复此依赖关系,生成后obj
文件夹中缺少project.assets.json
。它会导致很多像这样的错误:error CS0518: Predefined type 'System.String' is not defined or imported
是否可以通过项目文件(.csproj)自动恢复软件包引用?
感谢
感谢您的回应,但我也需要恢复兼容性,使用MSBuild版本低于15的VS2015。 – Bob
@Bob告别VS 2015.没有回头路可走。 –