WPF .Net 4.0 응용 프로그램은 최근까지 WinPE 4.0에서 제대로 실행되었습니다. 아래 코드를 추가하면 WinPE 4.0에서 실행될 때 응용 프로그램이 중단됩니다. 참고 응용 프로그램은 여전히이 코드는 나를 트 리뷰 항목의 내용을 기반으로 내 트 리뷰 컨트롤에 다른 이미지를 사용할 수있는 Windows 7의 x64에서 잘 실행 및 Windows 2012WinPE 4.0에서는 예외가 발생하지만 Windows 7/Windows 2012에서는 예외가 발생하는 이유는 무엇입니까?
[ValueConversion(typeof(string), typeof(bool))]
public class HeaderToImageConverter : IValueConverter
{
public static HeaderToImageConverter Instance =
new HeaderToImageConverter();
public object Convert(object value, Type targetType,
object parameter, CultureInfo culture)
{
if ((value as string).Contains("corp.com"))
{
Uri uri = new Uri
("pack://application:,,,/Images/DeployWiz_Network.png");
BitmapImage source = new BitmapImage();
source.BeginInit();
source.UriSource = uri;
source.DecodePixelHeight = 40;
source.EndInit();
return source;
}
else
{
Uri uri = new Uri
("pack://application:,,,/Images/ou2.png");
BitmapImage source = new BitmapImage();
source.BeginInit();
source.UriSource = uri;
source.DecodePixelHeight = 20;
source.EndInit();
return source;
}
}
public object ConvertBack(object value, Type targetType,
object parameter, CultureInfo culture)
{
throw new NotSupportedException("Cannot convert back");
}
}
.
그래서, 내 .EXE와 동일한 폴더에 누락 된 .DLL을두고, 나는이 예외가 : WinPE를 아래에서이 프로그램을 실행할 때
, 나는 다음과 같은 예외가
은 WinPE를 작동하게하지 않습니다 .DLL에 대한 펑키 뭔가가 있나요? 내 목표를 달성하고이 .dll을 피하려면 WPF에서 BitmapImage 외에 사용할 수있는 다른 클래스가 있습니까? BitmapImage는이 .dll이 필요한 클래스까지도 포함합니까? 내 응용 프로그램을 깰 수있는 유일한 새 코드이기 때문에 그것이 있다고 가정합니다.
:-) 나는 내 자신의 C에서 mscms.dll을 복사. 그럼 난 내 자신의 c : \ windows \ syswow64 폴더에서 mscms.dll을 내 .exe와 같은 폴더에 복사했고, 여전히 작동하지 않았다. 그 밖의 무엇을 시도 할 수 있습니까? 64 비트 WinPE를 사용하고 있습니다. – Dbloom
mscms.dll을로드하려고 시도 할 때 어떤 디렉토리가 탐색되는지 확인해야합니다. 먼저 응용 프로그램 디렉토리를 먼저 찾지 않아도됩니다. 퓨전 로그 뷰어를 사용하여 실패를 볼 수 있으며 그 이유는 다음과 같습니다. http://msdn.microsoft.com/en-us/library/e74a18c4(v=VS.100).aspx ... http : //blogs.msdn .com/b/suzcook/archive/2003/05/29/57120.aspx –