При использовании PresentationFramework.Aero мне нужно установить для параметра «Копировать локальное» значение true (и включить его в мой проект установки)?

В моем проекте WPF используется клиентский профиль .NET 4. Когда я добавляю


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

Первое случайное исключение типа {{ 1}} 'System.Windows.Markup.XamlParseException' произошло в PresentationFramework.dll

. Дополнительная информация: 'Set property ' System.Windows.ResourceDictionary.Source 'вызвал исключение.' Строка номер "14" и позиция строки "14".

Когда я устанавливаю для свойства «Копировать локально» PresentationFramework.Aero значение true, все работает, и исключение исчезает.

«Копировать локально» помещает копию PresentationFramework.Aero в мой выходной каталог, и поэтому мне нужно включить ее в мой проект установки. Почему это необходимо? Согласно MSDN PresentationFramework.aero включен в профиль клиента .NET framework 4.0 и, следовательно, в GAC. Мне неудобно развертывать файл фреймворка с моим приложением.

Дата:

Как предложил Ханс Пассан, я проверил, что каталог PresentationFramework.Aero существует в C: \ windows \ microsoft.net \ assembly \ gac_msil . Затем я использовал fuslogvw.exe для создания следующего журнала, созданного при запуске моего приложения «SetACL Studio.exe» без PresentationFramework.Aero.dll в каталоге приложения. Интересно, что загрузчик даже не проверяет GAC . Почему?

*** Assembly Binder Log Entry  (18.11.2011 @ 17:13:27) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable  D:\Daten\Helge\Programmierung\SetACL Studio\Source\Bin\Debug\SetACL Studio.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: User = HKT520\Helge
LOG: DisplayName = PresentationFramework.Aero, Culture=neutral
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: PresentationFramework.Aero, Culture=neutral | Domain ID: 1
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///D:/Daten/Helge/Programmierung/SetACL Studio/Source/Bin/Debug/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = SetACL Studio.exe
Calling assembly : PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\Daten\Helge\Programmierung\SetACL Studio\Source\Bin\Debug\SetACL Studio.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: Attempting download of new URL file:///D:/Daten/Helge/Programmierung/SetACL Studio/Source/Bin/Debug/PresentationFramework.Aero.DLL.
LOG: Attempting download of new URL file:///D:/Daten/Helge/Programmierung/SetACL Studio/Source/Bin/Debug/PresentationFramework.Aero/PresentationFramework.Aero.DLL.
LOG: Attempting download of new URL file:///D:/Daten/Helge/Programmierung/SetACL Studio/Source/Bin/Debug/PresentationFramework.Aero.EXE.
LOG: Attempting download of new URL file:///D:/Daten/Helge/Programmierung/SetACL Studio/Source/Bin/Debug/PresentationFramework.Aero/PresentationFramework.Aero.EXE.
LOG: All probing URLs attempted and failed.

Обновление 2:

Это результат работы gacutil:

C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin>gacutil.exe /l presentationframework.aero
Microsoft (R) .NET Global Assembly Cache Utility.  Version 3.5.30729.1
Copyright (c) Microsoft Corporation.  All rights reserved.

The Global Assembly Cache contains the following assemblies:
  presentationframework.aero, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL

Number of items = 1

11
задан H.B. 31 January 2013 в 11:47
поделиться