katit
katit

Reputation: 17915

One file keeps opening in visual studio IDE

I'm using Visual Studio 2010

In one solution I have A.XAML file and it keeps opening every time I start solution. It also opens at some random time - I have no exact explanation.

It's very annoying. Why would VS open specific file by itself?

Upvotes: 5

Views: 978

Answers (2)

Grace Em
Grace Em

Reputation: 21

What worked for me was running Visual Studio installer and choosing the repair option. I had a whole solution that always opened a few seconds after I open any other solution. I didn't want to delete the solution so I thought I should try repairing Visual Studio (using VS2019). Haven't had any issue since.

Seems like an 'intense' option but it was what worked.

Upvotes: 1

Gros Lalo
Gros Lalo

Reputation: 1088

Does it open even when you create a new project? How about locating the file and renaming it does it help the problem? Also, have you tried to backup and remove the content of C:\Users\<your_username>\AppData\Local\Microsoft\VisualStudio\?

Update 1 based on comments:

So when you renamed all your A.XAML to B.XAML, do you get the A.XAML appearing or do you get a B.XAML file? Do you have many instances of the A.XAML file on your computer? If there are many, rename them differently so that you can subsequently identify the guilty one. Have you tried to 'Repair' VisualStudio through 'Add Remove Program' in Control Panel? Can you locate the A.XAML string in Regedit.exe? I think it could be useful if you would create a dummy project and ask a colleague or, friend to open it on their computer? (It would be helpful to get have a sample of that dummy project in order to troubleshoot whether it is the Project or, the IDE or, the OS which is the guilty party)

Update 2 based on further comments:

Recreating the .SUO file of the project fixed the problem. For example, renaming the .SUO file to .BAK and re-opening the project in Visual Studio.

Upvotes: 3

Related Questions