Link to home
Start Free TrialLog in
Avatar of ncw
ncw

asked on

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.
SOLUTION
Avatar of kaylanreilor
kaylanreilor
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Nasir Razzaq
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.
Avatar of ncw
ncw

ASKER

>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."
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ncw

ASKER

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.
Avatar of ncw

ASKER

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
The reason for the app to be installed deep in the documents and settings is that its installed per user.
Avatar of ncw

ASKER

I have started a new question at https://www.experts-exchange.com/questions/24429537/VB-net-ApplicationFolder-defaultlocation.html maybe you could help me further please. How would I change this so that it's installed to a specified directory?