Xamarin新手求助:Xamarin.Forms/.NET Standard项目找不到Components文件夹
Hey there! Starting out with Xamarin can definitely have some confusing moments, especially when things don’t match up with older tutorials or guides. Let’s clear up why you’re not seeing that "Components" folder and what to do instead.
First off, the Xamarin Components feature was officially deprecated by Microsoft a while back, and it’s no longer included in new Xamarin.Forms/.NET Standard projects. The ecosystem has fully shifted to using NuGet packages for managing all third-party libraries, tools, and components—this is the modern, supported way to add functionality to your project.
Here’s how to add the components you need using NuGet, which is way more reliable and maintained:
- Right-click on your project (either the Android project or your .NET Standard shared project) and select
Manage NuGet Packages. Alternatively, go to the top menu:Tools > NuGet Package Manager > Manage NuGet Packages for Solution. - Switch to the Browse tab, then type the name of the component you want to install (e.g., Xamarin.Essentials, Syncfusion UI components, etc.).
- Once you find the correct package, select the version you want (usually the latest stable one) and click
Install. Make sure to check the boxes for all relevant projects (like your Android project and .NET Standard project) if the package requires it. - After installation, you can find all your installed packages under the
Dependencies > NuGetnode in your project tree—no need for a Components folder at all.
While I strongly advise sticking with NuGet, if you have a specific reason to use a Components folder (like working with an extremely old legacy component), you can manually create it:
- Right-click your solution in the Solution Explorer, select
Add > New Folder, and name itComponents. - Note that Visual Studio won’t provide any official support for managing components here—you’ll have to download component files manually, extract them to this folder, and set up references yourself. This approach lacks auto-updates and will be far more hassle than using NuGet.
内容的提问来源于stack exchange,提问作者mkis

