应用程序在启动时崩溃 - 缺少Microsoft.VisualBasic.PowerPacks

E M*_*ett 9 vb.net

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

但是在另一台机器上,即使安装了.NET Framework,它也会在启动时因System.InvalidOperationException而崩溃.

它找到Visual Basic程序集似乎有问题.

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

*** 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.
Run Code Online (Sandbox Code Playgroud)

Han*_*ant 16

现在还不清楚为什么缺少PowerPacks,.NET 4 Client Profile可能是一个问题.有多个版本的PowerPacks,版本编号变得一团糟.在我的机器上,同一版本报告为v2.0.50727,即使它作为版本10.0存储在GAC中

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

重建和您的构建目录现在将具有DLL的副本.将它与EXE一起复制到目标计算机上.


sca*_*er2 15

这是下载Microsoft Visual Basic Power Packs 10.0的URL

http://go.microsoft.com/fwlink/?LinkID=145727&clcid=0x804