Solved

stdole.dll and .Net 3.5 Framework deployment

Posted on 2009-05-19
8
14,948 Views
Last Modified: 2012-05-07
Using VB.net Express 2008 I've compiled and published a small application, but when I run the setup.exe on WinXP SP3 I got the following error: Unable to install or run the application. The application requires that assembly ADODB Version 7.0.3300.0 be installed in the Global Assembly Cache (GAC) first.

A previous and similar message occured for stdole.dll. I now seem to have ovecome these two messages by going to Project Properties > References, then finding the references to stdole and Microsoft ActiveX Data Objects 2.5, looking in the properties window for both and changing the setting for Copy Local to true. However I'm now getting a different error when the setup tries to deploy adodb.dll, it's a file access error because adodb.dll already exists.

Why so many errors? What should be the correct approach?  I've found copies of these files in C:\Program Files\Microsoft.NET\Primary Interop Assemblies and in C:\WINDOWS\assembly on the development PC but not on the PC where the app is being setup; but both PC's have had the .NET 3.5 update applied.
0
Comment
Question by:ncw
  • 4
  • 3
8 Comments
 
LVL 13

Assisted Solution

by:kaylanreilor
kaylanreilor earned 80 total points
ID: 24428958
I shouldn't have set the copy local property.
I think you'd rather have had used the prerequisites in the publish tab of the properties for the project. Then you should also have hed a setup program.
In the "Prerequisites" dialog box I don't know if "Microsoft Data Access Components 2.8" would make the deal. You're ADODB reference could need the "Visual C++ Runtime Libraries" instead.
On the other hand, since you absolutely need to use this ADO COM, why not having used "Microsoft ActiveX Data Objects 2.8 Library" instead of the 2.5 ?
Also, since you're using .Net Framework, why are you using COM ADO object ?
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24429388
You do not copy the stdole.dll. Its a source of many errors when deploying. Instead, add the prerequisite of Office Interop Assemblies to the project so that the stdole.dll could be installed on the target system before your application.
0
 
LVL 1

Author Comment

by:ncw
ID: 24436686
>I shouldn't have set the copy local property.
I've back tracked and set copy local to false.

>why not having used "Microsoft ActiveX Data Objects 2.8 Library" instead of the 2.5 ?
I've now changed the reference to "Microsoft ActiveX Data Objects 2.8 Library"

>since you're using .Net Framework, why are you using COM ADO object ?
I'm using ADO to connect to an MS Access database, should I be using another method?

.NET Framework 3.5 SP1 is already ticked in the pre-requisits, surely that should have downloaded stdole.dll during the install. The .NET Framework did appear to download but I don't think it could have installed correctly; The folder C:\Program Files\Microsoft.NET\Primary Interop Assemblies does not exist on the WinXP I installed on.

I've rebuilt and republished the application but when I run the setup and click install I'm back to getting the first error message: "Unable to install or run the application. The application requires that assembly stdole Version 7.0.3300.0 be installed in the Global Assembly Cache (GAC) first."
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 420 total points
ID: 24438787
>I'm using ADO to connect to an MS Access database, should I be using another method?
You should be using .NET OLEDB provider.

>.NET Framework 3.5 SP1 is already ticked in the pre-requisits, surely that should have downloaded stdole.dll during the install.
Check this link
http://social.msdn.microsoft.com/forums/en-US/winformssetup/thread/43398969-4228-41d7-a792-8dd66472b79f/
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 1

Author Comment

by:ncw
ID: 24446440
I'll readup on the .NET OLEDB provider later.

Thanks for the link CodeCruiser. The info on this page doesn't provide a definative answer, different solutions have worked for different people notably:
1. installing the MS Office 2003 PIAs on the target machine -> maybe a workaround but hardly a solution
2. reference a different version of stdole.dll -> my version is correct
3. set publish status for stdole.dll to include instead of pre-requisit -> made no difference for me
4. use gcutil to insert stdole.dll in the destinations GAC -> maybe a workaround but hardly a solution
5. delete the project reference to stdole.dll -> this clears the error for stdole.dll but moves on to a similar error for MySql.Data Version 5.2.5.0, so I changed the publish status for MySql.Data.dll to include instead of pre-requisit and this cleared the error.

So I think #5 has solved the errors on install, however although a program group and shortcut in the start menu are installed, the main exe and associated files have not been installed in Program Files/<app name>, instead they are in Documents & Settings > AccountName > Local Settings > Apps > 2.0 > various sub-folders - is this a temporary location?

When I run the app it says it's missing the ini file.
0
 
LVL 1

Author Closing Comment

by:ncw
ID: 31584190
I've got past the install errors, just don't understand why it's installed deep in Documents and Settings, no doubt there is a path setting in VB.net
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24448412
The reason for the app to be installed deep in the documents and settings is that its installed per user.
0
 
LVL 1

Author Comment

by:ncw
ID: 24448757
I have started a new question at http://www.experts-exchange.com/Programming/Languages/.NET/Q_24429537.html maybe you could help me further please. How would I change this so that it's installed to a specified directory?
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now