问题描述
我写了一个小的实用程序可以在我的机器上运行(Win7 64 w / VS2012)。
当我复制exe时,支持dll和.exe.config文件到另一个Win7 64(Office 2012)系统(在物理系统和VM系统上都尝试过)无法通过显示信息的对话框执行(如下所示)。
Bing搜索似乎暗示我最可能的原因是不正确的。 NET版安装了wrt建立目标。安装了.NET 4.0,构建目标是.NET 4 Client。
构建环境是否安装了.NET 4.5这一事实意味着针对.NET 4 Client确实最终需要4.5?如果是这样,有没有办法构建真正针对.NET 4?
任何其他提示/建议?
谢谢
更多信息:
我尝试在VM上安装.NET 4.5.1并没有明显区别。
编辑#2:
更多信息:
我从VS安装中复制了包含-foc文件夹的FUSLOGVW(程序集绑定日志查看器)构建系统到VM,并执行它。记录绑定显示
applicationName .resources的绑定失败,版本= 1.0.0.0
资源应该内置到exe中,项目中没有单独的资源程序集\ bin \\ .Release文件夹。
那么我错过了什么?
编辑#3:
我开始怀疑它与文化有关:
应用程序显示(在程序集绑定日志中)为Culture = neutral
但它正在寻找资源,因为Culture = en-US
在AssemblyInfo中。 cs和项目设置我不指定任何文化。就像我编写的其他程序一样......它可以在开发系统上直接启动exe。
我尝试设置NeutralResourcesLanguage属性和< UICulture>在.csproj文件中。这导致资源被构建到en-US文件夹下的附属程序集中,然而,当MainWindow.xaml.cs初始化时,会导致在开发系统上抛出异常。 br $>
I've written a small utility program that "works on my machine" (Win7 64 w/VS2012).
When I copy the exe, support dll and .exe.config files to another Win7 64 (Office 2012) system (attempted on both physical and VM systems) it fails to execute with a dialog showing info (below).
Bing searches seem to imply that my most likely cause is incorrect .NET version installed w.r.t. build target. .NET 4.0 is installed and the build target is .NET 4 Client.
Does the fact that the build environment has .NET 4.5 installed mean that targeting .NET 4 Client really will end up requiring 4.5? If so, is there a way to build to really target .NET 4?
Any other hints/suggestions?
Thanks
More info:
I tried installing .NET 4.5.1 on the VM and it made no apparent difference.
EDIT #2:
Still more info:
I copied the FUSLOGVW (Assembly Binding Log Viewer) containing-folder from the VS install on the build system over to the VM, and executed it. Logging the bindings shows a binding failure for the
applicationName.resources, Version=1.0.0.0
The resources should be built into the exe, there is no separate resources assembly in the project\bin\Release folder.
So what am I missing?
EDIT #3:
I'm beginning to suspect it has to do with the Culture:
The application shows (in the Assembly Binding Log) as Culture=neutral
but it is looking for resources as Culture=en-US
In the AssemblyInfo.cs and Project settings I do not specify any culture. Just like other programs I've written... And it works on the development system just launching the exe directly.
I tried setting the NeutralResourcesLanguage attribute and <UICulture> in the .csproj file. This caused the resources to be built into a satellite assembly under a en-US folder, however, that then caused an exception to be thrown on the development system when the MainWindow.xaml.cs was initializing.
Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: XXXX YYYY ZZZZ.exe
Problem Signature 02: 1.0.0.0
Problem Signature 03: 532ce19e
Problem Signature 04: PresentationFramework
Problem Signature 05: 4.0.0.0
Problem Signature 06: 4ba1f8db
Problem Signature 07: f99
Problem Signature 08: cc
Problem Signature 09: System.InvalidOperationException
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 1033
Additional Information 1: 6404
Additional Information 2: 640404062cbb864fc4242ad6a13f7c84
Additional Information 3: 1237
Additional Information 4: 1237d14f88a4e19132828c7daa02ae3b
推荐答案
<Run Text="{Binding Path=FilePath, Mode=OneWay, FallbackValue=C:/abc/def/foo.csv}" />
但为什么 Binding
在运行
(在 TextBlock
中)不是 OneWay
默认情况下?
为什么它在开发系统上没有失败?
But why would the Binding
in the Run
(in a TextBlock
) not be OneWay
by default?
And why didn't it fail on the development system?
这篇关于将exe + dll复制到VM无法执行 - 在哪里查看? CLR20r3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!