AssemblyReferences.Add(Assembly): System.IO.FileNotFoundException

SyntaxEditor .NET Languages Add-on for WPF Forum

Posted 11 years ago by Tobias Römer
Version: 12.2.0571
Platform: .NET 4.5
Environment: Windows 8 (64-bit)
Avatar

Hello again,

i am sorry to nag you on and on with valid and invalid queries. But here is my next one:

ERROR: AddPendingVBAssemblies failed for assembly Microsoft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Data.Interop, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.VisualStudio.Data.Interop, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at System.RuntimeTypeHandle.GetDeclaringType(RuntimeType type)
   at System.RuntimeType.get_DeclaringType()
   at System.Type.get_IsNested()
   at #Grc.#1rc.#gFc(Type #4Ub)
   at #Grc.#1rc.#pFc(Type #gi)
   at System.Linq.Enumerable.WhereArrayIterator`1.MoveNext()
   at #Grc.#1rc.#XEc(Assembly #sxc)
   at #Grc.#1rc.#iFc(Assembly #sxc)
   at #Grc.#0rc..ctor(Assembly assembly, IAssemblyName assemblyName, IBinaryAssemblyMetadata metadata)
   at ActiproSoftware.Text.Languages.DotNet.Reflection.Implementation.AssemblyRepositoryBase.Create(Assembly assembly, IAssemblyName assemblyName, IBinaryAssemblyMetadata metadata)
   at ActiproSoftware.Text.Languages.DotNet.Reflection.Implementation.FileBasedAssemblyRepository.Create(Assembly assembly, IAssemblyName assemblyName, IBinaryAssemblyMetadata metadata)
   at ActiproSoftware.Text.Languages.DotNet.Reflection.Implementation.FileBasedAssemblyRepository.GetOrCreate(Assembly assembly, IAssemblyName assemblyName, String location)
   at ActiproSoftware.Text.Languages.DotNet.Reflection.Implementation.AssemblyRepositoryBase.Load(Assembly assembly, IAssemblyName assemblyName)
   at #Grc.#tsc.Add(Assembly #sxc, IAssemblyName #4tc)
   at #Grc.#tsc.Add(Assembly #sxc)
   at MyCompany.MyApp.App.AddPendingVBAssemblies() in d:\Documents\!svn\MyCompany\MyApp\Trunk\Src\MyCompany\MyApp\App.xaml.cs:line 224

=== Pre-bind state information ===
LOG: User = MYCOMPANY\USER
LOG: DisplayName = Microsoft.VisualStudio.Data.Interop, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
 (Fully-specified)
LOG: Appbase = file:///D:/Documents/!svn/MyCompany/MyApp/Trunk/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : Microsoft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\Documents\!svn\MyCompany\MyApp\Trunk\bin\Debug\MyApp.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.VisualStudio.Data.Interop, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: The same bind was seen before, and was failed with hr = 0x80070002.

From what I understand this is because an assembly referenced by the assembly to be added is not available. In my particular use case, is it ok to skip all types that cannot be resolved because of missing referenced assemblies. For example, something like the following (hence probably not applicable when fixing the problem above) would be valid for me:

private static IEnumerable<Type> GetLoadableTypes(Assembly assembly)
{
    try
    {
        return assembly.GetTypes();
    }
    catch(ReflectionTypeLoadException ex)
    {
        return ex.Types.Where(type => type != null);
    }
}

 Is there a way to load AssemblyReferences partially, even if referenced assembly are not available?

As always, thank you in advance for any help. This time I really do use the most recent Version as stated above (2012.2.571).

Comments (2)

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

Hi Tobias,

Actually we already have the same thing in our code.  So there's unfortunately probably not anything else we can do to help.


Actipro Software Support

Posted 11 years ago by Nicolas
Avatar

Yes you can help us !

Please implement an AssemblyRepository without any Reflection usage like I suggest in my post from 2013-03-19.

The latest build of this product (v24.1.2) was released 2 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.