Hello,
I'm trying to develop a CommandHandlerPlugin for Navisworks Manage 2024.
using System;
using System.Windows;
using Autodesk.Navisworks.Api.Plugins;
using Azure.Identity;
namespace NavisworksPlugin
{
[Plugin("NavisworksPlugin", "me")]
[RibbonLayout("RibbonLayout.xaml")]
[RibbonTab("RibbonTab")]
[Command("Button")]
public class Program : CommandHandlerPlugin
{
public override int ExecuteCommand(string name, params string[] parameters)
{
try
{
_ = new InteractiveBrowserCredential();
}
catch (Exception ex)
{
_ = MessageBox.Show(ex.Message);
}
return 0;
}
}
}
So I've created a .NET 4.8 Class Library but I get this error at runtime:
System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Text.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'
I tried to add it manually in the App.config but didn't change anything:
<dependentAssembly>
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.10" newVersion="6.0.0.10" />
</dependentAssembly>
Build is deployed there :
- C:\Program Files\Autodesk\Navisworks Manage 2024\Plugins\NavisworksPlugin\*
- C:\Program Files\Autodesk\Navisworks Manage 2024\Dependencies\*
I can see System.Text.Json 6.0.10 is a transitive package from Azure.Identity but I don't understand why it is the version 6.0.0.0 that is required at runtime (when it is indeed version 6.0.10 required).
I tried to override installation using 6.0.10 and the error went away (with strong warnings) but then I have a new error of another package System.Memory that require an unavailable version from NuGet.
How to manage package depedencies?
Thanks,