Can't load external assembly (dll file)

morpheus93

Client
Регистрация
25.01.2012
Сообщения
1 058
Благодарностей
244
Баллы
63
Hello,

just tried to add a reference to an external assembly to PM (the same way I successfully added assemblies in the past). But when I open the "GAC References" static block and click on "Add" and browse to my dll file an click OK nothing is added in the References window. After closing it and going back to PM the following error is shown in the log (I copied the error from the execkutionLOg.txt from ZPs Log folder, because I can't copy it from PM's log):

"Connection assembly to project"
Message: "System.ApplicationException: Could not load exported type data for assembly 'Rebex.Networking, Version=3.0.6249.0, Culture=neutral, PublicKeyToken=1c4638788972655d'. ---> System.IO.FileLoadException: Could not load file or assembly 'Rebex.Common, Version=2.0.6249.0, Culture=neutral, PublicKeyToken=1c4638788972655d' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)
at System.Reflection.RuntimeAssembly.GetExportedTypes()
at #Rye.#eze..ctor(Assembly assembly, String assemblyFullName, String assemblyLocation, String cachePath, Boolean documentationEnabled)
--- End of inner exception stack trace ---
at #Rye.#eze..ctor(Assembly assembly, String assemblyFullName, String assemblyLocation, String cachePath, Boolean documentationEnabled)

Tried to load the assembly from different locations (ZPs "ExternalAssemblies" folder, from an folder within my project diretory, directly on top of C:/ but nothing works.
When I attach the same assembly to a project within Visual Studio 2008 all works fine.

Thank you for your appreciated help.

Best,
morph
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 453
Благодарностей
5 913
Баллы
113
Is it dotnet library? Otherwise it won't load.
Also recommend you to updated net.framework, the assembly may load dependencies from it.
 

morpheus93

Client
Регистрация
25.01.2012
Сообщения
1 058
Благодарностей
244
Баллы
63
Hello Vlad,

thank you for your fast response. Yes, it is a .NET library (I used it in VS2008 without any problems and ZP itself uses some of the Rebex-Components). But I'dont understand the error-message and why I can't reference these specific assemblies while other assemblies of the same component can be referenced without any problems! My .NET framework is 4.6.2 so it should up-to-date (Windows 7 SP1 64 bit), same error on the production server (Windows Server 2008 R2).

Maybe there is an assembly cache within PM/ZP which causes that error. I read something on stackoverflow.com, when some people had the same error message in Visual Studio they just deleted the reference from there project and re-added it and it works. But I can't do this in ZP/PM
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 453
Благодарностей
5 913
Баллы
113
Devs said you should also GAC reference to Rebex.Common before loading Regex.Networking
 

morpheus93

Client
Регистрация
25.01.2012
Сообщения
1 058
Благодарностей
244
Баллы
63
Thank you Vlad,

I already updated my support ticket.
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 453
Благодарностей
5 913
Баллы
113

morpheus93

Client
Регистрация
25.01.2012
Сообщения
1 058
Благодарностей
244
Баллы
63
Hello Vlad,

I first tried what you suggested ("Devs said you should also GAC reference to Rebex.Common before loading Regex.Networking") but that didn't solve the problem. So I wrote to the developers of the Rebex Components and they told me that Zenno itself already uses some of their libraries, but in an older version, and so they interfere with the new versions of the libraries. They suggested me to manually copy the new libraries into the GAC (used gacutil.exe for this) and this did the trick and now it seems to work (at least on my dev machine, will try it on production later but think it should also work).

PS: I added you the link to their support thread in my support ticket here.
 

Кто просматривает тему: (Всего: 2, Пользователи: 0, Гости: 2)