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.E xcel Assembly. I can build in both release and debug and get the following message:
WARNING: Unable to find dependency 'mscorlib' (Signature='B77A5C561934E0 89' Version='1.0.5000.0') of assembly 'office.dll'
WARNING: Unable to find dependency 'mscorlib' (Signature='B77A5C561934E0 89' Version='1.0.5000.0') of assembly 'Microsoft.Office.Interop. Excel.dll'
WARNING: Unable to find dependency 'mscorlib' (Signature='B77A5C561934E0 89' 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.FileNotFoundExce ption: File or assembly name Microsoft.Office.Interop.E xcel, or one of its dependencies, was not found.
File name: "Microsoft.Office.Interop. Excel"
at _401KReport.net.TSCRA401KM ain.TSCRA4 01KReport( String iniPathname, String ExcelPathname, DateTime CheckDate)
at _401KReport.net.Excel401KM ain.RunRep ortButton_ Click(Obje ct sender, EventArgs e)
at System.Windows.Forms.Contr ol.OnClick (EventArgs e)
at System.Windows.Forms.Butto n.OnClick( EventArgs e)
at System.Windows.Forms.Butto n.OnMouseU p(MouseEve ntArgs mevent)
at System.Windows.Forms.Contr ol.WmMouse Up(Message & m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Contr ol.WndProc (Message& m)
at System.Windows.Forms.Butto nBase.WndP roc(Messag e& m)
at System.Windows.Forms.Butto n.WndProc( Message& m)
at System.Windows.Forms.Contr olNativeWi ndow.OnMes sage(Messa ge& m)
at System.Windows.Forms.Contr olNativeWi ndow.WndPr oc(Message & m)
at System.Windows.Forms.Nativ eWindow.Ca llback(Int Ptr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Office.Interop.E xcel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e 9429c
(Fully-specified)
LOG: Appbase = C:\Documents and Settings\Administrator.TSC RA_NT\Star t Menu\Programs\TSCRA401KRep ort\
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\Fra mework\v1. 1.4322\con fig\machin e.config.
LOG: Post-policy reference: Microsoft.Office.Interop.E xcel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e 9429c
LOG: Attempting download of new URL file:///C:/Documents and Settings/Administrator.TSC RA_NT/Star t Menu/Programs/TSCRA401KRep ort/Micros oft.Office .Interop.E xcel.DLL.
LOG: Attempting download of new URL file:///C:/Documents and Settings/Administrator.TSC RA_NT/Star t Menu/Programs/TSCRA401KRep ort/Micros oft.Office .Interop.E xcel/Micro soft.Offic e.Interop. Excel.DLL.
LOG: Attempting download of new URL file:///C:/Documents and Settings/Administrator.TSC RA_NT/Star t Menu/Programs/TSCRA401KRep ort/Micros oft.Office .Interop.E xcel.EXE.
LOG: Attempting download of new URL file:///C:/Documents and Settings/Administrator.TSC RA_NT/Star t Menu/Programs/TSCRA401KRep ort/Micros oft.Office .Interop.E xcel/Micro soft.Offic e.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
WARNING: Unable to find dependency 'mscorlib' (Signature='B77A5C561934E0
WARNING: Unable to find dependency 'mscorlib' (Signature='B77A5C561934E0
WARNING: Unable to find dependency 'mscorlib' (Signature='B77A5C561934E0
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.FileNotFoundExce
File name: "Microsoft.Office.Interop.
at _401KReport.net.TSCRA401KM
at _401KReport.net.Excel401KM
at System.Windows.Forms.Contr
at System.Windows.Forms.Butto
at System.Windows.Forms.Butto
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Butto
at System.Windows.Forms.Butto
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Nativ
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Office.Interop.E
(Fully-specified)
LOG: Appbase = C:\Documents and Settings\Administrator.TSC
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\Fra
LOG: Post-policy reference: Microsoft.Office.Interop.E
LOG: Attempting download of new URL file:///C:/Documents and Settings/Administrator.TSC
LOG: Attempting download of new URL file:///C:/Documents and Settings/Administrator.TSC
LOG: Attempting download of new URL file:///C:/Documents and Settings/Administrator.TSC
LOG: Attempting download of new URL file:///C:/Documents and Settings/Administrator.TSC
************** 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
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....
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....
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
Bob
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='B77A5C561934E0 89' 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
It does sound like it wants version1.0 of something.
WARNING: Unable to find dependency 'mscorlib' (Signature='B77A5C561934E0
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='B77A5C561934E0 89' 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
It does sound like it wants version1.0 of something.
WARNING: Unable to find dependency 'mscorlib' (Signature='B77A5C561934E0
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 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
Does the deployment project show your DLLs in the detected dependencies folder?
Majin Loki
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.E xcel.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......
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.E
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
Bob
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\Sy stem.Web\1 .0.5000.0_ _b03f5f7f1 1d50a3a.
There are two entries in the directory:
System.Web.dll
__AssemblyInfo__.ini
Through the explorer, you would never see these.
Bob
An example would be the System.Web.dll:
C:\WINDOWS\assembly\GAC\Sy
There are two entries in the directory:
System.Web.dll
__AssemblyInfo__.ini
Through the explorer, you would never see these.
Bob
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.....
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.....
Is Microsoft Office installed on the machine on wich you are trying to run it?
/Barkis_