win7 sp1 系统 使用.net6 wpf prism
需要内容

1、win7 升级win7 sp1
https://www.catalog.update.microsoft.com/Search.aspx?q=KB976932



系统安装补丁

2、安装C++ 运行时

网上自行查找:
Visual C++ 微软常用运行库合集 v2026.06.08 32/64位 静默整合版.exe
3、安装补丁KB3063858
Download 用于基于 x64 的系统的 Windows 7 安全更新程序 (KB3063858) from Official Microsoft Download Center


4 、安装补丁KB4457144


5、wpf 报错 排查
try
{
var view = ContainerLocator.Container. Resolve<object>(AppViews.Login);
AppConsts._logger .Info($"LoginView 手动解析成功: {view?.GetType()}");
}
catch (Exception ex)
{
AppConsts._logger.Error($"手动解析 LoginView 失败:\n{ex}");
throw;
}
Prism.Ioc.ContainerResolutionException: An unexpected error occurred while resolving 'System.Object', with the service name 'LoginView' ---> System.Windows.Markup.XamlParseException: “在“System.Windows.Baml2006.TypeConverterMarkupExtension”上提供值时引发了异常。”,行号为“102”,行位置为“14”。 ---> System.NotSupportedException: 未找到适用于完成此操作的图像处理组件。 ---> System.Runtime.InteropServices.COMException (0x88982F50): 0x88982F50 --- End of inner exception stack trace --- at System.Windows.Media.Imaging.BitmapDecoder.SetupDecoderFromUriOrStream(Uri uri, Stream stream, BitmapCacheOption cacheOption, Guid& clsId, Boolean& isOriginalWritable, Stream& uriStream, UnmanagedMemoryStream& unmanagedMemoryStream, SafeFileHandle& safeFilehandle) at System.Windows.Media.Imaging.BitmapDecoder.CreateFromUriOrStream(Uri baseUri, Uri uri, Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, RequestCachePolicy uriCachePolicy, Boolean insertInDecoderCache) at System.Windows.Media.Imaging.BitmapFrame.CreateFromUriOrStream(Uri baseUri, Uri uri, Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, RequestCachePolicy uriCachePolicy)
6、查找报错原因
程序中使用了
<Border.Background>
<ImageBrush ImageSource="/Assets/backgroud.jpg" Stretch="Uniform" />
</Border.Background>
右键记事本查看backgroud.jpg

原本是webp格式的就改了个格式为.jpg
7、win7 sp1 安装webp库
https://storage.googleapis.com/downloads.webmproject.org/releases/webp/WebpCodecSetup.exe

完成!win7 sp1 中 运行界面如下


浙公网安备 33010602011771号