upgrading vb6 - warning MSB3287: Cannot load type library for reference

In the anticipation that we will eventually be forced off our 32-bit systems onto 64-bit ones, I am going to make a start on converting and upgrading some VB6 code.

I can open up the old VB6 projects using VS2005, and get a compile/build under way – so far, so good.

Naturally, a fairly lengthy list of errors resulted. Most I have been able to fix, but there are a few I am stuck on. The first is the error message

C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning MSB3287: Cannot load type library for reference "AxMSMAPI". Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

I have found MSMAPI.DLL on the c:\ drive as part of the VB6 install package, and copied it to c:\windows\system32. I have tried to register it, but it fails:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

Jacques Bourgeois (James Burger)Connect With a Mentor PresidentCommented:
Once you have the date loaded in a variable (let's call it d), and assuming that the time zone is set properly in the configuration panel, you can use the following:

d.ToLocalTime        'From UTC to local
d.ToUniversalTime 'From local to UTC

This gives you one of the reasons why direct conversions are not good. You probably had many lines of code to do that in VB6, while it's built in the framework. The converter is not able to see those things.
AlHal2Author Commented:
The program  sucks data out of a database and uses it to build an input file. It uses some hideously complicated logic to query locale settings and automatically adjust time-stamps for different time zones. That latter bit seems to cause most of the troubles.
Sorry Al this is going to be a tedious process that will drive you to drink if your not careful.  I've warned many business a type that the longer they wait  to migrate the uglier it will get. I've had to do it on a couple of occasions and it always stunk.  Are you getting a general area where the error is occuring? How may lines of code are we looking at?
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

AlHal2Author Commented:
I'm asking this question on someone else's behalf and am waiting for their response.
Jacques Bourgeois (James Burger)PresidentCommented:
I have seen a lot of projects where programmers tried to convert a VB6 application to VB.NET. They almost all fail. Most of these projects were scrapped after a few weeks or a few months, after the programmers found out that a rewrite is most often the best solution.

The converter does what it can, but there are too many differences, specially in the design of applications. You will end up with a program that lacks performance, is hard to maintain, and does not show you how to program in .NET. You will end up with something that is neither VB6, neither .NET.

As grabber said, waiting 12 years before upgrading development tools and paradigms is "forbidden" in computer sciences.

And you seem to be falling in the net a second time. Why move from old to old. VS2005 is already 9 years old, and was not designed for 64-bit. Any testing that you do in there might blow in your face when you will really make the move.

If you absolutely want to go for a straight conversion, at least do it in a recent version of Visual Studio. If the problem is one of money, the Express edition is free from Microsoft, and will do everything than the bigger editions do for somebody who comes from VB6 and does not need the extra tools provided with the Professional or higher edition.
That is pretty much my take as well. There are so many structural changes between the two that finding a transition from one source to another that it is just better to use the origninal as a template for design. Sorry.
AlHal2Author Commented:
Do you have some vb.Net code to query locale settings and automatically adjust time-stamps for different time zones.
AlHal2Author Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.