应用程序在启动时崩溃 - 缺少 Microsoft.VisualBasic.PowerPacks [英] Application crashes on startup - missing Microsoft.VisualBasic.PowerPacks

查看:19
本文介绍了应用程序在启动时崩溃 - 缺少 Microsoft.VisualBasic.PowerPacks的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个简单的 VB.NET 应用程序,它在开发机器上运行良好.

I wrote a simple VB.NET application which works fine on the development machine.

然而,在另一台机器上,即使安装了 .NET Framework,它在启动时也会崩溃,并出现 System.InvalidOperationException.

However on another machine, even though the .NET Framework is installed, it crashes on startup with System.InvalidOperationException.

它在查找 Visual Basic 程序集时似乎有问题.

There seems to be a problem with it finding the Visual Basic assemblies.

这是失败之一(我用三个点替换了敏感信息):

Here is one of the fails (I replaced sensitive information with three dots):

*** Assembly Binder Log Entry  (16/06/2013 @ 15:45:12) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Users\....
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = ...
LOG: DisplayName = Microsoft.VisualBasic.PowerPacks.Vs, Version=10.0.0.0,    Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///C:/Users/......
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = MSystemAdmin.exe
Calling assembly : MSystemAdmin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.VisualBasic.PowerPacks.Vs, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/.../Desktop/Microsoft.VisualBasic.PowerPacks.Vs.DLL.
LOG: Attempting download of new URL file:///C:/.../Desktop/Microsoft.VisualBasic.PowerPacks.Vs/Microsoft.VisualBasic.PowerPacks.Vs.DLL.
LOG: Attempting download of new URL file:///C:/.../Desktop/Microsoft.VisualBasic.PowerPacks.Vs.EXE.
LOG: Attempting download of new URL file:///C:/.../Desktop/Microsoft.VisualBasic.PowerPacks.Vs/Microsoft.VisualBasic.PowerPacks.Vs.EXE.
LOG: All probing URLs attempted and failed.

推荐答案

PowerPacks 缺失的原因并不清楚,.NET 4 客户端配置文件可能是一个问题.周围有多个版本的 PowerPack,版本编号变得一团糟.在我的机器上,相同的版本被报告为 v2.0.50727,即使它作为版本 10.0 存储在 GAC 中

It isn't that clear why PowerPacks is missing, the .NET 4 Client Profile could be an issue. There have been multiple versions of PowerPacks around and the version numbering got to be a mess. On my machine, that same version is reported as v2.0.50727, even though it is stored in the GAC as version 10.0

最好的办法是回到你的项目.单击解决方案资源管理器"窗口中工具栏上的显示所有文件"图标.现在显示参考节点.展开它并选择 PowerPacks 参考.在属性"窗口中,将复制本地"属性更改为 True.

Best thing to do is to go back to your project. Click the "Show All Files" icon on the toolbar in the Solution Explorer window. That now shows the References node. Expand it and select the PowerPacks reference. In the Properties window, change the Copy Local property to True.

重新构建,您的构建目录现在将拥有 DLL 的副本.将其与 EXE 一起复制到目标机器上.

Rebuild and your build directory now will have a copy of the DLL. Copy it along with the EXE onto the target machine.

这篇关于应用程序在启动时崩溃 - 缺少 Microsoft.VisualBasic.PowerPacks的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆