INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Automation SDK not working in ASP.NET with IIS  (Read 3112 times)

dwightk

  • Regular Member
  • Recent member
  • *
  • Posts: 6
  • Change this by choosing profile
Automation SDK not working in ASP.NET with IIS
« on: March 29, 2006, 05:15:44 pm »

Hello;
Having problems getting the Automation SDK to work.

I am using Windows XP Pro, SP2.

I am using Media Center 11.1.114

I am writing an ASP.NET 2.0 application for IIS.

When I use the following code to initialize the Mediacenter automation object:

    protected object GetJR()
    {
        object mobj;
        try
        {
            mobj = Marshal.GetActiveObject("MediaJukebox Application");
            return (mobj);
        }
        catch (Exception ex)
        {
            try
            {
                mobj = Server.CreateObject("MediaJukebox Application");
         // I also tried this with Activator.CreateInstance() with the same
         // result.

                return (mobj);
            }
            catch (Exception ex2)
            {
                TextBox1.Text = "Error: " + ex2.Message;
                return (null);
            }
        }
    }


The GetActiveObject("MediaJukebox Application") call returns the error message: “Operation unavailable (Exception from HRESULT: 0x800401E3 (MK_E_UNAVAILABLE))”

The CreateObject("MediaJukebox Application") call fails and returns the error message:  “Retrieving the COM class factory for component with CLSID {04E24975-007A-44C2-9C4C-92509F839EDC} failed due to the following error: 80080005.”

Also, after the Createobject() call, the following DCOM Error shows up in the Windows XP Event Viewer in the System tab: “The server {04E24975-007A-44C2-9C4C-92509F839EDC} did not register with DCOM within the required timeout.”

With Debug logging enabled on Media Center, the following debug lines are written to the log:
   1596937: SDK: CMJCurPlaylistAutomation::CMJCurPlaylistAutomation: Global Count: 1
1596937: SDK: CMJCurPlaylistAutomation::OnFinalRelease: All objects released
1596937: SDK: CMJCurPlaylistAutomation::~CMJCurPlaylistAutomation: Global Count: 0

If I use this same code in a windows application rather than in a ASP.NET web app this code works just fine   (using the Activator.CreateInstance() function rather than server.createobject()).

Has anyone gotten the Automation SDK to work using IIS and ASP.NET? 

Dwight




Logged

Mr ChriZ

  • Citizen of the Universe
  • *****
  • Posts: 4375
  • :-D
Re: Automation SDK not working in ASP.NET with IIS
« Reply #1 on: March 29, 2006, 05:59:02 pm »

Let me know if you get anywhere with this  :(
http://yabb.jriver.com/interact/index.php?topic=31170.msg223146#msg223146

I've tried many different things to get GetActiveObject to work in different
languages (VB.NET, C++, C#) .  Always the same result. MK_E_UNAVAILABLE
Others claim it works first time out the box, but I'm at the point
where I think seeing would be believing.

I've not tried
Activator.GetObject before.
I just tried it as follows
Activator.GetObject(typeof(MediaJukebox.MJAutomation),"MediaJukebox Application");
and I get the result
"Cannot create channel sink to connect to URL 'MediaJukebox Application'. An appropriate channel has probably not been registered."

Anythoughts would be much appreciated!

dwightk

  • Regular Member
  • Recent member
  • *
  • Posts: 6
  • Change this by choosing profile
Re: Automation SDK not working in ASP.NET with IIS
« Reply #2 on: April 01, 2006, 12:47:42 pm »

I can get GetActiveObject() to work in a Windows application, just can't get it to work in a ASP.NET web app. 

Which is too bad because it is trivial to progream up a great web page to control Media Center using Microsoft's Visual Web Developer (free web dev tool), or it would be trivial if GetActiveObject() worked.

The way it returns an error, and puts a DCOM error into the event manager, makes me think this is a JRiver bug in the SDK
Logged

gvanbrunt

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1232
  • MC Nerd
Re: Automation SDK not working in ASP.NET with IIS
« Reply #3 on: August 13, 2006, 03:24:15 pm »

Have you tried setting the appartmentThreading attribute of the httpRuntime element in web.config? I had this kind of a problem before with certian com packages....
Logged
Pages: [1]   Go Up