You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows 10中Visual Studio 2017使用Xamarin时无法找到包的问题

Fixing NU1101 Errors for Xamarin.Forms in Visual Studio 2017

It looks like your NuGet package manager is having trouble locating the required Xamarin packages—this is a common hiccup when package sources are misconfigured, the cache is corrupted, or offline mode is accidentally enabled. Let’s walk through practical fixes step by step:

  • Verify and Correct Package Sources
    Open Tools > NuGet Package Manager > Package Manager Settings. Under the Package Sources section:

    • Make sure nuget.org is listed and enabled. If it’s missing, add it manually with the source URL https://api.nuget.org/v3/index.json.
    • Disable any unused or outdated sources (like old offline repositories) that might be interfering with package lookup. Stick to reliable sources like nuget.org for now.
  • Disable Offline Mode
    Sometimes Visual Studio gets stuck in offline mode, blocking access to online packages:

    • In the same Package Manager Settings, navigate to General and ensure both "Allow NuGet to download missing packages" and "Automatically check for missing packages during build in Visual Studio" are checked.
    • You can also confirm status in the Package Manager Console: run Get-PackageSource to see if any source shows IsOffline as True. If so, toggle it off with Set-PackageSource -Name "nuget.org" -IsOffline $false.
  • Clear Corrupted NuGet Cache
    Damaged cache files often cause package lookup failures:

    • Go to Tools > Options > NuGet Package Manager > General and click "Clear All NuGet Cache(s)".
    • Alternatively, close Visual Studio and manually delete the cache folder at %userprofile%\.nuget\packages.
  • Repair Your Visual Studio Installation
    If Xamarin components were installed incorrectly or corrupted:

    • Open the Visual Studio Installer, select your VS2017 instance, click "Modify" then "Repair". This will re-install any missing mobile development components and fix broken Xamarin-related files.
  • Manually Install Missing Packages
    If all else fails, add the packages directly to your solution:

    • Right-click your solution > Manage NuGet Packages for Solution.
    • Go to the Browse tab, search for Xamarin.Forms and install it to all projects in your solution. Repeat this process for the missing Xamarin.Android.Support.v7 packages.

After each step, rebuild your project to check if the errors resolve. If issues persist, make sure your NuGet Package Manager extension is up to date (check Tools > Extensions and Updates for available updates).

内容的提问来源于stack exchange,提问作者Raúl Cuadrado

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 04:22:32