Hi,
I'm writing a C# web app that uses Outlook to send email. I use a reference
to the Microsoft Outlook 11.0 Object Library, but it's giving me problems. I
tracked down some stuff on the Net about the global assembly cache (GAC) and
primary interop assemblies (PIA) and so forth, and did all the
recommendations, in terms of tweeking Office, installing the .NET Office
stuff for framework 1.1, etc. I got it to the point where it compiles ok, but
during run-time, when I try to instantiate an Outlook.Application it errors
out with “File or assembly name Microsoft.Office.Interop.Outlook, or one of
its dependencies, was not found.” What it seems like is going on is that the
PIA can be found during compile time, but not during runtime. Is there a way
or a switch to throw that would let runtime know to look in the GAC? I think
it might be a Registry thing. Here are the LOG entries that display for the
runtime error:
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Office.Interop.Outlook, Version=11.0.0.0,
Culture=neutral, PublicKeyToken=71e9bce111e9429c
(Fully-specified)
LOG: Appbase = file:///C:/Inetpub/wwwroot/ittest
LOG: Initial PrivatePath = bin
Calling assembly : ittest, Version=1.0.1899.30078, Culture=neutral,
PublicKeyToken=null.
===
LOG: Publisher policy file is not found.
LOG: No redirect found in host configuration file
(C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspn et.config).
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\confi g\machine.config.
LOG: Post-policy reference: Microsoft.Office.Interop.Outlook,
Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/ittest/d6e8f147/fd2b53a7/Microsoft.Office.Interop.Outlook.DLL.
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/ittest/d6e8f147/fd2b53a7/Microsoft.Office.Interop.Outlook/Microsoft.Office.Interop.Outlook.DLL.
LOG: Attempting download of new URL
file:///C:/Inetpub/wwwroot/ittest/bin/Microsoft.Office.Interop.Outlook.DLL.
LOG: Attempting download of new URL
file:///C:/Inetpub/wwwroot/ittest/bin/Microsoft.Office.Interop.Outlook/Microsoft.Office.Interop.Outlook.DLL.
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/ittest/d6e8f147/fd2b53a7/Microsoft.Office.Interop.Outlook.EXE.
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/ittest/d6e8f147/fd2b53a7/Microsoft.Office.Interop.Outlook/Microsoft.Office.Interop.Outlook.EXE.
LOG: Attempting download of new URL
file:///C:/Inetpub/wwwroot/ittest/bin/Microsoft.Office.Interop.Outlook.EXE.
LOG: Attempting download of new URL
file:///C:/Inetpub/wwwroot/ittest/bin/Microsoft.Office.Interop.Outlook/Microsoft.Office.Interop.Outlook.EXE.
===
Any info or advice would be greatly appreciated.
-Nick