在 Windows XP 上运行 WPF 应用程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/450563/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Running a WPF application on Windows XP
提问by Richard B
I recently built a new application using WPF, so that I can learn the new technology. Now that I am trying to deploy the application, it appears as if it is running fine on a Vista system, but on a Windows XP SP2 machine with the .Net fx 3.5SP1, it's not able to load the PresentationFramework.dll file.
我最近使用 WPF 构建了一个新应用程序,以便我可以学习新技术。现在我正在尝试部署该应用程序,它似乎在 Vista 系统上运行良好,但在带有 .Net fx 3.5SP1 的 Windows XP SP2 计算机上,它无法加载 PresentationFramework.dll 文件。
I did some further investigation into this and discovered that there is a slight build difference between the PresentationFramework.dll files on my xp test machines vs. what is on my Vista development machine.
我对此做了一些进一步调查,发现我的 xp 测试机器上的 PresentationFramework.dll 文件与我的 Vista 开发机器上的文件之间存在轻微的构建差异。
What I'm curious about is if anyone else has run into this issue as well, and what they did to remedy the situation so that they could develop on Windows Vista, but deploy the developed application to both Vista and XP clients.
我很好奇的是,是否有其他人也遇到过这个问题,以及他们做了什么来补救这种情况,以便他们可以在 Windows Vista 上开发,但将开发的应用程序部署到 Vista 和 XP 客户端。
Thanks.
谢谢。
I need to add to this a bit... on the vista machine and on the client machine, I've got .Net Fx 3.5 SP1. I had done a bit of digging, and found out that the PresentationFramework.dll file is the same, except the last set of versioning numbers.
我需要补充一点......在vista机器和客户端机器上,我有.Net Fx 3.5 SP1。我做了一些挖掘,发现 PresentationFramework.dll 文件是相同的,除了最后一组版本号。
Has anyone found a decent work around for this issue?
有没有人找到解决这个问题的体面的工作?
回答by Richard B
Sorry that I left this stagnant, but I figured out the issue I was running into. Turned out that there was corruption in the Windows XP box I was using as a test bed.
对不起,我让这个停滞不前,但我想出了我遇到的问题。结果发现我用作测试平台的 Windows XP 机器损坏了。
I was working between stackoverflow and another forum for the package I was writing the Add-in for. When I learned of the answer, this is what I posted, in case I ran into issue in the future.
我在 stackoverflow 和另一个论坛之间为我正在编写插件的包工作。当我得知答案时,这就是我发布的内容,以防我将来遇到问题。
I thought that I'd post this here, so that I would have reference, and also in case anyone else would need reference to it for the future... I'm working on another Dinerware Add-on using WPF, and although it was running fine on my development machine, every time I'd go to run it on a test machine (a machine ghosted like it was in the field at a customer's location), I kept getting weird processing errors.
I did hours of searching online, only to come up empty handed until I ran across this article:
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/6e5de3d8-fc02-4504-b00f-7a2192d24a48/
which gives a link to the download of the WIC (Windows Imaging Components), located here:
For some reason, what is/was happening is that the Windows Imaging components have become corrupt against what my application is looking for. TO fix the issue, you have to:
1) navigate to %windir%\$NtUninstallWIC$\spuninst\ and run the spuninst.exe file in there. That will remove the Windows imaging components. 2) after you have completely removed the components, you will then re-install them using the second link from above.
So far, I've not run into any further issues.
What a crazy thing that was?!?!?!?!?!?!!
Hopefully, if someone else runs into this issue, I may be able to help them out quick by >putting this out there.
我想我会在这里发布这个,这样我就可以参考,以防其他人将来需要参考它......我正在使用 WPF 开发另一个 Dinerware Add-on,尽管它在我的开发机器上运行良好,每次我去测试机器上运行它时(一台机器就像在客户位置的现场一样),我不断收到奇怪的处理错误。
我在网上搜索了几个小时,结果空手而归,直到我看到这篇文章:
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/6e5de3d8-fc02-4504-b00f-7a2192d24a48/
它提供了 WIC(Windows 成像组件)的下载链接,位于此处:
出于某种原因,正在/正在发生的事情是 Windows Imaging 组件已经损坏了我的应用程序正在寻找的内容。要解决此问题,您必须:
1) 导航到 %windir%\$NtUninstallWIC$\spuninst\ 并在其中运行 spuninst.exe 文件。这将删除 Windows 映像组件。2) 完全删除组件后,您将使用上面的第二个链接重新安装它们。
到目前为止,我还没有遇到任何进一步的问题。
那是什么疯狂的事情?!?!?!?!?!?!
希望如果其他人遇到这个问题,我可以通过 > 把它放在那里来快速帮助他们。
As I said on that forum... hopefully this helps someone else out that runs into this issue in the future.
正如我在那个论坛上所说的那样......希望这可以帮助其他人在未来遇到这个问题。
回答by Richard B
I've done a bit more experimentation and built a test WPF project and used a Setup and Deployment project instead of a WiX installer. for some reason, the application is working fine when its installed with the Setup and Deployment installer, but when using WiX, it's having issues...
我做了更多的实验并构建了一个测试 WPF 项目,并使用了安装和部署项目而不是 WiX 安装程序。出于某种原因,该应用程序在使用 Setup and Deployment 安装程序安装时运行良好,但是在使用 WiX 时,它出现了问题...
Beginning to think the issue has to do with WiX, and not the .Net Fx version/build
开始认为问题与 WiX 有关,而不是 .Net Fx 版本/构建
回答by Steven Robbins
You can have this problem sometimes with templates and Blend, although I thought it had been fixed in the latest Blend. Basically when Blend "pulls in" information for making a new template, it can sometimes copy in Aero only stuff from Vista, which means the control you then create is then reliant on Vista :-(
模板和 Blend 有时会遇到这个问题,尽管我认为它已在最新的 Blend 中修复。基本上,当 Blend 为制作新模板“拉入”信息时,它有时只能从 Vista 中复制 Aero 中的内容,这意味着您随后创建的控件将依赖于 Vista :-(
I did think this was fixed though, although you may have been bitten by it if the project has taken a while to put together.
不过,我确实认为这是固定的,尽管如果项目需要一段时间才能完成,您可能会被它咬伤。
回答by Ramesh Soni
Make sure that .NET Version on your Vista and XP machine are same.
确保您的 Vista 和 XP 机器上的 .NET 版本相同。