VS 2013 error when using JSON deserialization method

I created a C # ASP.NET method that simply takes a string property containing JSON, like inside a single class. My problem is that whenever I type .Deserialize method (comment line), Visual Studio 2013 crashes "Unhandled Exception" in the event logs.

public object JSONAsObject() { object obj = new object(); JavaScriptSerializer js = new JavaScriptSerializer(); // obj = js.Deserialize<object>(this._json); return obj; } 

If I write a line in the comments (as indicated above), then delete the comments there without problems, so the problem arises with Intellisense or the way I write code - who has any ideas?

Crash log

 Application: devenv.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.ArgumentNullException Stack: at System.Text.RegularExpressions.Regex.Escape(System.String) at Microsoft.OneCode.Utilities.UserControl.CodeSnippetsTextBox.UpdateRegex() at Microsoft.OneCode.Utilities.UserControl.CodeSnippetsTextBox.OnMyWorkCollectionChanged(System.Object, System.Collections.Specialized.NotifyCollectionChangedEventArgs) at System.Collections.ObjectModel.ObservableCollection`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs) at System.Collections.ObjectModel.ObservableCollection`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].InsertItem(Int32, System.__Canon) at System.Collections.ObjectModel.Collection`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Add(System.__Canon) at Microsoft.OneCode.IntellisensePresenter.ViewModel.IntellisenseViewModel.UpdateCodeSnippets(System.Collections.Generic.IEnumerable`1<Microsoft.OneCode.DataModel.CodeSearchResult>) at Microsoft.OneCode.IntellisensePresenter.ViewModel.IntellisenseViewModel+<>c__DisplayClass5.<SearchCode>b__2() at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) at MS.Internal.Threading.ExceptionFilterHelper.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 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 MS.Internal.Threading.ExceptionFilterHelper.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) 

Please let me know if you need this to upgrade to SuperUser.

Edit 1: Just to confirm that this problem occurs at design time and not at run time. VS crash while entering code.

Edit 2: This issue only occurs on this particular line. The system I'm working with is massive and I have never seen a problem before.

Edit 3: The same problem in the new project is potentially a bug in VS 2013, but I don't know what throws an exception in the first place.

+6
source share
3 answers

As @Jehof explained in the comments, I turned off all VS 2013 extensions that fixed the problem. Enabling each extension one at a time showed that the Bing development assistant caused this problem. There was an update that was not installed - installing this update fixes the problem.

For anyone else with this problem, make sure that VS and all extensions are fully updated.

+5
source

Visual Studio continues to crash Visual Studio when working with TBS and Angular JS.

 System.NullReferenceException was unhandled Additional information: Object reference not set to an instance of an object. 

IntelliSense uses large amounts of memory for medium and large projects, which can lead to crashes and instabilities - you can turn off improvements in Tools / Options / Text Editor / Node.js / Completion / Automatic List to avoid this (recommended).

+1
source

You cannot use an "object", you must use a type.

 Deserialize<T>() 

where T is a type, cannot be an "object"

-1
source

Source: https://habr.com/ru/post/984310/


All Articles