Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does this code crash Visual Studio 2015?

People also ask

Why does my Visual Studio code keep crashing?

If while opening a large file, VSCode freezes and then crashes, you need to delete some files. So, open Run, paste “%AppData%” and click Ok. Now, open Code > Backup and then delete the only folder that is inside that directory. Finally, restart VSCode and see if the issue persists.

Why can't I run my code in Visual Studio?

The reason Visual Studio cannot find the exe is because it didn't create one. Your project does not include any source files (observed by the empty "Source Files" folder under the Project2 node in the Solution Explorer window).

How do I start Visual Studio in safe mode?

All versions of visual studio can be started with a set of arguments. Using devenv.exe /SafeMode allows you to run any version of visual studio (devenv.exe) in SafeMode that will disable 3rd party plugins. You can either run devenv.exe /SafeMode using the command line or by creating a new shortcut.


This is a known bug in Roslyn. This bug will affect any version of Visual Studio that uses Roslyn.

If I am interpreting VersionOf.net correctly, the first version of Visual Studio with Roslyn built-in is 2015. Before then, I think it was available only as an extension. So, Visual Studio 2013 and prior should be unaffected.

It's due to be fixed in the milestone 16 release. At this time, that release is not scheduled.

Because this is a bug in Roslyn, you can "get around" it by editing and compiling the code containing the unsafe struct in an older version of Visual Studio, one that predates Roslyn. Visual Studio 2012 should work. You can then use the resultant .DLL in your current software.

An unverified fix is available if you build Roslyn yourself from this branch. The fix was made in this commit.