Someone asked if was installed. It was not, so I installed it. I’ve tried all the suggestions presented here.
I think the real issue is this:
Could not load file or assembly ‘Microsoft.CodeAnalysis, Version=4.11.0.0, Culture-neutral, PublicKeyToken-31bf3856ad364e35’
This error occurs when your application cannot locate or load the required version of the Microsoft.CodeAnalysis assembly. It often happens due to mismatched versions, missing dependencies, or incorrect configurations.
pyRevit seems to be looking for that file, and somehow it’s not on my computer. Maybe because it’s a newer version? Although I did try loading older versions and still got an error message.
The internet answer is:
Steps to Resolve
1. Update NuGet Packages
Ensure that the Microsoft.CodeAnalysis package and related dependencies are updated to the correct version in your project.
Update-Package Microsoft.CodeAnalysis -Version 4.3.0
If you’re using Microsoft.CodeDom.Providers.DotNetCompilerPlatform, update it as well:
Update-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform
2. Restore NuGet Packages
If the issue persists, delete the packages folder and restore all NuGet packages.
dotnet restore
3. Add Binding Redirects (For .NET Framework)
For .NET Framework projects, ensure that your Web.config or App.config includes a binding redirect for Microsoft.CodeAnalysis.
4. Verify SDK Compatibility
Ensure that the version of Microsoft.CodeAnalysis is compatible with your .NET SDK version. For example, some versions of Roslyn require specific SDK versions.
5. Clean and Rebuild
After making changes, clean and rebuild your solution to ensure all dependencies are correctly loaded.
dotnet clean
dotnet build
By following these steps, you should be able to resolve the error and ensure your application runs smoothly.
Which is all Greek to me and WAY out of my wheelhouse.