2012-11-05 5 views
6

Mam problemy z MEF, który nie pobiera zależności dla załadowanych komponentów. Mamy strukturę katalogów, który wygląda tak:Zależność wtyczki MEF nie ładuje się jako katalog wtyczek, nie jest sprawdzana

C:/MSMQ/DistributionService/[Główne zastosowanie]

C:/MSMQ/Dostawcy/[składniki plugin]

Oczywiście używamy DirectoryCatalog, wtyczka jest pobierana, ale jedna z jej zależności nie jest. Komunikat o błędzie jest:

2012-11-02 10:46:59,379 [1] FATAL - Assemblies required by Provider are not found 
System.IO.FileNotFoundException: Could not load file or assembly 'BusinessObjects, Version=1.5.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. 
File name: 'BusinessObjects, Version=1.5.0.0, Culture=neutral, PublicKeyToken=null' 

=== Pre-bind state information === 
LOG: User = <redacted> 
LOG: DisplayName = BusinessObjects, Version=1.5.0.0, Culture=neutral, Public 
KeyToken=null 
(Fully-specified) 
LOG: Appbase = file:///C:/MSMQ/DistributionService/ 
LOG: Initial PrivatePath = NULL 
Calling assembly : DistributedServicePropertyComponents, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. 
=== 
LOG: This bind starts in default load context. 
LOG: Using application configuration file: C:\MSMQ\DistributionService\Distr 
ibutionService.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: Policy not being applied to reference at this time (private, custom, partia 
l, or location-based assembly bind). 
LOG: The same bind was seen before, and was failed with hr = 0x80070002. 

2012-11-02 10:46:59,401 [1] FATAL - Assemblies required by Provider are not found 
System.IO.FileNotFoundException: Could not load file or assembly 'BusinessObjects, Version=1.5.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. 
File name: 'BusinessObjects, Version=1.5.0.0, Culture=neutral, PublicKeyToken=null' 

=== Pre-bind state information === 
LOG: User = B2B\addisona 
LOG: DisplayName = BusinessObjects, Version=1.5.0.0, Culture=neutral, Public 
KeyToken=null 
(Fully-specified) 
LOG: Appbase = file:///C:/MSMQ/DistributionService/ 
LOG: Initial PrivatePath = NULL 
Calling assembly : DistributedServicePropertyComponents, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. 
=== 
LOG: This bind starts in default load context. 
LOG: Using application configuration file: C:\MSMQ\DistributionService\DistributionService.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: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). 
LOG: The same bind was seen before, and was failed with hr = 0x80070002. 

Wierzę, że to jest podobne do pytania na MSDN: http://social.msdn.microsoft.com/Forums/en-US/MEFramework/thread/b34ef4f4-e1f1-4f06-bd42-d7b3d5060f6f/ - ale nie rozumiem odpowiedzi.

Czy istnieje sposób dostarczenia ścieżki wyboru zestawu problemów z lub jakiegokolwiek innego sugerowanego rozwiązania?

Problem ten pojawił się dopiero niedawno, ale nie widzę żadnych zmian, które spodziewam się wywołać w historii kontroli kodu źródłowego.

+0

Próbujesz załadować zespół z podpisanego (lub opóźnionego podpisu) kodu? –

+0

o ile mi wiadomo, podpisany kod nie jest zaangażowany (z wyjątkiem bibliotek szkieletowych). – penguat

+0

Następnie próbujesz załadować 64-bitowy zestaw z 32-bitowego kodu? –

Odpowiedz

1

Jedna lub więcej wtyczek zależy od zestawu BusinessObjects, a aplikacja hosta nie odwołuje się do tego zestawu. Aby to naprawić, możesz wykonać jedną z następujących czynności:

  1. Dodaj odwołanie do tego zestawu z głównej aplikacji, aby wtyczki mogły z niego korzystać po załadowaniu.
  2. Dodaj ten zestaw do katalogu C: \ MSMQ \ Providers, aby po załadowaniu wtyczek i wyszukaniu tego zestawu można go znaleźć i załadować.
+4

Ten zestaw znajduje się w katalogu C: \ MSMQ \ Providers i nie został znaleziony. – penguat

Powiązane problemy