Jakub Loksa
Jakub Loksa

Reputation: 577

Visual Studio - Corrupted .xaml file

Recently I've put my computer to sleep, and when I started it up, the computer turned off.

Before I open the file, it asks me about Encoding. I've tried multiple, and even the Auto-Detect. No luck.

Later when I turned it on, the MainWindow.xaml looked like this:

Invalid Markup

The MainWindow.xaml.cs is surprisingly fine, and even registers the variables written in the XAML file. Also other XAML files in project are fine.

When I hover over the lines, this error shows: The value "□" is not a valid character

Does anyone know if the MainWindow.xaml is salvageable or is it a lost cause?

Thank you a lot for your answers.

Upvotes: 1

Views: 683

Answers (1)

ViVi
ViVi

Reputation: 4464

Clear the shadow cache and restart visual studio. It should be fine.

Shadow cache is located at

C:\Users\UserName\AppData\Local\Microsoft\VisualStudio\12.0\Designer\ShadowCache

Delete the shadow cache for corresponding visual studio version and restart it. It should be working fine.

Upvotes: 1

Related Questions