WPF应用程序:从目标计算机上安装获取第三方二进制文件

时间:2013-07-29 19:07:14

标签: .net wpf assemblies

我已经定义了一个使用Visual Studio 2010 SP1的Telerik控件的WPF应用程序。 我已经将Debug文件夹(.exe文件和.dll二进制文件)中的内容复制到另一台机器上,它运行良好。但是,我不希望Telerik二进制文件沿exe文件复制。我希望exe能够在目标机器上使用Telerik的本地安装。

到目前为止我尝试了什么:

  • 我在目标计算机上安装了Telerik,并将二进制文件的路径添加到系统环境路径变量中。但是,我无法运行.exe文件。我怎样才能做到这一点?
  • 我安装了gacutil.exe并将二进制文件添加到GAC。我可以测试:gacutil / l | findstr“Telerik”并找到我添加的所有程序集。
  • 我尝试将这些程序集(Telerik)放在C:\ Program Files \ Reference Assemblies \ Microsoft \ Framework \ v3.0中,同时尝试x64和x86。
  • 我尝试将这些程序集(Telerik)放在C:\ Program Files \ Reference Assemblies \ Microsoft \ Framework \ v3.5中,同时尝试x64和x86。
  • 我还尝试在此处放置程序集: C:\ Program Files(x86)\ Reference Assemblies \ Microsoft \ Framework.NETFramework \ v4.0

以上都不奏效。唯一的办法是将.dll文件放在我不想要的同一目录下的.exe旁边。

编辑:事件日志错误:(应用程序事件日志ID 1000中的应用程序错误)

Faulting application name: WpfApplication.exe, version: 1.0.0.0, time stamp: 0x51f6aef5
Faulting module name: KERNELBASE.dll, version: 6.1.7601.17651, time stamp: 0x4e21213c
Exception code: 0xe0434352
Fault offset: 0x000000000000cacd
Faulting process id: 0x34c
Faulting application start time: 0x01ce8cba7febd62e
Faulting application path: C:\Users\administrator.MyPC\Desktop\Debug\WpfApplication.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Report Id: bdb99d28-f8ad-11e2-89c4-00155db4f007

编辑2 :事件日志错误ID 1026

Application: WpfApplication.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Windows.Markup.XamlParseException
Stack:
   at System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri)
   at System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader, Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel, System.Uri)
   at System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream, System.Windows.Markup.ParserContext, System.Object, Boolean)
   at System.Windows.Application.LoadBamlStreamWithSyncInfo(System.IO.Stream, System.Windows.Markup.ParserContext)
   at System.Windows.Application.LoadComponent(System.Uri, Boolean)
   at System.Windows.Application.DoStartup()
   at System.Windows.Application.<.ctor>b__1(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.Dispatcher.WrappedInvoke(System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Threading.ExecutionContext.runTryCode(System.Object)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.Dispatcher.WrappedInvoke(System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
   at System.Windows.Application.RunInternal(System.Windows.Window)
   at System.Windows.Application.Run()
   at SilverlightApp.App.Main()

谢谢,

1 个答案:

答案 0 :(得分:0)

修改 我添加的GAC程序集与引用程序集版本冲突了!