(Apologies- I originally posted this under another case that had the same type of error message: Microsoft.VisualBasic.Powerpacks.ShapeContainer not found)

My VS2019  project loads with 53 errors now, after reinstalling everything on a new HDD, after the Dec 2022 MS update killed my old Win 10 system.
Opening the project in VS2019 gives lots of errors like: 'Microsoft.VisualBasic.PowerPacks.ShapeContainer' is not defined
'Microsoft.VisualBasic.PowerPacks.Shape' is not defined
'Microsoft.VisualBasic.PowerPacks.OvalShape' is not defined
or 'FillGradientStyle' is not a member of 'PowerPacks'.

On the old win 10 system, all my projects worked fine. I migrated one of the projects from VS2008 to VS2019 and got it working in both versions.

Now in the new Win 10 install, I installed VS2008 again and VS2019 then copied my project folders over to my C drive.

My old Win 10 system and my old Win 7 system had a directory in Program Files x86 called 'Microsoft Visual Basic 2005 Power Packs', and inside is a folder named '3.0'; but I cannot find this anywhere (the download link provided in the other case does not exist now), so I simply copied that old directory over to my new Win 10 C:\Program Files (x86).

Opening the project in VS2019 gives lots of errors as shown above. I also tried copying my old VS2008 version project folder over, and even opening that in VS2008 it gives these errors now.

The project references in both versions of the project already have C:\Program Files (x86)\Common Files\microsoft shared\Visual Basic Power Packs\1.1\Microsoft.VisualBasic.PowerPacks.Vs.dll and when I select this in the references window, the properties window populates and shows it is Version 9.0.0 (but RunTime Version v2.0.50727). The actual DLL file referenced shows File and Product version 9.0.30729 and says the Product Name is Microsoft (R) Visual Studio (R) 2008. So it seems like both the VS2008 and the VS2019 projects already were referencing the Powerpacks.Vs that was installed by VS2008 and they should work. (They worked in the old Win 10 system before MS ruined it).

The Visual Basic 2005 Power Packs folder was only copied, not installed (possible problem?) but that may be a red herring because the project has a reference to the VisualBasic.PowerPacks.Vs.dll.

What has happened? How do I fix it?

More Info: The Toolbox is empty, but maybe that's because it only populates once a form is open. The main form will not open because it has components from the Powerpacks, like oval shapes and containers, so I understand the toolbox not populating there. When I open my 'About' form, the toolbox populates, but the VisualBasicPowerpacks section has only a Pointer and PrintForm icon! No other shapes/components!

Just tried 'Choose Items' context menu option for the toolbox, but there are no Powerpack entries there, even though the project references include the Powerpacks .Vs.

1

There are 1 answers

0
Chris On

OK, I have finally stumbled upon a solution myself. (Been working on this for a few days).

I believe there may be some incompatibility/confusion in how Visual Studio references powerpack versions. Although my project had powerpacks.Vs referenced, and the Vs dll was there at the path, it clearly wasn't working.

Just now I opened the references window and clicked Add, then browsed to the C:\Program Files (x86)\Microsoft Visual Basic 2005 Power Packs\3.0 directory that I had copied from my old drive, selected the Microsoft.VisualBasic.PowerPacks.dll there (file version 3.0.30214.0) and clicked OK.

Now both powerpack dlls are listed.

Then I opened the main form -bingo- it loaded. The errors seemed to vanish. I opened the toolbox and had to select the main form then another tab a few times before it loaded. I right-clicked in the toolbox and added a new tab, named it Visual Basic Powerpacks 3.0 then right-clicked and selected 'Choose Items". I found all the shapes (rectangle, oval, line) and selected them and clicked oK. They now are in the toolbox.

So I don't know why it didn't just work when I copied the project files over to my new install, but maybe when I opened the project it couldn't find the 3.0 and so changed the reference to the Vs version?

Maybe someone knows what actually happened. At least if anyone is caught by this problem this is quite likely what they need to do.I was lucky that I still have access to that old Powerpacks 3.0 directory, because it seems Microsoft has taken the old download page away.