Lync API using PresenceIndicator outputting TypeInitializationException within InitializationCompleted - wpf

I am using the Lync API within a WPF application. I have used the Office365 Lync Lab 9.1 within the training kit. However when I move the code into my WPF application the PresenceIndicator or ContactList doesn't work. The controls are displayed however the status of the Lync user is not shown. I am using the exact same accounts that are working within the Office365 Training Lab 9.1.
When I add logging I am shown errors like the following for the PresenceIndicator:
Applying template...
Control 'PresenceIndicator' entering 'OnLoaded'
UCClientInitializationFailed:Failed to Create Provider. Error Type: TypeInitializationException
I am also trying the ContactList and that is outputting:
UCClientInitializationFailed:Failed to Create Provider. Error Type: TypeInitializationException
Also the InitializationError property within the InitializationCompleted event is showing an Unknown error. How would I troubleshoot this issue further?

This is a complete stab in the dark, but are you attempting to add controls to an existing WPF application that has never integrated with Lync before?
It may be that you are missing references in your app - double-check you have references to the following files in %program files%\Microsoft Lync\SDK\Assemblies\Desktop
Microsoft.Lync.Controls.dll
Microsoft.Lync.Controls.Framework.dll
Microsoft.Lync.Model.dll
Microsoft.Lync.Utilities.dll
Microsoft.Office.Uc.dll
Also worth checking:
Is your app builing against .NET Framework 3.5 or 4?
Are you building for AnyCPU?
If that doesn't help, you could try creating a new WPF application using the "Lync WPF Application" template in Visual Studio. If this works correctly, then compare this against your appplication for any differences in references, configuration etc.
This MSDN page may be useful.

Related

.Net 6.0 WPF Click Once Publish error: System.IO.DirectoryNotFoundException: Could not find a part of the path

Trying to publish a .Net 6 WPF application using Click Once. I get the following error:System.IO.DirectoryNotFoundException: Could not find a part of the path 'c:\users\bhrob\source\repos\edsexecsln\edsexec.wpf\bin\release\net6.0-windows10.0.17763.0\win-x64\app.publish'
I changed the settings in the publish dialog trying different combinations without success, and always get a version of the above message. The publish process does not seem to create the win-x64\app.publish portion of the path.

Visual studio 2019 and IdentityServer project template

Trying to follow the tutorials for IdentityServer using Visual studio 2019.
As per the instructions created a .Net Core Web Application and then an MVC project type and as per tutorials a welcome screen for IdentityServer should come at run time
But i am getting an MVC page template only like this
Is there any difference in project templates based on new visual studio updates? Or what is the correct selection of project types to get the window similar to the first image ?
It seems you are running the mvc application insteed of the identity provider service.
Go to the solution properties, Common Properties, and select Multiple startup projects. Then change the Action to Start for debug all your projects.
If you prefer start only your identity provider service set it as the Single startup project.

Can't get Dynamic Data Display working with WPF Browser Application

Can I get Dynamic Data Display library working with WPF Browser App? I'm getting "Target Invocation Exception" when attempting to launch the app, regular desktop WPF app runs just fine.
Update 1: "That assembly does not allow partially trusted callers." is the error, got it by adding D3's chart plotter dynamically. Looking into it now.
Fixed by switching to "This is a full trust application" option in the Security tab of my project's properties. May not be appropriate for everyone, check for the potential implications of it. Did the trick for me though.

visual studio extensibilty - How can I check if Silverlight debugging is enabled in an ASP.NET Web Site?

How can I programatically check whether a Web Site has Silverlight debugging enabled (ie, whether the "Silverlight" checkbox under "Property Pages->Start Options" is checked)?
I know that for a Web Application (WAP), I can check this via EnvDTE ( by checking project.Properties.Item("WebApplication.SilverlightDebugging").Value), but for a Web Site, I can't find an equivalent property.
For a Web Site project, there are properties named EnableASPXDebugging, EnableUnmanagedDebugging, and EnableSQLServerDebugging, but strangely there is no EnableSilverlightDebugging property. This might be a bug in Visual Studio.
Properties for Web Site projects are saved to the following file:
C:\Users\username\AppData\Local\Microsoft\WebsiteCache\Websites.xml
As a last resort, you can parse the file and read the value of the enablesilverlightdebugging attribute for your particular <Website>. Unfortunately, it seems that this file does not get updated until the project is closed, so the file may be out of sync with the actual setting.

Silverlight debug problem blank page

I have a Visual Studio 2010 and silverlight 4 over it. When I'm trying to run a simple application hello world in a browser, it shows only the blank page.
The type 'Deployment' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.
I think the problem is above but how can I solve it?
did you use silverlight with web application? When you create a silverlight app it have one web site associated. On the default.aspx, you have the object. Check the parameters off the object and verify if everything is ok and you have installed all components that support it.

Resources