Could not load file or assembly 'Autodesk.Navisworks.Api

Could not load file or assembly 'Autodesk.Navisworks.Api

Anonymous
Not applicable
9,184 Views
14 Replies
Message 1 of 15

Could not load file or assembly 'Autodesk.Navisworks.Api

Anonymous
Not applicable

Hi all, hoping you might be able to suggest something here. When trying to debug my C# console application in VS 2017 I'm hitting

"System.IO.FileNotFoundException: 'Could not load file or assembly 'Autodesk.Navisworks.Api, Version=15.0.1314.36, Culture=neutral, PublicKeyToken=d85e58fa5af9b484' or one of its dependencies. The system cannot find the file specified.'" despite the reference to the DLL appearing as valid (C:\Program Files\Autodesk\Navisworks Manage 2018\Autodesk.Navisworks.Api.dll) in VS.

 

I'm using Navisworks Manage 2018 under an educational licence on Win10. Is it the licence itself which is the issue?

 

Thanks in advance for any help!

0 Likes
9,185 Views
14 Replies
Replies (14)
Message 2 of 15

eceballostorres
Participant
Participant

Dear cmalins  this post will guide you through the very basics of Navisworks API. It also contains some samples that you could try in order to verify whether is a configuration issue or a software issue.

 

Are you trying to create a console application that runs outside the Navisworks environment? If that's the case, I'm not sure how the software is going to behave as I've never tried to do such thing.

0 Likes
Message 3 of 15

rob.todd
Autodesk
Autodesk

I am having the same issue.  I do have Navisworks Manage 2016 installed and my VS 2017 .NET app runs fine for that version , but when I port it to Navisworks Manage 2018, I get this issue.

Rob Todd
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdamassets.autodesk.net%2Fcontent%2Fdam%2Fautodesk%2Flogos%2Fautodesk-logo-primary-rgb-black-small_forum.png&data=04%7C01%7Crob.todd%40autodesk.com%7Ccb47078d51ff460d7d3708d974a1cd34%7C67bff79e7f914433a8e5c9252d2ddc1d%7C0%7C0%7C637669061414398630%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Ttm815pNzWGJcWX3n5NtAT6xuBI1XyB4rLmTVx%2BCSP4%3D&reserved=0
0 Likes
Message 4 of 15

eceballostorres
Participant
Participant

Dear rob.todd, a couple of things come to my mind.

 

1. Your Navisworks 2018 assemblies location has changed: in this case go to your Navisworks installation directory and look for the new 2018 dlls and reference those.

2. Some of your projects are targeting to different .NET framework versions: try having them all to point to the same .NET framework.

 

If none of those work, try removing the references and adding them again.

 

Hope that helps.
Emanuel.

0 Likes
Message 5 of 15

rob.todd
Autodesk
Autodesk

All projects in the VS solution are targeting the same .NET framework.

 

All projects in the VS solution are referencing the correct Navisworks DLL assembly files.

 

I have removed and re-added reference DLLs from each project in the VS solution.

 

The Navisworks 2018 app still throws the same exception.

 

I have tried reinstalling Navisworks Manage 2018, but no change.

 

The only way I can get my 2018 app to run is to copy the referenced Navisworks 2018 .NET assembly files to my output folder (Copy local = true).  This is not the case with my 2016 app.

 

Thanks,

 

Rob

 

 

Rob Todd
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdamassets.autodesk.net%2Fcontent%2Fdam%2Fautodesk%2Flogos%2Fautodesk-logo-primary-rgb-black-small_forum.png&data=04%7C01%7Crob.todd%40autodesk.com%7Ccb47078d51ff460d7d3708d974a1cd34%7C67bff79e7f914433a8e5c9252d2ddc1d%7C0%7C0%7C637669061414398630%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Ttm815pNzWGJcWX3n5NtAT6xuBI1XyB4rLmTVx%2BCSP4%3D&reserved=0
0 Likes
Message 6 of 15

Anonymous
Not applicable

I have the same problem:  reference to Autodesk.Navisworks.Api not found.

I sould not even ask a question if I could remove the reference and add it again manualy.

But I can't find such library - Autodesk.Navisworks.Api.dll all over my disk.

Where must I get this library?

Must  it be set up with Navisworks Manage 2018 ?

May be it's removed when trial period ends?

Where can I read more about it?

Message 7 of 15

Craig.Windram
Contributor
Contributor

It has been my experience over the last couple of years that some fundamental things are 'broken' in Navisworks 2018.  Switchback doesn't work with Revit 2018 and Autodesk opted not to fix it after I raised a ticket on it.  We have also had issues with Vault integration for reasons I won't go into, that Autodesk need to fix from the Navisworks side. I am having a similar problem to this one. I have created numerous in house plugins for Navisworks with no DLL issues until now. I am trying to utilise the Api.Controls for the first time and have the same issue as described above for the Control API.  Autodesk need to proof their code better prior to product release, especially with what they charge for licensing.

API Controls.png

0 Likes
Message 8 of 15

bvgarbar
Contributor
Contributor

Hi, dear Craig!

I also had this problem.

Try to click off this check box. 

Screenshot_16.png

Message 9 of 15

Anonymous
Not applicable

I have similar issue when I use Navisworks 2018. Have you resolved this?

0 Likes
Message 10 of 15

Craig.Windram
Contributor
Contributor

This will most likely only be resolved if somebody raises a service ticket with Autodesk.  I have not had good responses with previous tickets so personally I won't be doing that.

0 Likes
Message 11 of 15

Anonymous
Not applicable

This issue is resolved after installing Navisworks Simulate 2018 Update 2.

Make sure to set "Copy to Local = True" for Autodesk.Navisworks.Resolver.dll, and "Copy to Local=False" on all remaining Navisworks dlls in your Visual Studio solution.

Message 12 of 15

Craig.Windram
Contributor
Contributor

Sravan,

 

  Haven't tried it yet but thanks for the update.

 

Regards,

Craig

0 Likes
Message 13 of 15

DeanLyon2
Contributor
Contributor

I am having this issue with Navisworks Simulate 2019.  I have working projects in Simulate 2016.  I have tried local and non local for Autodesk.Navisworks.Api.  Navisworks Simulate works on the machine.  I have tried Visual Studio 2015 and 2019.  Any recomendataions?  The project is set to x64 and .NET 4.7.1

0 Likes
Message 14 of 15

DeanLyon2
Contributor
Contributor

The solution does not compile with .NET version earler than 4.7. An error is given that the DLLs were complied against. .NET 4.7.  However, My only setting for .NET at 4.7 or above is 4.7.2  Which compiles but can not interact with/ load the DLLs

 

0 Likes
Message 15 of 15

DeanLyon2
Contributor
Contributor

.NET 4.7 is correct. Copy Local is True on Resolver and False on the other Navisworks references.  These settings made the issue go away.

0 Likes