更新Xamarin后加载解决方案导致Visual Studio无响应
Hey there, let's work through this frustrating project loading problem you're facing after updating Xamarin to 4.9.0.753. Minor updates can sometimes leave behind cached files or small corruption issues that throw off Visual Studio, so here are some practical steps to resolve it:
Clear cached data to eliminate stale conflicts
Visual Studio and Xamarin store cache files that can get out of sync after an update. Here's how to wipe them:- Close all open Visual Studio windows completely.
- Delete the contents of these two folders:
%LOCALAPPDATA%\Microsoft\VisualStudio\14.0\ComponentModelCache%LOCALAPPDATA%\Xamarin
- Restart Visual Studio and try loading your solution again. This often fixes weird loading hang-ups caused by old cached data.
Repair your Xamarin installation
Sometimes the update process doesn't fully complete or leaves corrupted files. A repair can fix this:- Head to Control Panel > Programs > Programs and Features, find Visual Studio Community 2015, and click "Change".
- Navigate to the Xamarin component section, select "Repair", and let the installer run its course.
- Reboot your machine after the repair finishes, then test loading your solution again.
Reset Visual Studio user data and clean build outputs
Since removing the iOS/UWP project references didn't resolve the issue, the problem might lie with the underlying project system:- Open the Developer Command Prompt for VS 2015 as an administrator.
- Run
devenv /resetuserdata— this resets your VS user settings (note: this will reset UI layouts, extension preferences, etc., so back up any customizations first if needed). - Next, navigate to your solution directory in the command prompt and run
msbuild /t:Cleanto wipe all build outputs. Then try reloading the solution in VS.
Check target frameworks and NuGet packages
Outdated packages or mismatched target frameworks can cause compatibility issues with the updated Xamarin tools:- Right-click your PCL and Android projects, go to Properties > Application, and verify their target frameworks are compatible with Xamarin 4.9.0.753.
- Right-click your solution, select Manage NuGet Packages for Solution, and update all packages to their latest compatible versions. Old NuGet packages often don't play well with new Xamarin updates.
Dig into diagnostic logs to find the root cause
If none of the above works, let's get more details from the logs:- In Visual Studio, go to Tools > Options > Projects and Solutions > Build and Run.
- Set MSBuild project build output verbosity to "Diagnostic".
- Try loading your solution again, then check the Output window (View > Output) for error messages or processes that seem stuck. This should point you to exactly what's causing the loading hang.
内容的提问来源于stack exchange,提问作者Aaron

