What to do when installing an older version of TypeScript breaks Visual Studio

typescript

Usually when I'm coding I'm using the latest and greatest tech but sometimes I have a need to use a specific version of a plugin or framework for backward compatability with a Visual Studio project.

I ran into an issue the other day where I needed to run a specific version of TypeScript that was older than the current version on my computer. I downloaded the older file and installed it all without any issues. I opened Visual Studio 2012 (as the project I was using requires that version) and everything was working perfectly.

The issues started happening when I ran Visual Studio 2013. Upon opening VS  I would get warning messages asking me to view an XML log file. The log file would say the following:

 
System.Runtime.InteropServices.COMException (0x80020101): Exception from HRESULT: 0x80020101 at
 TypeScriptLanguageService.JavaScriptRuntime.IJavaScriptExecutionEngine.AddScript(String name, String text, Int32 textLength) at
 TypeScriptLanguageService.JavaScriptRuntime.JavaScriptEngine.LoadScript(String name, String text, Int32 textLength) at 
TypeScriptLanguageService.CompilerServices.TypeScriptServicesFactoryProxy.CreateFactory() at 
System.Lazy`1.CreateValue() at System.Lazy`1.LazyInitValue() at System.Lazy`1.get_Value() at 
TypeScriptLanguageService.CompilerServices.TypeScriptServicesFactoryProxy.get_FactoryObject() at
 TypeScriptLanguageService.CompilerServices.TypeScriptClassifierServicesAccessor.CreateProxy() at
 System.Lazy`1.CreateValue() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at 
System.Lazy`1.get_Value() at 
TypeScriptLanguageService.CompilerServices.TypeScriptClassifierServicesProxy.GetClassificationsForLine(String text, Int32 lexState) at 
TypeScriptLanguageService.Features.Classifier.BufferClassifier.GetClassificationsForLine(ITypeScriptClassifierServicesProxy classifier, String text, Int32 lineNum) at 
TypeScriptLanguageService.Features.Classifier.TypeScriptClassifier.GetClassificationSpans(SnapshotSpan span) at 
Microsoft.VisualStudio.Text.Classification.Implementation.ClassifierTagger.d__0.MoveNext() at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.d__5.MoveNext()

I also noticed that the synthax highlighting was gone from my TypeScript files in VS.

To get things working again all I had to do was run the Visual Studio 2013 Repair tool. Something in the Repair would pickup the existing, older, TypeScript file and would allow it to run in Visual Studio 2013 as expected.


Share this post


blog comments powered by Disqus

Updates

Follow me online at TwitterFacebook or Flickr. If you want to get in touch with me try emailing me.

Latest Tweets