Visual Studio 2015 C# WPF – Builds are successful, runs for a couple of seconds, then stops with no window being shown.

I installed Visual Studio 2015 Enterprise just the other day, I'm doing a small C# course and the program was supplied by my educational institute.

At first, I had no problems, I finished some of the exercises and when hitting 'F5' as a shortcut key, the WPF applications would build and open without any problem.

All of a sudden, and I have no idea what has caused it, I press F5 and the blue bar at the bottom that says 'Ready' turns orange, the 'Diagnostic Tools' window appears at the side, it shows 'appname.vshost.exe(CLR…' under events here and some memory being used. After two seconds, it stops, without ever having a window open.

This happens with new projects as well as older projects that haven't been edited or changed since the last time they worked.

If I go into the projects folder and run the WPF applications .exe from there, they work as they are intended to.

I have tried re-installing and I also went to Tools>Import/Export settings and reset all the settings to default.

Any ideas?

Edit: I should also note that in the app.xaml the 'StartupUri' is set.

Update: When I open the projects on a different computer, this problem doesn't persist. I assume this means it has something to do with my installation, but re-installing didn't work?

by Psionatix via /r/csharp

Leave a Reply