CRT
От: _pk_ Россия  
Дата: 13.08.10 10:25
Оценка:
Здравствуйте!
У меня есть небольшая проблема...
Имеется MyAsm.Native.dll, которая написана на managed С++, она тянет за собой несколько моих же C#-сборок.
Есть msi-инсталлятор, который подхватил microsoft_vc90_crt_x86.msm и policy_9_0_Microsoft_VC90_CRT_x86.msm.
Теперь, собственно, вопрос: почему на некоторых машинах она не грузится — Assembly.Load() вылетает с исключением System.IO.FileNotFoundException?
Я никак не могу понять, куда надо смотреть, в WinSxS присутствует эта самая CRT, причем в двух экземплярах: 9.0.21022.8 и 9.0.30729.1. Чего она не может найти?

Манифест выглядит примерно так:
.assembly extern mscorlib
{
}
.assembly extern System
{
}
.assembly extern System.Windows.Forms
{
}
.assembly extern MyAsm.Utilities
{
}
.assembly extern MyAsm.Enumerations
{
}
.assembly extern MyAsm.ProjectScheme
{
}
.assembly extern Microsoft.VisualC
{
}
.assembly MyAsm.Native
{
}

Все MyAsm.* грузятся без проблем.
crt microsoft.visualc
Re: CRT
От: _FRED_ Черногория
Дата: 13.08.10 12:11
Оценка:
Здравствуйте, _pk_, Вы писали:

__>Имеется MyAsm.Native.dll, которая написана на managed С++, она тянет за собой несколько моих же C#-сборок.

__>Есть msi-инсталлятор, который подхватил microsoft_vc90_crt_x86.msm и policy_9_0_Microsoft_VC90_CRT_x86.msm.
__>Теперь, собственно, вопрос: почему на некоторых машинах она не грузится — Assembly.Load() вылетает с исключением System.IO.FileNotFoundException?

Debugging load problems using fusion log
How to enable assembly bind failure logging (FUSION) in .NET
Help will always be given at Hogwarts to those who ask for it.
Re[2]: CRT
От: _pk_ Россия  
Дата: 16.08.10 13:54
Оценка:
Здравствуйте, _FRED_, Вы писали:

_FR>Debugging load problems using fusion log

_FR>How to enable assembly bind failure logging (FUSION) in .NET

Спасибо! Посмотрел логи и еще больше запутался. На обеих машинах не загружаются две сборки (отличия курсивом: ru-RU и ru):

*** Assembly Binder Log Entry  (16.08.2010 @ 17:32:23) ***

The operation failed.
Bind result: hr = 0x80070002. Не удается найти указанный файл.

Assembly manager loaded from:  C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable  C:\WINDOWS\system32\MsiExec.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: User = NT AUTHORITY\SYSTEM
LOG: DisplayName = System.Configuration.Install.resources, Version=2.0.0.0, Culture=ru-RU, PublicKeyToken=b03f5f7f11d50a3a
 (Fully-specified)
LOG: Appbase = file:///C:/WINDOWS/system32/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file: C:\DOCUME~1\klyonov\LOCALS~1\Temp\CFGE61.tmp
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: System.Configuration.Install.resources, Version=2.0.0.0, Culture=ru-RU, PublicKeyToken=b03f5f7f11d50a3a
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/WINDOWS/system32/ru-RU/System.Configuration.Install.resources.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/system32/ru-RU/System.Configuration.Install.resources/System.Configuration.Install.resources.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/system32/ru-RU/System.Configuration.Install.resources.EXE.
LOG: Attempting download of new URL file:///C:/WINDOWS/system32/ru-RU/System.Configuration.Install.resources/System.Configuration.Install.resources.EXE.
LOG: All probing URLs attempted and failed.

На нерабочей плюс к тому не загружаются еще две, которые даже не пытаются грузиться на рабочей (отличия точно такие же):

*** Assembly Binder Log Entry  (16.08.2010 @ 16:30:28) ***

The operation failed.
Bind result: hr = 0x80070002. Не удается найти указанный файл.

Assembly manager loaded from:  C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable  C:\WINDOWS\system32\MsiExec.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: User = NT AUTHORITY\SYSTEM
LOG: DisplayName = mscorlib.resources, Version=2.0.0.0, Culture=ru-RU, PublicKeyToken=b77a5c561934e089
 (Fully-specified)
LOG: Appbase = file:///C:/WINDOWS/system32/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : (Unknown).
===
LOG: Start binding of native image mscorlib.resources, Version=2.0.0.0, Culture=ru-RU, PublicKeyToken=b77a5c561934e089.
WRN: No matching native image found.

При этом сборка, которая не грузится при помощи Assembly.Load(), в логе имеет вот такой вид (Native Images):
*** Assembly Binder Log Entry  (16.08.2010 @ 17:43:48) ***

The operation was successful.
Bind result: hr = 0x0. Операция успешно завершена.

Assembly manager loaded from:  C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable  C:\WINDOWS\system32\MsiExec.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: User = NT AUTHORITY\SYSTEM
LOG: DisplayName = MyAsm.Native, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b213caad7ab548ca
 (Fully-specified)
LOG: Appbase = file:///C:/WINDOWS/system32/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : MyAsm.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=e4ff3749faca749d.
===
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().

И такой (Default):
*** Assembly Binder Log Entry  (16.08.2010 @ 17:49:24) ***

The operation was successful.
Bind result: hr = 0x0. Операция успешно завершена.

Assembly manager loaded from:  C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable  C:\WINDOWS\system32\MsiExec.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: User = NT AUTHORITY\SYSTEM
LOG: DisplayName = MyAsm.Native, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b213caad7ab548ca
 (Fully-specified)
LOG: Appbase = file:///C:/WINDOWS/system32/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : MyAsm.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=e4ff3749faca749d.
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: No application configuration file found.
LOG: Using host configuration file: C:\DOCUME~1\klyonov\LOCALS~1\Temp\CFGE95.tmp
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: MyAsm.Native, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b213caad7ab548ca
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/WINDOWS/system32/MyAsm.Native.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/system32/MyAsm.Native/MyAsm.Native.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/system32/MyAsm.Native.EXE.
LOG: Attempting download of new URL file:///C:/WINDOWS/system32/MyAsm.Native/MyAsm.Native.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/MyAsm/MyAsm.Native.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Program Files\MyAsm\MyAsm.Native.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: MyAsm.Native, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b213caad7ab548ca
LOG: Where-ref bind Codebase does not match what is found in default context. Keep the result in LoadFrom context.
LOG: Binding succeeds. Returns assembly from C:\Program Files\MyAsm\MyAsm.Native.dll.
LOG: Assembly is loaded in LoadFrom load context.

Что же ей не нравится?
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.