Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


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

Posted on 2014-03-27
Medium Priority
Last Modified: 2014-03-29
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:
Question by:AlHal2
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2

Author Comment

ID: 39958537
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.

Expert Comment

ID: 39958920
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?

Author Comment

ID: 39959174
I'm asking this question on someone else's behalf and am waiting for their response.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 40
ID: 39959778
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.

Expert Comment

ID: 39960040
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.

Author Comment

ID: 39961111
Do you have some vb.Net code to query locale settings and automatically adjust time-stamps for different time zones.
LVL 40

Accepted Solution

Jacques Bourgeois (James Burger) earned 1000 total points
ID: 39962003
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.

Author Closing Comment

ID: 39964277

Featured Post

Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question