0

I have a .net framework 4.8 library I have been working on for months in VS19. The project is configured to "Register for COM interop" (which runs regasm.exe on the dll).

Recently (in last few days) I installed VS22 and have been playing around with some .net core projects in here.

I have come back to my original library in VS19 which when compiling now reports (during the regasm call):

Cannot register assembly "X:\<removed>\my-lib.dll". Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.

I get the same result from manually trying to register the dll or trying to load and compile the project in VS22. I have installed all VS19 updates and rebooted the computer, no change.

It is my understanding that netstandard 2.1 has nothing to do with framework and netstandard is not specifically mentioned anywhere in my code or config. The gacutil /l output shows netstandard 2.0.0.0 is installed but nothing else.

It would seem the installation of VS22 may have shifted something in my environment and I'm not sure how to correct it?

John Freebs
  • 435
  • 4
  • 18
  • Regasm.exe must only be used on projects that target the legacy framework, .NET 4.x. Which does not support .netstandard 2.1. Whatever library uses it needs to be downgraded to .netstandard 2.0 – Hans Passant Jan 30 '23 at 19:44
  • That's my point. This project was compiling and registering with regasm fine until VS22 was installed, then started producing this issue without change to the code or properties – John Freebs Jan 30 '23 at 19:52
  • https://learn.microsoft.com/en-us/nuget/consume-packages/reinstalling-and-updating-packages#constraining-upgrade-versions – Hans Passant Jan 30 '23 at 19:58
  • I've checked the versions of all dependencies and packages against a copy of the solution/project from 6 months ago and they are identical in content and version numbers. Baffled – John Freebs Jan 31 '23 at 08:20

0 Answers0