Link to home
Start Free TrialLog in
Avatar of allinb
allinb

asked on

Problems Deploying an app using Microsoft.Office.Interop.Excel Assembly

This is a deployment question in regards to deploying a VB.Net App that uses the Microsoft.Office.Interop.Excel Assembly. I can build in both release and debug and get the following message:

WARNING: Unable to find dependency 'mscorlib' (Signature='B77A5C561934E089' Version='1.0.5000.0') of assembly 'office.dll'
WARNING: Unable to find dependency 'mscorlib' (Signature='B77A5C561934E089' Version='1.0.5000.0') of assembly 'Microsoft.Office.Interop.Excel.dll'
WARNING: Unable to find dependency 'mscorlib' (Signature='B77A5C561934E089' Version='1.0.5000.0') of assembly 'Microsoft.Vbe.Interop.dll'

When I take the deployment results and deploy them on my machine everything runs fine, obviously when I deploy to any other machine when it hits the creation of the application object I get the following exceptions:

System.IO.FileNotFoundException: File or assembly name Microsoft.Office.Interop.Excel, or one of its dependencies, was not found.
File name: "Microsoft.Office.Interop.Excel"
   at _401KReport.net.TSCRA401KMain.TSCRA401KReport(String iniPathname, String ExcelPathname, DateTime CheckDate)
   at _401KReport.net.Excel401KMain.RunReportButton_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c
 (Fully-specified)
LOG: Appbase = C:\Documents and Settings\Administrator.TSCRA_NT\Start Menu\Programs\TSCRA401KReport\
LOG: Initial PrivatePath = NULL
Calling assembly : 401KReport.net, Version=1.0.1566.3678, Culture=neutral, PublicKeyToken=null.
===

LOG: Publisher policy file is not found.
LOG: Host configuration file not found.
LOG: Using machine configuration file from C:\WINNT\Microsoft.NET\Framework\v1.1.4322\config\machine.config.
LOG: Post-policy reference: Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c
LOG: Attempting download of new URL file:///C:/Documents and Settings/Administrator.TSCRA_NT/Start Menu/Programs/TSCRA401KReport/Microsoft.Office.Interop.Excel.DLL.
LOG: Attempting download of new URL file:///C:/Documents and Settings/Administrator.TSCRA_NT/Start Menu/Programs/TSCRA401KReport/Microsoft.Office.Interop.Excel/Microsoft.Office.Interop.Excel.DLL.
LOG: Attempting download of new URL file:///C:/Documents and Settings/Administrator.TSCRA_NT/Start Menu/Programs/TSCRA401KReport/Microsoft.Office.Interop.Excel.EXE.
LOG: Attempting download of new URL file:///C:/Documents and Settings/Administrator.TSCRA_NT/Start Menu/Programs/TSCRA401KReport/Microsoft.Office.Interop.Excel/Microsoft.Office.Interop.Excel.EXE.


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 1.0.5000.0
----------------------------------------
401KReport.net
    Assembly Version: 1.0.1566.3678
----------------------------------------
System.Windows.Forms
    Assembly Version: 1.0.5000.0
----------------------------------------
System
    Assembly Version: 1.0.5000.0
----------------------------------------
System.Drawing
    Assembly Version: 1.0.5000.0
----------------------------------------
System.Data
    Assembly Version: 1.0.5000.0
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 7.0.5000.0
----------------------------------------
System.Xml
    Assembly Version: 1.0.5000.0

**********************************************************************
This appears to be a versioning issue and if I read this right but I do not seem to be able to locate why. What I need is some help walking through a debug of this deployment issue so I can understand the process and will be able to handle it if it comes up again.....

Any help on this is as you would expect Greatly appreciated.....
Thanks,
Allen
Avatar of Barkis_
Barkis_
Flag of Sweden image

Hi Allen

Is Microsoft Office installed on the machine on wich you are trying to run it?

/Barkis_
Avatar of allinb
allinb

ASKER

Office 2003 is installed on the development box where it works. I have deployed to a machine with Office 2003 and one with office 2000 and I ge the same error on both deployed machines....
Avatar of allinb

ASKER

Bear in mind that the Warnings are from the compiler on the developent box but the app still runs... All other messages are from the app when it fails on the deployed machines....
Avatar of Bob Learned
It looks like it is looking for 1.0 version of the Framework, and you have the 1.1 version of the framework installed.

Bob
Avatar of allinb

ASKER

I have both installed on all machines deployment and development
Wich did you install last?
It does sound like it wants version1.0 of something.
WARNING: Unable to find dependency 'mscorlib' (Signature='B77A5C561934E089' Version='1.0.5000.0') of assembly 'office.dll'

try removing version 1.1 on your development machine and install 1.0 again to make sure files are of correct version
'Cause it seems to be specifically asking for version  '1.0.5000 of the mscorlib found in office.dll
Wich did you install last?
It does sound like it wants version1.0 of something.
WARNING: Unable to find dependency 'mscorlib' (Signature='B77A5C561934E089' Version='1.0.5000.0') of assembly 'office.dll'

try removing version 1.1 on your development machine and install 1.0 again to make sure files are of correct version
'Cause it seems to be specifically asking for version  '1.0.5000 of the mscorlib found in office.dll
I don't think the application is having problems with the .Net Framework; rather I think your application is having problems locating the three Office Automation libraries that are required for communicating with Excel. You need to make sure that the three Office Interop assemblies are copied locally in the application folder of your application when you distribute it.

In the IDE Solution Explorer for your application, make sure the Copy Local property for the Excel, Office and VBIDE references are set to true. The dlls will be stored in the Bin directory. When distributing your application to other machines, make sure that the three dlls Interop.Excel.Dll, Interop.Office.Dll, and Interop.VBIDE.Dll are copied along with your application exe.

Tom.
In your deployment project, what are you installing into the location?  I use the interop.office dll and the interop.excel dll

Does the deployment project show your DLLs in the detected dependencies folder?

Majin Loki
Avatar of allinb

ASKER

Let me see if I can drop some more detail out here
First let me cover the items offered up so far

I uninstalled .Net 1.0 and reinstalled that did not fix the problem.

I have tried adding the Interop assemblies in my Application folder of the Deployment Project.

I did not at first but have now tried the Copy local propery on the Excel Reference in my project

When I am in the VS IDE and view dependencies in the detected dependencies folder I get the following results
Microsoft.Office.Interop.Excel.dll needs Microsoft.Vbe.Interop 11.0.0.0, Office 11.0.0.0 and mscorlib 1.0.5000.0
Microsoft.Vbe.Interop.dll needs Office 11.0.0.0 and mscorlib 1.0.5000.0
Office.dll needs stdole 7.0.3300.0 and mscorlib 1.0.5000.0
stdole.dll needs mscorlib 1.0.3300.0  ***valid reference

Anywhere teh mscorlib is needed as a dependency it has the yield sign which according to documentation means it can not be found. The stdole however references a different version of the mscorlib and it is found.

So now for some more information......
I have looked in the assembly cache under my windows directory and there are two mscorlib assemblies showing up there.
Both are Native and Both use the same Public Key token and both are version 1.0.5.000.0 There are no other mscorlib assembly entries.
The Office Assembly has two entries one For version 11.0.0.0 and one for version 7.0.3.00.0
The Microsoft.Interop.Excel has one entry for version 11.0.0.0
The Microsoft.Vbe.Interop has one entry for version 11.0.0.0

When I add the reference in my VS project I am selecting Microsoft Excel 11.0 Object Library with a type library version of 1.5 and the file it references is Excel.exe in the Office11 folder of my office 2003 installation directory.

I am using early binding

Is the GAC instance of the version that it is looking an issue? I find it odd that it shows up in the GAC but I cant track down where it resides.....
Should I remove it from the GAC or even can I.... never messed with the GAC so not sure what my limitations are with it....
Why would the correct versions of Interop be looking for it.... Is there some call I am making that spawns this need???
The more I look at this the more I am confused......

if anyone needs more information let me know and I will get it back to you as quickly as I can
Thanks... I will be upping the points on this one as it looks like it will be more work than I origionally thought......
You can use a Command Prompt window to find out where a GAC assembly resides.

Bob
Avatar of allinb

ASKER

What is the command to type at the prompt.... is this the VS Studio Prompt or the dos prompt?? I am fixing to be on the road a couple of days so I will be a little slow responding for the next two days.......
Either one will work.  It is as simple as doing a DIR command in the command window.  Windows Explorer does some magic with the same folder that hides a lot of the implementation details.

An example would be the System.Web.dll:

C:\WINDOWS\assembly\GAC\System.Web\1.0.5000.0__b03f5f7f11d50a3a.  

There are two entries in the directory:

System.Web.dll
__AssemblyInfo__.ini

Through the explorer, you would never see these.

Bob
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America 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 allinb

ASKER

though no one really came up with a viable answer TheLearned one did however leave me with different items that sparked enough insight to at least track down what I think it the resolution. This coupled with he was the only one actually checked back....However long it took to see if the information had provided any usefull benefit even though this record had become stale.
I am not sure if the real answer will ever be found but I did find some references to incompatibilites with the 2002 IDE and some of the SDK's that pertain to the 1.1 interops and Office. This makes little sense to me as I am not quite sure how an IDE can be incompatible with and assembly???? On one of their download pages it specifically stated that it would only work with the 2003 IDE. I looked I had this SDK downloaded and applied. it has been so long I have forgotten but I beleive it was the Office 2003... Removing this did not work and in the end I ended up reinstalling my entire development box on an exact application to application replica of the target machine that I was deploying to. So much for backward compatibility you would think however someone in another forum suggested that the fact that the interops are not CORE .Net and therefor allow microsoft to be sheltered from the backwards compatibility claim. Not so sure about that one but OK.... after the beating I took to resolve this one I will buy anything.
All and all I do know this..... the Excel 2003 exe which is in essence the interop for excel was the problem. Replacing this exe by using a different version worked. When I was using the 2003 exe it really really really wanted this assebly that it could never find but was there. I found some stuff on the assembly that was giving me the problem and apparently it is a multi file assembly or something on that line which would explain why within the same dependency I noticed a refererence to two different versions.....
This given I have thoroughly confused myself and probably am not even capable of programming Hello World in .NET after this experience. I think I will try an easy language like assembler.....
Thanks to all.....