【发布时间】:2013-11-11 09:17:28
【问题描述】:
我用 Visual Studio 2012 在 windows 7 机器上编写了一个 .NET 4.5 应用程序,它在 windows 7 上安装和运行良好。
当我尝试在 Windows 8 机器上部署它时,它发生了灾难性的崩溃,事件查看器中的输出不是很有用。
Dependency walker 的跟踪表明它在一个/一些核心 Windows dll 中找不到方法。
例如:
LoadLibraryExW("C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscoreei.dll", 0x0000000000000000, LOAD_WITH_ALTERED_SEARCH_PATH) returned 0x00007FFDEA780000.
GetProcAddress(0x00007FFDEA780000 [MSCOREEI.DLL], "RegisterShimImplCallback") called from "MSCOREE.DLL" at address 0x00007FFDEA82F3A9 and returned 0x00007FFDEA783444.
GetProcAddress(0x00007FFDEA780000 [MSCOREEI.DLL], "RegisterShimImplCleanupCallback") called from "MSCOREE.DLL" at address 0x00007FFDEA82F3BC and returned NULL. Error: The specified procedure could not be found (127).
在检查 mscoreei.dll 时,我注意到:
Windows 7 机器
v4.0.30319.18408
613,456 字节
Windows 8 机器
v4.0.30319.33440
633,424 字节
两台机器(根据ASoft .NET version detector)都有.NET 4.5 Full。
为什么我的机器有不同的 .NET 版本,我如何确保我的 windows 7 机器上的编译器针对 windows 8 机器的正确版本?
【问题讨论】:
-
猜测 - 服务包/安全补丁。也许运行 Windows 更新?
-
@Bridge:我已经在这两个平台上运行了一百万次 Windows 更新。
-
我看到你已经标记了 Windows 8.1,它带有 .net 4.5.1,但是在带有 .net 4.5.0 的 Windows 7 上使用 Visual Studio 2012,这就是版本号的原因是不同的。不知道为什么它会灾难性地失败!
-
@JMK:我已经在我的 Windows 7 机器上安装了 4.5.1,以防万一。
-
奇怪,it looks like LOAD_WITH_ALTERED_SEARCH_PATH 在 Windows 7 上已被弃用,也许它在 Windows 8.1 上根本不存在?
标签: .net visual-studio-2012 .net-4.5 windows-8.1