Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Application crashes on startup - missing Microsoft.VisualBasic.PowerPacks

Tags:

vb.net

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

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

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.
like image 545
E Mett Avatar asked Jun 16 '13 13:06

E Mett


3 Answers

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

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.

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

like image 53
Hans Passant Avatar answered Nov 18 '22 16:11

Hans Passant


Here is the URL to download Microsoft Visual Basic Power Packs 10.0

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

like image 40
scarver2 Avatar answered Nov 18 '22 16:11

scarver2


Apparently, it seems to be a problem with the "PowerPacks"; these are additional controls to the ones given by default in Visual Studio (in the form design part, under "Toolbox"). If you install the required package on the target computer, everything should be fine.

I had this problem in the past and my recommendation is not relying on these elements: they include nice-to-have features (in my case, it was an elliptic shape) but might be replaced with a bit of work and simpler objects. If you want to sell your program to a more or less wide audience, relying on this might become a problem: this package is not installed by default on virtually any computer and thus you would have to ask your clients to go ahead with the installation. Locating these specific controls is straightforward: on the "Toolbox" they should be listed under "PowerPacks" or similar.


After reading the Hans Passant's comment, I do recall that a .dll file has to be put in the same directory than the executable, but I am under the impression that the PowerPacks package from the provided link has to be installed anyway (at least, on computers not having Visual Studio).

like image 1
varocarbas Avatar answered Nov 18 '22 15:11

varocarbas