locked
Problem initializing WHSInfoClass object RRS feed

  • Question

  • Initializing a WHSInfoClass object within a console tab extension seems to cause the extension to crash. The same code running within a normal console application runs fine. Is this expected behavior or am I setting something up incorrectly?

    Thursday, May 3, 2007 5:55 PM

Answers

  • Seems fine here.  I was able to create the WHSInfoClass and iterate through all the share information with no problem inside a tab control.

    Are you sure all your assemblies are matched?  I bumped into some issues when I upgraded my server to CTP, but still had a few beta2 assemblies on my dev box.

    Friday, May 4, 2007 2:05 AM

All replies

  • Seems fine here.  I was able to create the WHSInfoClass and iterate through all the share information with no problem inside a tab control.

    Are you sure all your assemblies are matched?  I bumped into some issues when I upgraded my server to CTP, but still had a few beta2 assemblies on my dev box.

    Friday, May 4, 2007 2:05 AM
  • I'm running into this same issue. If I comment out the call for "new WHSInfoClass()", the console tab works fine. The DLL is being found and loaded because the settings tab is working fine.

    Anyone have a snippet of code that does work or can think of an easy way to debug this? The console itself seems very opaque and I can tell it's never getting to the WHSInfoClass invocation-- it almost feels like it's a reference issue.

    To confirm, I'm definitely using the HomeServer.dll from the CTP.

    Thanks for any advice you might have. I'll report back here if I figure out what causes it.

    Wednesday, May 16, 2007 9:46 PM
  • Ok, that was quick!

    I discovered the problem due to the great response from Fan Z on the installer topic (which I was about to answer, too):
    http://forums.microsoft.com/WindowsHomeServer/ShowPost.aspx?PostID=1575815&SiteID=50

    I noticed the interop assembly in the WiX source and realized I wasn't shipping that. Now that I've included the Interop.WHSInfoIF.dll file in my MSI, the console tab works great.

    Thanks! Hope this helps someone else.

    Wednesday, May 16, 2007 10:08 PM