Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,

I am trying to add the 'Microsoft.Office.Interop.Outlook' DLL reference to my project, and while it works perfectly fine on my development machine, it does not work on the live server. The error dumped on the page is:

XML
Server Error in '/WebPortal' Application.

Could not load file or assembly 'office, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified. 

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'office, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.


This is how I'm adding the reference under 'system.web' the web.config file:

XML
<assemblies>
    <add assembly="Microsoft.Office.Interop.Outlook, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"/>
</assemblies>


And when I do a search for the DLL on both machines it turns up at the following locations:

VB
Dev machine (working):

C:\Program Files\Reference Assemblies\Microsoft\VSTO40\v4.0.Framework
C:\Program Files\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office12
C:\Program Files\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office14
C:\WINDOWS\Microsoft.NET\assembly\GAC_MSIL\Microsoft.Office.Tools.Outlook\v4.0_10.0.0.0__b03f5f7f11d50a3a


Live machine (not working):

C:\Program Files\Reference Assemblies\Microsoft\VSTO40\v4.0.Framework
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office12
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office14
C:\WINDOWS\Microsoft.NET\assembly\GAC_MSIL\Microsoft.Office.Tools.Outlook\v4.0_10.0.0.0__b03f5f7f11d50a3a


I have checked the exact vesrion numbers and public keys of each of the DLLs in turn, and tried changing the values in the web.cfg, but still no joy.

Is there any other reason why the server would not be picking this reference up?

Many thanks in advance,

Nick
Posted
Updated 23-May-13 3:54am
v2
Comments
Prasad Khandekar 23-May-13 9:54am    
Hello Nick,

I am not too sure but from paths you have provided it looks like that it could be because platform difference 64bit .NET and 32 bit office dll. You cannot load a DLL of one "bitness" into a process running as another "bitness"

Regards,
Nick Fisher (Consultant) 23-May-13 9:58am    
OK, that makes sense, but these DLLs were installed on the machine by the latest .NET when I downloaded it. Why would it not put the right DLLs on the machine?

Nick Fisher and Member 3485003!
Do not attempt such thing. You can not use outlook as part of an asp.net web application. There are several things why, but it won't work. It is not meant to work like that!
If you need to access IMAP or POP3 mailboxes, use those protocols, or you can even access Exchange server. For server side goals use server side means. Outlook is a client side tool.
 
Share this answer
 
Nick,

Im having the same issue. Did you find the solution?
 
Share this answer
 
Comments
Zoltán Zörgő 12-Aug-13 15:10pm    
This is not an answer, don't post questions or comments as answer! Please use page widgets properly.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900