I've created a NuGet package with several assemblies in it to be used for an Add-In for Autodesk Inventor. It's a Solution in Visual Studio 2019 which consists of 3 .net Framework 4.8 Class Library projects all which are referencing the same NuGet package. I've added the NuGet package to all Projects and everything seems to be fine. The solution also builds just fine, but problems occur when starting the Inventor software.
When starting Inventor, the add-in is automatically loaded in Inventor, but then it says it's missing an assembly from the NuGet Package and fails to load. The message is System.IO.FileNotFoundException: Could not load file or assembly ... or one of its dependencies. The system cannot find the file specified.' But it's also possible to load the add-in after starting Inventor, when I do that, it works fine and doesn't prompt that the file is missing..
Does anyone have an idea what's causing this?
Thanks in advance.
EDIT: It seems that the project containing the reference isn't fully loaded at startup somehow. The startup project uses functions from another project in the solution. This works, but not when one of the functions references an assembly from the NuGet package. There's an OnReady event in Inventor which is fired when all add-ins are loaded, and when I place the code referencing the assembly in that section, it works fine.
I've discovered the problem. We're doing a migration to a newer version and it seems that the assemblies are now referencing other assemblies (which wasn't the situation in the previous version). So it's not missing the file of the referenced assembly itself, but another assembly. By copying the missing assemblies to the add-in directory of Inventor, the problem was fixed.