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

Posted on 2014-03-27
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.
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

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 250 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

752 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