0

Suddenly (maybe after restarting my PC while VS was running) Visual Studio 2012 fails to open a lot of projects that were previously working.
It also fails to create new projects.

The error is pretty common and generic:
visual studio has stopped working

I tried all the solutions from questions like this one. I also reinstalled VS 2012, but still no success.

The pattern I found is that it fails to create some project types, but others work fine.

These work fine:

  • Windows Form App
  • Activity Library
  • ASP.NET MVC 3 (Empty)
  • ASP.NET MVC 4 (Empty)

These fail:

  • WPF App
  • Console App
  • ASP.NET Web Forms App
  • Class Library
  • Portable Class Library
  • ASP.NET MVC 3 (Internet Application)
  • ASP.NET MVC 4 (Web API)
  • WCF Service App

Also, changing the framework version makes no difference.

Any idea what could be the problem?

Edit: event log is showing

Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Globalization.CultureNotFoundException
   at System.Globalization.CultureData.GetCultureData(Int32, Boolean)
   at System.Globalization.CultureInfo.InitializeFromCultureId(Int32, Boolean)
   at System.Globalization.CultureInfo..ctor(Int32, Boolean)
   at System.Windows.Input.InputLanguageSource.get_CurrentInputLanguage()
   at System.Windows.Input.InputLanguageManager.get_CurrentInputLanguage()
   at Microsoft.VisualStudio.Text.Editor.Implementation.CaretElement.ConstructCaretGeometry()
   at Microsoft.VisualStudio.Text.Editor.Implementation.CaretElement.UpdateCaret()
   at Microsoft.VisualStudio.Text.Editor.Implementation.CaretElement.OnRender(System.Windows.Media.DrawingContext)
   at System.Windows.UIElement.Arrange(System.Windows.Rect)
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(System.Object)
   at System.Windows.Media.MediaContext+InvokeOnRenderCallback.DoWork()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(System.Object)
   at System.Windows.Media.MediaContext.RenderMessageHandler(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
Community
  • 1
  • 1
pomber
  • 23,132
  • 10
  • 81
  • 94

1 Answers1

0

The problem is that windows is using an "Unknown Language" by default. This makes Visual Studio crash.
If I open VS, change the language, and then open the solution, it works.

This answer fixes the "Unknown Language" problem.

Community
  • 1
  • 1
pomber
  • 23,132
  • 10
  • 81
  • 94