Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Requirement: My application has a requirement to send emails via outlook. I could accomplish this using Outlook = Microsoft.Office.Interop.Outlook;

The application works fine on development environment but iam getting an exception: System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

Detailed:

System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
 at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at InvoiceSearchTool.Controllers.emailController.CreateMessageWithAttachment(String invoiceNumber, String recipient, String messageBody) in C:\Projects\KeleInvoice\InvoiceSearchTool\Controllers\emailController.cs:line 38

I do not have outlook installed on an application server. Do I need to install outlook on a server? or the exception is for some other reason? how to get rid of it?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

The CLSID for Outlook is {0006F03A-0000-0000-C000-000000000046}. As the error code suggest, it cannot find the Class. You will need to install Outlook (the same version on you have on the development should be also installed on the application server).

(ps - please tick if i am correct, thank you!)

share|improve this answer
    
one doubt here... you said same version? On application server i can get the same version installed but the application will be accessed by many machines with different outlook version, will that work fine? –  Mini Jan 20 '12 at 17:53
    
yes would need to be same version, as each has difference CLSID. Take a look at this thread, it explains to some extent in getting it working for various versions - stackoverflow.com/questions/5404615/… –  Cold T Jan 20 '12 at 18:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.