Xamarin Hot Reload Exception not finding project info

Robert Cummings 76 Reputation points
2022-05-03T14:09:21.363+00:00

I am having issues with Hot Reload. It does load just fine. But it fails on execution.
I am using Microsoft Visual Studio Community 2022 (64-bit) - Current
Version 17.1.6

Here is what I see in the Xamarin Hot Reload Output window when I save the page.

[8:49:20 AM]  (MSTCEvents.Android) Legacy Xamarin Project does reference Xamarin.Forms.
[8:49:22 AM]  (MSTCEvents.Android) XAML Hot Reload is using 'full page' mode
[8:49:22 AM]  (MSTCEvents.Android) Starting Hot Reload Session...
[8:49:22 AM]  XAML Hot Reload initializing...
[8:49:25 AM]  (MSTCEvents.Android) HotReload: Initialized Agent.
[8:49:29 AM]  XAML Hot Reload Connected and Ready.
[8:49:50 AM]  Could not get the project info for $C:\MSTC_GIT\Misc\MstcEventsMobleApp\MSTCEvents\MSTCEvents\MainPage.xaml. Verify it exists on disk.
[8:49:50 AM]  Caught exception in OnAfterSave at 318: System.AggregateException: One or more errors occurred. ---> System.Exception: Could not get the project info for $C:\MSTC_GIT\Misc\MstcEventsMobleApp\MSTCEvents\MSTCEvents\MainPage.xaml. Verify it exists on disk.
   at Xamarin.HotReload.Vsix.XamarinHotReloadExtensionPackage.GetFileIdentityForDocument(String docPath) in D:\a\_work\1\s\HotReload\Source\Xamarin.HotReload.Vsix\XamarinHotReloadExtensionPackage.cs:line 366
   at Xamarin.HotReload.Vsix.XamarinHotReloadExtensionPackage.<>c__DisplayClass33_0.<OnAfterSave>b__0() in D:\a\_work\1\s\HotReload\Source\Xamarin.HotReload.Vsix\XamarinHotReloadExtensionPackage.cs:line 312
   at System.Threading.Tasks.Task.Execute()
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.Exception: Could not get the project info for $C:\MSTC_GIT\Misc\MstcEventsMobleApp\MSTCEvents\MSTCEvents\MainPage.xaml. Verify it exists on disk.
   at Xamarin.HotReload.Vsix.XamarinHotReloadExtensionPackage.GetFileIdentityForDocument(String docPath) in D:\a\_work\1\s\HotReload\Source\Xamarin.HotReload.Vsix\XamarinHotReloadExtensionPackage.cs:line 366
   at Xamarin.HotReload.Vsix.XamarinHotReloadExtensionPackage.<>c__DisplayClass33_0.<OnAfterSave>b__0() in D:\a\_work\1\s\HotReload\Source\Xamarin.HotReload.Vsix\XamarinHotReloadExtensionPackage.cs:line 312
   at System.Threading.Tasks.Task.Execute()<---

The file does exist where Hot Reload is looking. C:\MSTC_GIT\Misc\MstcEventsMobleApp\MSTCEvents\MSTCEvents\MainPage.xaml

The only reference I could find to this issue is here

I deleted the .vs directories and that did not seem to help.

Developer technologies | .NET | Xamarin
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.