JayPee
JayPee

Reputation: 21

System.IO.FileNotFOundException for assembly that lives in the folder for my unit test project?

I am building a project for Revit and now want to build unit tests for my C# code. The issue I am running into is that whenever I actually build the project and reference my project I get an error saying it cannot find the revit api dll. This makes no sense because the exact path saying where it can't find it is sitting right there.

System.IO.FileNotFoundException : Could not load file or assembly 'C:\Users\Joshua\source\repos\revit-addin-qa-testing-tool-backend\WebViewUnitTest\bin\Debug\net8.0\RevitAPI.dll'. The specified module could not be found.

When I use file explorer to find that path it lives right there

enter image description here

Does anyone have any idea why this may be happening?

Upvotes: 0

Views: 102

Answers (1)

Jeremy Tammik
Jeremy Tammik

Reputation: 8339

This could be due to specifying the wrong .NET framework target. Revit 2024 and prior require .NET framework 4.8; Revit 2025 requires .NET Core 8. Pay attention to the development requirements specified in the developer guide.

Upvotes: 0

Related Questions