issues running sample

Jul 31, 2008 at 3:56 PM
The sample app appears to compile okay.  I can go to the bin directory and run OCSDKWrapper.SampleApp.exe, but nothing appears to happen.  When I try to run the app from Visual Studio 2008, I get a "XamlParseException was unhandled"  
Cannot create instance of 'MOCSampleApp' defined in assembly 'OCSDKWrapper.SampleApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation.  Error in markup file 'MOCSampleApp.xaml' Line 1 Position 9.

Any ideas?
Thanks.
Brown Cow
Coordinator
Aug 13, 2008 at 3:56 PM
Sorry for taking so long to reply, I thought I would receive an email alert when somebody posted a discussion item.

I've seen instances where there might be a conflict between the version of the Office Communicator SDK that you have installed on your machine and the version that's bundled with the sample application even though they are the same version (downloaded and installed from MSDN).

What I would recommend is that you remove the references to the Office Communicator SDK from the projects in the solution, and re-add them and point to the SDK COM dll that's installed on your machine.

I hope this helps
Aug 15, 2008 at 8:55 PM
Edited Aug 15, 2008 at 8:59 PM
When you say remove the references to the Office Communicator SDK from the projects in the solution, I see 3 places where I believe they are referenced.
Under the OCSDKWrapper-->References, I see CommunicatorAPI which points to OCSDKWrapper\obj\Debug\Interop.CommunicatorAPI.dll, and I see CommunicatorPrivate which points to OCSDKWrapper\obj\Debug\Interop.CommunicatorPrivate.dll.

Under OCSDKWrapper--->Lib, I see CommunicatorAPI.dll which points to \OCSDKWrapper\lib\CommunicatorAPI.dll and CommunicatorPrivate.dll which points to \OCSDKWrapper\lib\CommunicatorPrivate.dll

Under OCSDKWRAPPER.SAMPLEAPP--->References, I see CommunicatorAPI which points to OCSDKWrapper.SampleApp\obj\Debug\Interop.CommunicatorAPI.dll and I see CommunicatorPrivate which points to OCSDKWrapper.SampleApp\obj\Debug\Interop.CommunicatorPrivate.dll

Which references am I supposed to replace?  All 6?
I redownloaded OCSDK.msi which is 1,008KB. After installing, I see:
C:\Program Files\Microsoft Office Communicator\SDK\CommunicatorAPI.dll and
C:\Program Files\Microsoft Office Communicator\SDK\CommunicatorPrivate.dll

Since the project references point to a Interop.CommunicatorAPI.dll and Interop.CommunicatorPrivate.dll, I wasn't sure if the .dlls were different from the ones I installed at: C:\Program Files\Microsoft Office Communicator\SDK\.

I tried to remove the Interop.CommunicatorPrivate.dll and Interop.CommunicatorAPI.dll and re-add an existing item which were:
C:\Program Files\Microsoft Office Communicator\SDK\CommunicatorAPI.dll and
C:\Program Files\Microsoft Office Communicator\SDK\CommunicatorPrivate.dll

I then removed the two references under OCSDKWrapper--->Lib and re-added the two .dlls
C:\Program Files\Microsoft Office Communicator\SDK\CommunicatorAPI.dll and
C:\Program Files\Microsoft Office Communicator\SDK\CommunicatorPrivate.dll

By the way, when I re-add the .references, I did so using the browse and not the .NET or COM tabs.  Not sure if that matters.  I would browse to the .dlls in C:\Program Files\Microsoft Office Communicator\SDK\

When I try to run the SampleApp, I get the same error I listed above:
"XamlParseException was unhandled"  
Cannot create instance of 'MOCSampleApp' defined in assembly 'OCSDKWrapper.SampleApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation.  Error in markup file 'MOCSampleApp.xaml' Line 1 Position 9.

I tried to be as verbose as possible.  Thanks in advance for any help.
Brown Cow.
Coordinator
Aug 19, 2008 at 8:19 PM
It looks like you set up the references correctly.

In Visual Studio, can you go to Debug --> Exceptions, and check the Thrown CLR Exceptions. When you try and run the application, Visual Studio should now stop at the line throwing the exception since it doesn't look like it's user handled.

Thanks    
Aug 20, 2008 at 3:33 PM
Edited Aug 20, 2008 at 3:41 PM
This is the error I receive.

! SecurityException occurred
Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

It appears to break at    public MOCSampleApp()

Thanks for your help.
Brown Cow
Coordinator
Aug 20, 2008 at 5:57 PM
Edited Aug 20, 2008 at 5:58 PM
Sorry, I don't have a good idea of what may be causing this.

I'd be curious to see what would happen if you were to create another application, and just access MOCAutomation.Instance.* from there.