locked
Question Runtime Error after creating object WMSServerClass --> code: 80040154 RRS feed

  • Question

  • hi..
    I was trying to create a Window Media Server by using C#. So, I went to http://msdn.microsoft.com/en-us/library/ms741122(VS.85).aspx to start. I gave me a simple code of how to create a server as the following:

    using System;  
     
    using System.Collections.Generic;  
     
    using System.Linq;  
     
    using System.Text;  
     
    using Microsoft.WindowsMediaServices;  
     
    using Microsoft.WindowsMediaServices.Interop;  
     
    using System.Runtime.InteropServices;  
     
    namespace CreateServer  
     
    {  
     
      class Program  
     
      {  
     
        static void Main(string[] args)  
     
        {  
     
        try 
     
        {  
          // Create a new WMSServer object.  
          WMSServer Server = new WMSServerClass();        //Error here!!!  
        }  
        catch (COMException comExc)  
        {  
             // TODO: Handle COM exceptions.  
        }   
        catch (Exception e) {  
        // TODO: Handle exceptions.  
        }  
     

    After I complied, it didn't gave me any error or warning. However, after I started to run the program it gave me a runtime error

    System.Runtime.InteropServices.COMException <0x80040154>: Retrieving the COM class factory for component with CLSID {845FB959-4279-11D2-00805FBE84A6} failed due to the following error: 80040154.
       at CreateServer.Program.Main(String[] args) in D:\....

    My computer is running Windows Vista Home Premium with VS 2008. I previously installed windows media services SDK from http://www.microsoft.com/downloads/details.aspx?FamilyId=F26B1AA4-741A-433A-9BE5-FA919850BDBF&displaylang=en#Instructions

    I added microsoft.windowsmediaservices.dll (ver: 9.0.0.3693) from C:\Program Files\Microsoft SDKs\Windows\v5.0\Include\microsoft.windowsmediaservices.dll

    I am not sure if there is a conflict between dll component. I noticed that I have 2 different version of microsoft.windowsmediaservices.dll in my computer (9.0.0.3693 and 9.0.0.3665).


    If anyone got any idea of how to solve this problem, please let me know...

    Sorry for bad grammar
    • Moved by Mike Walsh FIN Wednesday, December 10, 2008 5:07 PM off-topic (Moved from MSDN and TechNet Search Feedback to Off-Topic Posts (Do Not Post Here))
    Wednesday, December 10, 2008 3:44 PM

Answers

  •  

    Hello ,

     

    Thank you for your post!  I would suggest posting your question in the 'MSDN > Forums Home > Visual C# > Visual C# General' located here:  http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/threads/


    Have a great day!

    Thanks!

    SachinW Tier 2 Application Support Server and Tools Online Engineering Live Services Team
    • Proposed as answer by SachinW Thursday, December 11, 2008 5:06 AM
    • Marked as answer by SachinW Wednesday, May 20, 2009 8:55 AM
    Thursday, December 11, 2008 5:06 AM

All replies

  • I'm sorry but this forum is for feedback on Search in MSDN or TechNet.

    As your question isn't that I'm moving it to Off-Topic.
    Wednesday, December 10, 2008 5:07 PM
  •  

    Hello ,

     

    Thank you for your post!  I would suggest posting your question in the 'MSDN > Forums Home > Visual C# > Visual C# General' located here:  http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/threads/


    Have a great day!

    Thanks!

    SachinW Tier 2 Application Support Server and Tools Online Engineering Live Services Team
    • Proposed as answer by SachinW Thursday, December 11, 2008 5:06 AM
    • Marked as answer by SachinW Wednesday, May 20, 2009 8:55 AM
    Thursday, December 11, 2008 5:06 AM