gpt4 book ai didi

visual-studio-2017 - NuGet软件包无法在Visual Studio 2017中还原

转载 作者:行者123 更新时间:2023-12-04 09:17:22 29 4
gpt4 key购买 nike

我有Asp.netCore解决方案,可以在Visual Studio 2015上正常工作,然后我移到Visual Studio 2017。现在的问题是,在每个nuget包的Visual Studio 2017中,都有黄色的感叹号。以下是到目前为止我尝试过的解决方案。

我正在使用Visual Studio Version: 15.3.1

  • 以“管理员”身份运行并还原软件包。
  • Clear All Nugget Cache(s)中的
  • Tools > options > NuGet Package Manager >,然后再次还原Nuget。

  • You can see yellow mark on every nuget package

    注意:我已经搜索并找到以下解决方案,并尝试但未解决我的问题。

    Solution 1

    最佳答案

    我在这里找到了另一个线程的答案,尽管他没有将重点专门放在@AxelWass上,但应该归功于@AxelWass,它绝对可以解决此问题。上面的答案没有。

    我遇到了同样的问题,并通过在文本编辑器中打开项目并删除以下部分来解决此问题:

    <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
    <PropertyGroup>
    <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
    </PropertyGroup>
    <Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props'))" />
    <Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
    </Target>

    删除此问题后,它将解决VS2017和PM似乎无法解决的噩梦问题。我也多次遇到这个问题-尤其是当我在同一个解决方案目录中混合了许多项目时。

    关于visual-studio-2017 - NuGet软件包无法在Visual Studio 2017中还原,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45831838/

    29 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com