Проблема SideBySide с отладочной сборкой на виртуальной машине - PullRequest
2 голосов
/ 19 августа 2010

У меня есть приложение .NET, разработанное с использованием Visual Studio 2008, в котором используется C ++ / CLI DLL с именем xVJob.dll .

При попытке запустить я получаю ошибки SideBySideэто на тестовой ВМ.Виртуальная машина работает под управлением Windows Server 2003 с пакетом обновления 2 (SP2).

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

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembl
y 'xVJob, Version=1.0.3883.15147, Culture=neutral, PublicKeyToken=null' or one o
f its dependencies. This application has failed to start because the application
 configuration is incorrect. Reinstalling the application may fix this problem.
(Exception from HRESULT: 0x800736B1)
File name: 'xVJob, Version=1.0.3883.15147, Culture=neutral, PublicKeyToken=null'
 ---> System.Runtime.InteropServices.COMException (0x800736B1): This application
 has failed to start because the application configuration is incorrect. Reinsta
lling the application may fix this problem. (Exception from HRESULT: 0x800736B1)

   at Jobs.JobMonitor.MonitorThread()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, C
ontextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Я скопировал папки Microsoft.VC90.DebugCRT и Microsoft.VC90.DebugMFC из C: \ Program Files \ Microsoft Visual Studio 9.0 \ VC \ redist \ Debug_NonRedist в папку, содержащую исполняемые файлы на виртуальной машине.

Манифест, который создается при сборке xVJob.dll, выглядит следующим образом:

<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level='asInvoker' uiAccess='false' />
      </requestedPrivileges>
    </security>
  </trustInfo>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type='win32' name='Microsoft.VC90.DebugCRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type='win32' name='Microsoft.VC90.DebugMFC' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
    </dependentAssembly>
  </dependency>
</assembly>

Манифесты для библиотек времени выполнения Debug_NonRedist говорят, что они являются версией версии = " 9.0.30729.4148".

В системном журнале событий регистрируются следующие события:

Идентификатор компонента, найденный в манифесте, не соответствует идентификатору запрошенного компонента

Синтаксическая ошибка вфайл манифеста или политики "... \ Microsoft.VC90.DebugCRT \ Microsoft.VC90.DebugCRT.MANIFEST" в строке 4.

Это содержимое файла Microsoft.VC90.DebugCRT.MANIFEST.e:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <noInheritable></noInheritable>
    <assemblyIdentity type="win32" name="Microsoft.VC90.DebugCRT" version="9.0.30729.4148" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    <file name="msvcr90d.dll" hashalg="SHA1" hash="af453f3ee64ff975e704d8241daee695e423e6b8"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>qLOzJNR/6Gg8hHyBY2oMP6cuf4E=</dsig:DigestValue></asmv2:hash></file> <file name="msvcp90d.dll" hashalg="SHA1" hash="7689e9e00acb4d25542085d44724a5759cac93b5"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>ItToY/v0CGa5SMBJskUQJE64qlI=</dsig:DigestValue></asmv2:hash></file> <file name="msvcm90d.dll" hashalg="SHA1" hash="86cfdcb727b087b5bf963d87a14056a10ca46b24"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>QdrglJI4vM+V6T5D6iJv08yi+W0=</dsig:DigestValue></asmv2:hash></file>
</assembly>

Я не понимаю, почему я получаю разные версии среды выполнения в манифесте, который создается с помощью xVJob.dll и файлов среды выполнения.

Пожалуйста, помогите!

1 Ответ

1 голос
/ 20 августа 2010

Ответы на этот вопрос помогли мне решить эту проблему:

Приложение не работает с DLL-библиотеками VS 2008 SP1, предыдущая версия работает с версиями RTM

В частности, определение _BIND_TO_CURRENT_VCLIBS_VERSION в моих настройках препроцессора для всех моих проектов, похоже, добилось цели.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...