Solved

stdole.dll and .Net 3.5 Framework deployment

Posted on 2009-05-19
8
15,715 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
[X]
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
  • 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
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 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
 
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

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!

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

707 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