12

I recently got into a strange problem, it seem to have happen randomly.

When I make changes inside a XAML-file (It can be anything, change text in a button, change color of background etc.) my visual studio hangs when starting my program.

Does anyone know how to fix this really annoying problem?

Tokfrans
  • 1,939
  • 2
  • 24
  • 56
  • try closing the solution and restarting it. – OneFineDay Feb 01 '14 at 22:32
  • @DonA Since I have to manually restart Visual Studio everytime I build my program, I don't think that's the problem. – Tokfrans Feb 01 '14 at 22:36
  • then you have bigger problems if you have to restart VS to build, have you loaded a bunch of extensions into VS? – OneFineDay Feb 01 '14 at 22:38
  • worst case you may have to uninstall VS and re-install it. – OneFineDay Feb 01 '14 at 22:39
  • 2
    Try deleting .suo file for the solution. – Bogdan Feb 01 '14 at 22:40
  • @DonA Extensions? For the project or for Visual Studio itself? – Tokfrans Feb 01 '14 at 22:42
  • VS, maybe both. Did you try @Bogdan suggestion - that can fix it too? – OneFineDay Feb 01 '14 at 22:43
  • @DonA I have the built-in Dark theme for Visual studio and for the project I have the Nuget package Mahapps.Metro, that's it. But where do I find this .suo ? I didn't see anything good on the internet. – Tokfrans Feb 01 '14 at 22:45
  • You find the .suo file in the folder structure where you store your solutions. I had some trouble with the themes like that. I got rid of it and VS works fine now. – OneFineDay Feb 01 '14 at 22:47
  • @Tokfrans the .suo file is near the solution file, has the same name and the extension is .suo – Bogdan Feb 01 '14 at 22:48
  • @DonA I did not find such a thing, even searched through my whole computer. The thing is I don't recall deleting such a file. Anyhow, that can't be the problem now, can it? – Tokfrans Feb 01 '14 at 22:52
  • @Tokfrans You can find the suo file near solution - see picture http://grumpywookie.files.wordpress.com/2009/10/suo.jpg – Bogdan Feb 01 '14 at 23:14
  • @Bogdan Did not find a .suo, but I did find a "Visual Studio Solution User Options" file, with the extension .user . I figure that's the one. Deleting that did not do any difference, though. – Tokfrans Feb 01 '14 at 23:20
  • @Tokfrans Maybe they renamed it in new versions of visual studio. I had issues similar to yours that were fixed by deleting that file and also some times deleting it fixes some issues with auto complete. – Bogdan Feb 01 '14 at 23:23
  • @Bogdan I guess my only option now is to re-install Visual Studio in hope that my project isn't broken in some way. I'll update this thread when I've re-installed. – Tokfrans Feb 01 '14 at 23:29
  • @Tokfrans If the project is broken you can create a new one and add files from old project one by one. – Bogdan Feb 01 '14 at 23:34
  • 2
    @Bogdan I think Tokfrans has file extensions hidden in explorer... – thumbmunkeys Feb 02 '14 at 00:54
  • @thumbmunkeys He found the file, I missed the fact they changed the extension to .user in recent versions of vs. It did not work anyway ... – Bogdan Feb 02 '14 at 01:40
  • Repairing VS did nothing. Going to try uninstalling the whole thing and then install again. – Tokfrans Feb 02 '14 at 02:01
  • Re-installing Visual Studio did nothing.. I'm all out of options.. – Tokfrans Feb 02 '14 at 20:23
  • OK so I remembered I haven't tried using another project. When doing so, the program works just fine. It's something with my project.. Any ideas on what to do? – Tokfrans Feb 02 '14 at 20:29

8 Answers8

10

I posted a thread about this on MSDN's forum too, and I got an answer which did the trick:

Apparently I had to delete the Project Solution file and then run the .csproj file.

Don't really know why but this made it work again! So if anyone has been experiencing this problem, try the solution above.

EDIT:

Link to the answer on MSDN

Tokfrans
  • 1,939
  • 2
  • 24
  • 56
2

Vote here :https://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/2204137-improve-the-xaml-designer-performance

A tip from that page that helped in my case ...

Disabling effects rendering (the fx button at the bottom left of the xaml editor) caused a significant performance boost.

Also, deleting the .suo file can sometimes fix a lot of Visual Studio problems. In VS2015 just delete the .vs folder at the root of the solution, that's where the .suo file lives.

CAD bloke
  • 8,578
  • 7
  • 65
  • 114
1

I've had the same problem and for me it was Resharper causing it. Try to suspend Resharper and uninstall all third-party add-ins if it doesn't help (resharper, ghostdoc etc.)

Also try to run VS with /SafeMode flag and see if it works properly.

Ivan Yurchenko
  • 3,762
  • 1
  • 21
  • 35
1

Delete .vs folder in you project path. then reopen your project

Sam Park
  • 11
  • 1
0

In my case, I deleted all generated files along with .db and .opendb files and the xaml editing stopped to hang up.

Borzh
  • 5,069
  • 2
  • 48
  • 64
0

It is an older question, I know, but since others have similar issues in older and newer versions of Visual Studio, maybe the following workaround may help (tested on three PCs, VS 2017, Windows 10):

  1. Open a XAML project in Visual Studio
  2. Open Windows Task Manager
  3. Search Microsoft Visual Studio XAML Designer (if it is not there, try opening a XAML file in VS)
  4. Right-click and choose Properties
  5. Select Compatibility tab
  6. Below Compatibility mode check Run this program in compatibility mode for:
  7. Select Windows 7

Screenshot

I had no crashes/freezes since changing the compatibility settings.

Good luck!

Marc
  • 23
  • 1
  • 7
0

I experienced the same issue. VS2015 would either hang for about 40 seconds or crash sometimes when closing the XAML designer. After uninstalling the extension CodeMaid the issue was gone.

0

I tried with a different project I had and I could open XAML and run my project.

So I figured it was not visual studio but my actual project.

What worked for me was deleting bin, obj and vs from each project.

Then reopen, rebuild, and now I can open XAML again, and run the project fine.

DHLopez
  • 385
  • 5
  • 17