Unity 5.5.1f1 VS 2015 SyntaxTree.VisualStudio.Unity FileLoadException

Hi,

I get an error if I open a unity project with the new unity version and Visual Studio Tool For Unity 2.8.1.0:

This is the entry of the ActivityLog.xml from Visual Studio (German):

575
2017/02/10 11:01:44.655
Error

Editor or Editor Extension System.IO.FileLoadException: Die Datei oder Assembly "SyntaxTree.VisualStudio.Unity, Version=2.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040) Dateiname: "SyntaxTree.VisualStudio.Unity, Version=2.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" bei System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) bei System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) bei System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) bei System.Reflection.Assembly.Load(AssemblyName assemblyRef) bei Microsoft.VisualStudio.ExtensibilityHosting.FaultCatchingAssemblyLoader.b__15_0(AssemblyName assemblyNameParam) bei Microsoft.VisualStudio.ExtensibilityHosting.Utilities.SafeGetOrAdd[TKey,TValue](IDictionary`2 dictionary, TKey key, Object lockObj, Func`2 valueFactory) bei Microsoft.VisualStudio.ExtensibilityHosting.FaultCatchingAssemblyLoader.LoadAssembly(AssemblyName assemblyName) bei Microsoft.VisualStudio.Composition.Reflection.ResolverExtensions.Resolve(ConstructorRef constructorRef) bei Microsoft.VisualStudio.Composition.RuntimeComposition.RuntimePart.get_ImportingConstructor() bei Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue() bei Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create() bei Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState) bei Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState) bei Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose() bei Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.b__0() --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.b__0() bei Microsoft.VisualStudio.Composition.DelegateServices.<>c__DisplayClass2_0`1.b__0() bei System.Lazy`1.CreateValue() --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Lazy`1.get_Value() bei Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.GatherTaggers(ITextBuffer textBuffer)

I don’t know where the extension is looking for this assembly or where it has to be.

Maybe someone could help here…

Regards
Stefan

I’m getting the same issue, with Unity 5.5.2f1 and Visual Studio Tools for Unity 2.8.2.0. I just upgraded from 5.5.0f3 and now can’t use Visual Studio as it crashes when I start using it.

Same as Daveoh except Visual Studio Tools for Unity 2.8.1.0

Deleting cache helped me:
%localappdata%\Microsoft\VisualStudio\14.0\ComponentModelCache

11 Likes

Thanks frg_kova your suggestion of deleting the cache also helped me :slight_smile:

Thanks @frg_kova

Thank you @frg_kova !!!

I fixed this by uninstalling “Microsoft Visual Studio 2015 Tools for Unity” from Programs and Features, and reinstalling an older version, but any version probably works. A new version has just been released too, which I have installed and am successfully using: Visual Studio 2015 Tools for Unity - Visual Studio Marketplace

Thanks a lot to frg_kova :slight_smile:
Reinstalling doesn’t work for me, but clearing the ComponentModelCache Folder does the trick!

The same error occurs on Version 2.8.2.0, just released 3 days ago, for Unity Version 5.5.2f1. Reported to unity, but it was a month ago too, so apparently no desire to fix the bug…

Deleting the cache file in the directory:

%localappdata%\Microsoft\VisualStudio\14.0\ComponentModelCache

did fix it. But if it’s that easy a fix, why not built into installer…

1 Like

Got same issue with same fix on updating Unity Tools in VS - poor experience!

Thanks for the fix! Has anyone filed an official bug on this yet? This is really something Unity QA should catch and address. Upgrading shouldn’t cause Visual Studio to crash with no obvious fix. That’s a pretty big deal.

The tricks works wonder ! Thanks @frg_kova

Paste %localappdata%\Microsoft\VisualStudio\14.0\ComponentModelCache into File Explorer and delete all files in folder worked a treat, thanks @frg_kova !

Many thanks @frg_kova ! Worked like a charm :sunglasses:

Saved me hours of pain. Thanks @frg_kova

Thanks @frg_kova