Cannot resolve dependency to assembly 'System.Threading.Tasks, Version=4.0.10.0

SyntaxEditor .NET Languages Add-on for Windows Forms Forum

Posted 7 years ago by Niklas Kjellander
Version: 12.1.0330
Avatar

Hi,
I've run in to a problem.
I'm using the DotNetProjectResolver and when I invoke AddExternalReference for one of my own assemblies I get the following exception:
System.ApplicationException:
Could not load exported type data for assembly 'MyAssenblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxxx' and type 'MyNamespace.MyType'.
---> System.IO.FileLoadException: Cannot resolve dependency to assembly 'System.Threading.Tasks, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' because it has not been preloaded.
When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.
at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
at System.RuntimeType.RuntimeTypeCache.MemberInfoCache'1.PopulateNestedClasses(Filter filter)
at System.RuntimeType.RuntimeTypeCache.MemberInfoCache'1.GetListByName(Char* pName, Int32 cNameLen, Byte* pUtf8Name, Int32 cUtf8Name, MemberListType listType, CacheType cacheType)
at System.RuntimeType.RuntimeTypeCache.MemberInfoCache'1.Populate(String name, MemberListType listType, CacheType cacheType)
at System.RuntimeType.RuntimeTypeCache.MemberInfoCache'1.GetMemberList(MemberListType listType, String name, CacheType cacheType)
at System.RuntimeType.GetNestedTypeCandidates(String fullname, BindingFlags bindingAttr, Boolean allowPrefixLookup)
at System.RuntimeType.GetMembers(BindingFlags bindingAttr)
at ai..ctor(k A_0, Type A_1)
at k..ctor(Assembly A_0, String A_1, String A_2, String A_3, Boolean A_4)
--- End of inner exception stack trace ---
at k..ctor(Assembly A_0, String A_1, String A_2, String A_3, Boolean A_4)
at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.AssemblyCodeRepository.a.a(c A_0, ResolveEventHandler A_1)
at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.AssemblyCodeRepository.a.a(c A_0, ResolveEventHandler A_1)
at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.AssemblyCodeRepository.Add(String assemblyName, DotNetProjectResolver projectResolver)
at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.DotNetProjectResolver.AddExternalReference(String assemblyName)
<call stack continued in my code>

The assembly that is specified as argument to AddExternalReference references Microsoft.CodeAnalysis. This worked fine until I updated Microsoft.CodeAnalysis to version 2.0.
In other parts of my project I can load the assembly and I can see that System.Threading.Tasks gets loaded.

Also, it's worth mentioning that I'm using an older version of this product from 2009.

Comments (3)

Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Niklas,

Could you throw together a new simple sample project that shows this happening and email it to our support address?  Please reference this thread in the email you send and rename the .zip file extension so it doesn't get spam blocked.  Then we can look at it and see what's happening, or if it still happens in the latest codebase.  Thanks!


Actipro Software Support

Posted 6 years ago by Max Pimmel
Avatar

Hey Guys,

i've got the same problem as niklas.

unfortunately you did not publish any resolutions on this.

What's the resolution for the problem in case of niklas?

sincerely,

Max

[Modified 6 years ago]

Posted 6 years ago by Niklas Kjellander
Avatar

Hi Max,

 

We solved this by upgrading to a newer version of the Syntax editor.

 

sincerely,

 

Niklas

The latest build of this product (v24.1.0) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.