question

RobertCummings-8613 avatar image
0 Votes"
RobertCummings-8613 asked LeonLu-MSFT commented

Xamarin Hot Reload Exception not finding project info

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.

dotnet-xamarin
· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Can you move your project to other disk, then make a test?
I notice you use the latest V17.1.6, Is that running normally in previous version?

0 Votes 0 ·

LeonLu

Thanks for the quick response .

I moved the project to a network share and still had the same issue.

I was having this issue with Microsoft Visual Studio Professional 2019 Version 16.11.13. That is why I upgraded to the most current VS2022.

I also tried this morning giving full control on the project directory to everyone to see if it was some sort of security issue. Unfortunately that did not help.

cheerw

0 Votes 0 ·
LeonLu-MSFT avatar image LeonLu-MSFT RobertCummings-8613 ·

What is your Linker setting? Please set linker to Don't Link or Link None, Please check following thread's troubleshooting tips, if it works

https://docs.microsoft.com/en-us/xamarin/xamarin-forms/xaml/hot-reload#troubleshooting

0 Votes 0 ·

Thanks so much for all your help. This is my linker setting.

199259-capture.png


As to the link you sent, I have done all that. I upgraded the version of Xamarin.Forms to 199365-capture1.png

and as you can see in the original post, Hot Reload is connected and ready.

I am always the lucky one ........

cheers


0 Votes 0 ·
capture.png (8.3 KiB)
capture1.png (2.2 KiB)
LeonLu-MSFT avatar image LeonLu-MSFT RobertCummings-8613 ·

Is this issue still exist? Your settings are right, this issue could be cause by IDE VS2022, You can report this issue like this thread: https://docs.microsoft.com/en-us/visualstudio/ide/how-to-report-a-problem-with-visual-studio?view=vs-2022

0 Votes 0 ·

Thanks LeonLu I will submit a ticket and see what happens.

Again thanks for trying

cheerw

0 Votes 0 ·
LeonLu-MSFT avatar image LeonLu-MSFT RobertCummings-8613 ·

You are welcome.

0 Votes 0 ·

0 Answers