none
iTvApp sample from windows mediacenter SDK v6.0 not running

    Question

  • I'm trying to get the sample application for itv in windows mediacenter running. (available in mediacenter sdk v6.0) i'm using visual studio 2008 prof edition. Building the solution is no problem. I don't get any errors. I use the batch file to get the app registerd to media center also no problem there.
    but then..

    At first i could not find it in mediacenter, i took a look at the registration.xml file and there i see:
    <category category="iTV\app:{91edb1f6-4574-41ec-ae77-71dff5517968}" />
    
    
    and below there is a line in comments:
    <category category="More Programs"/>
    
    
    so i switched the comment, i should see my app in More programs now. and indeed it shows up, but then i try to run it and i get an error and a dialog stating the application wil exit, i return to mediacenter.

    so i attached a the debugger to try and see what is going on, it looks like all dll are loaded but at the end there is something wrong. here is the listing i get:

    'ehexthost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll', Symbols loaded.
    
    'ehexthost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\mscorlib.resources\2.0.0.0_nl_b77a5c561934e089\mscorlib.resources.dll'
    
    'ehexthost.exe' (Managed): Loaded 'C:\Windows\eHome\ehExtHost.exe', Symbols loaded.
    
    'ehexthost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll', Symbols loaded.
    
    'ehexthost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.MediaCenter.UI\6.1.0.0__31bf3856ad364e35\Microsoft.MediaCenter.UI.dll', Symbols loaded.
    
    'ehexthost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.MediaCenter\6.1.0.0__31bf3856ad364e35\Microsoft.MediaCenter.dll', Symbols loaded.
    
    'ehexthost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Runtime.Remoting\2.0.0.0__b77a5c561934e089\System.Runtime.Remoting.dll'
    
    'ehexthost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll', Symbols loaded.
    
    'ehexthost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\iTvApp\1.0.0.0__e142634e4401e283\iTvApp.dll', Symbols loaded.
    
    'ehexthost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.MediaCenter.ITVVM\6.1.0.0__31bf3856ad364e35\Microsoft.MediaCenter.ITVVM.dll'
    
    'ehexthost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll', Symbols loaded.
    
    'ehexthost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_32\CustomMarshalers\2.0.0.0__b03f5f7f11d50a3a\CustomMarshalers.dll'
    
    'ehexthost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\ehshell\6.1.0.0__31bf3856ad364e35\ehshell.dll'
    
    'ehexthost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.MediaCenter.Shell\6.1.0.0__31bf3856ad364e35\Microsoft.MediaCenter.Shell.dll'
    
    'ehexthost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.MediaCenter.Sports\6.1.0.0__31bf3856ad364e35\Microsoft.MediaCenter.Sports.dll'
    
    'ehexthost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\ehiiTv\6.1.0.0__31bf3856ad364e35\ehiiTv.dll'
    
    'ehexthost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.MediaCenter.iTv.Hosting\6.1.0.0__31bf3856ad364e35\Microsoft.MediaCenter.iTv.Hosting.dll'
    
    A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in Microsoft.MediaCenter.iTv.Hosting.dll
    
    A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll
    
    The program '[7888] ehexthost.exe: Managed' has exited with code -1 (0xffffffff).
    
    


    Can somebody help me? how to find out what exception is thrown?

    thanx!
    Friday, February 12, 2010 3:35 PM

Answers

  • Hello,

    You could go to Debug -> Exception -> Common Language Runtime Exception -> System.Runtime.InteropService -> System.Runtime.InteropServices.COMExcpption and check the Thrown checkbox. This will enable Visual Studio to stop at  COMExceptions when debugging.

    Basically, a first chance exception is harmless. In some scenarios, we expect some exceptions to happen. For example, when we use FileStream to load a file, it is expected for developers that the file is not existed, hence, the developer would write a catch block to handle the FileNotFoundException. Visual Studio Debugger will not break in this kind of scenarios, it will print out a "first-chance exception.." message in the Output window.

    For more information, you could read the following thread:
    http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/da1eedcd-50d3-46b0-bfd8-f3c840d72b55
    An this KB article tells us the First and Second chance exception handling:
    http://support.microsoft.com/default.aspx/kb/105675

    Best regards


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    • Marked as answer by MarcoNijmeijer Sunday, February 21, 2010 12:58 PM
    Monday, February 15, 2010 3:08 AM

All replies

  • Hello,

    You could go to Debug -> Exception -> Common Language Runtime Exception -> System.Runtime.InteropService -> System.Runtime.InteropServices.COMExcpption and check the Thrown checkbox. This will enable Visual Studio to stop at  COMExceptions when debugging.

    Basically, a first chance exception is harmless. In some scenarios, we expect some exceptions to happen. For example, when we use FileStream to load a file, it is expected for developers that the file is not existed, hence, the developer would write a catch block to handle the FileNotFoundException. Visual Studio Debugger will not break in this kind of scenarios, it will print out a "first-chance exception.." message in the Output window.

    For more information, you could read the following thread:
    http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/da1eedcd-50d3-46b0-bfd8-f3c840d72b55
    An this KB article tells us the First and Second chance exception handling:
    http://support.microsoft.com/default.aspx/kb/105675

    Best regards


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    • Marked as answer by MarcoNijmeijer Sunday, February 21, 2010 12:58 PM
    Monday, February 15, 2010 3:08 AM
  • Hello,

    I'm writing to follow up the case. Please let me know if you need more help. If the issue has been solved, we would be appreciated if you could share it with our comminity members having the same issue.

    Thanks a lot!
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    Thursday, February 18, 2010 12:05 PM
  • Thanx, i can see the exception now.
    found out there is a class nof found exception when i dig into details.
    I'll try to find out whats missing.


    ---
    found it
    --

    It just isn't possible to start the app from the more programs tab. the example xml supplied together with the sample project confused me. In the xml (used to register the app with MediaCenter) there was one line commented out stating to register the app in more programs...however this is useless.

    the app should start from a tv stream running in the mediacenter.
    what i did:
    * donwloaded tvtuner simulator, installed it.

    http://download.microsoft.com/download/E/F/5/EF5F507C-B59D-4CD2-8A20-582607404D3C/PBDAIPSim.msi

    * turn of  mediaplayer networ service:  'net stop wmpnetworksvc'  for some reason it seams to crash the simulatro.

    * used ehprivjos (while simulator is running) to get the tuner simulator discoverd
     "C:\windows\ehome\ehprivjob.exe /PBDADiscovery /ex"

    *start mediacenter and reconfigure tv.

    * chanels 2.1,5.1,7.1,20.1,35.1 are simulated by the simulator playing a file from disk.

    * with the simulator tool enter the tableid (241) PID (16 or 256) paste GUID from tag category found in register xml file for applicationid and applicationtableid and click invoke.

    * within mediacenter the application will start if you go to appropriate (PID) chanel.

    * once app is launced i see it in my visual studio and i se the symbols loaded and i'm able to debug....

    finally....

    • Proposed as answer by KRohling Sunday, April 04, 2010 10:50 PM
    Sunday, February 21, 2010 12:59 PM
  • MarcoNijmeijer you're awesome, thanks for putting this together, definitely saved me some time.  I'm debugging and getting the "Could not load file or assembly 'AddinDataReceiver..." exception, did you ever figure out what that was?

    Sunday, April 04, 2010 10:50 PM
  • you should use visual studio profi or up edition to get AddinDatareceiver compiled
    Friday, November 26, 2010 3:25 PM
  • I got the "Could not load file or assembly 'AddinDataReceiver..." exception with VS 2010. The C++ DataReceiver project is built with .net 4.0 so I change the iTvApp to build using .net 4.0 and it built without errors.
    I also changed the gacutil.exe reference in DevInstall.cmd to "%GACUtilPath%\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\gacutil.exe".
    Sunday, May 20, 2012 8:34 PM