Latest versions of Milestone SDK nugets throws an exception

In our .NET Framework 4.8 plugin, when we want to use the latest Milestone.SDK nugets we are facing these problems:

When using MilestoneSystems.VideoOS.Platform.SDK version 23.3.1/23.2.1, throwing exception “Could not load file or assembly ‘System.Net.Http.Formatting, Version=5.2.6.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.” exception.

When downgraded Microsoft.AspNet.WebApi.Client from 5.2.7 to 5.2.6, SDK Version is downgrading to 22.2.0 and further throwing below expectations:

Could not load file or assembly ‘System.IdentityModel.Tokens.Jwt, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.

Could not load file or assembly ‘Microsoft.IdentityModel.Tokens, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.

The type initializer for ‘System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler’ threw an exception.

After downgrading System.IdentityModel.Tokens.Jwt, Microsoft.IdentityModel.Tokens, Microsoft.IdentityModel.Logging to 5.6.0 we can see the Video without exceptions.

Is there any solution on how to use the latest Milestone.SDK nugets?

Hi, I’ve been unable to reproduce this behavior, could you please share exactly which steps you go through to reach this point? What template are you using? Any specific code changes that cause the issue?

What I did was create a project based on the MIP Library template, as a stand-alone WPF app, changed the target framework to .NET Framework 4.8, and tried adding simple functionality to get Items from Configuration.Instance. I was able to build and run this project with no issues what so ever.

Best Regards,

Simon

We have below Application Structure:

1. Host Application - WinForm exe built on .net framework 4.8 which hosts Plugin Application

2. Plugin Application - developed as . net framework class library with WinForms UserControl which uses Milestone SDK.

Using Basic Authentication to Login. After Initializing SDK and UI, when trying to Add Credential Cache exception described above is thrown. This happens only with particular Milestone SDK version.

Hi,

I’ve tried doing it in a WinForms solution now as well, I am still unable to reproduce the error you are seeing. Can you verify that all of your projects are building in x64 configuration? Both SDK 23.3.1 and 23.2.1 work for me.

Best Regards,

Simon

Hello,

I have also encountered this problem, and after a long battle the solution that worked for me was to add the following to the app.config inside the element:

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
	<dependentAssembly>
		<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
		<bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
	</dependentAssembly>
</assemblyBinding>