Xamarin - Error IDE1100 Error reading content of source file

Viewed 9861

I've made a new content page, but forgot to type the name.. So I deleted it an made it again with proper name..

I have done it like this multiple times already, but this time something went wrong and I cannot compile. I have this error message:

Severity    Code    Description Project File    Line    Suppression State
Error   IDE1100 Error reading content of source file 
'C:\Users\shark\source\repos\GalShare\GalShare\GalShare\Views\Page1.xaml' -- 'Could not find file 
'C:\Users\shark\source\repos\GalShare\GalShare\GalShare\Views\Page1.xaml'.'.    GalShare-XamlProject     
C:\Users\shark\source\repos\GalShare\GalShare\GalShare\Views\Page1.xaml 1   Active

I have done nothing except the steps above.. What is the cause of this error and how can I fix it?

5 Answers

Cleaning the project did not solve, but closing and reopening solved my problem.

In addition to the answers of E.Zhao and messyprogrames, here a step-by-step walkthrough.

Clean Solution:
Navigation Bar > "Build" > "Clean Solution"

enter image description here

Unload project:
Choose your "problem project" on the right side within the solution explorer. Right mouse click > "Unload Project"

enter image description here

Reload project:
Choose your unloaded "problem project" again. Right mouse click > "Reload Project".

enter image description here

Opening and closing the solution wasn't helping, but unloading and reloading the project worked.

Actually, it is unnecessary to exit and reopen current solution, try to clean the error project, unload and then reload it again. hope it works for you.

Unloading and reloading the project worked for me.

To reproduce this, in a new folder add a WPF user control with a accidental typo.

Rename with F2 or simply rename, the code behind doesn't rename, so change that. Initalize component gets a good old red squiggly!

create a new one with an appended number as you want to crack on... delete the user control that you originally created.

You will get this error (well I did on enterprise edition Version 16.7.2)

Then as other contributors have suggest, remove the pain by unloading and reloading the project.

Related