stdole.dll and .Net 3.5 Framework deployment

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.
LVL 1
ncwAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
CodeCruiserConnect With a Mentor Commented:
>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
 
kaylanreilorConnect With a Mentor Commented:
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
 
CodeCruiserCommented:
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
Upgrade your Question Security!

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

 
ncwAuthor Commented:
>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
 
ncwAuthor Commented:
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
 
ncwAuthor Commented:
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
 
CodeCruiserCommented:
The reason for the app to be installed deep in the documents and settings is that its installed per user.
0
 
ncwAuthor Commented:
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
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.