Is there a way to fix Visual Studio not being able to load Milestone libraries in design mode?

We have some WPF controls that reference the Milestone libraries in their code behinds. But when we try to view the controls in the XAML designer, we get this error: “Could not load file or assembly ‘VideoOs.Platform.SDK.UI, Version …’ or one of its dependencies. The system cannot find the file specified.”

Has anyone run into this before? We have a build script that copies the neccessary Milestone files to the debug directory. Maybe the problem is that the designer cannot access those files?

What version is the MIP SDK? (MIP SDK 2018R2?)

Please double-check that you have copied all the dlls from the current SDK bin folder and have no older dlls among them.

I looked into this some more and it seems like this error has to do with the platform we are targeting. We were using 2018R1 but I tried updating to R2 and I have the same problem. I followed your instructions and copied all of the dlls from the current SDK bin folder into the project folder where we are using them:

Here are the assemblies we are using in our project:

VideoOS.Platform

VideoOS.Platform.SDK

VideoOS.Platform.SDK.Export

VideoOS.Platform.SDK.UI

If we change our build configuration to target Any CPU, we get an error that the SDK.Export and SDK.UI assemblies target the 64-bit platform and so our project needs to target 64-bit only.

But if we target 64-bit and try to view our custom control in the designer, we get an error that “This document contains one or more controls that have been modified. Please rebuild the project for the changes to display in the Design view.” And we can’t see the control in the designer. I’ve tried cleaning and rebuilding the solution but it hasn’t helped.

It seems like this is an issue with Visual Studio and projects that target the 64-bit platform. Apparently the Designer doesn’t work well with these types of projects. The below link discusses this problem:

https://stackoverflow.com/questions/5378919/visual-studio-designer-in-x64-doesnt-work

I have a few questions:

  1. Does anyone else have this problem of not being able to view controls in the designer when referencing the SDK dlls and targeting the 64-bit platform?
  2. Is there anyway we can target 64-bit and use the designer?
  3. If not, is there anyway to get dlls that don’t target 64-bit?

You cannot use ImageViewerControl in this way but you should be able to use ImageViewerWpfControl this way. I never asked: what Milestone control(s) is it you are working with?

We are going to be using the ImageViewWpfControl. But right now we’re only using the DialogLoginForm which is part of VideoOS.Platform.SDK.UI.LoginDialog.

The issue seems to be that some of the Milestone SDKs target 64-bit so our project has to target 64-bit and Visual Studio doesn’t work as well with WPF as it would if we targeted 32-bit. But there doesn’t seem to be much we can do about that. The designer preview still works - we just get a warning. Hopefully that is the only problem we’ll have and we can just ignore it.