NeVeSpl / RevitDBExplorer

Interactive Revit database exploration tool to view and edit BIM element parameters, properties and relationships.
Apache License 2.0
184 stars 40 forks source link

System.lO.FileNotFoundException: #24

Closed 5616760 closed 8 months ago

5616760 commented 8 months ago

有人遇到这个问题吗?一点生成代码就这样:System.lO.FileNotFoundException: 未能加载文件或程序集'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken= b03f5f7f11d50a3a "或它的某一 个依赖项。系统找不到指定的文件。

NeVeSpl commented 8 months ago

What version of Revit are you using? And when does this exception occur?

5616760 commented 8 months ago

revit 2021, image image

NeVeSpl commented 8 months ago

So it looks like there is some incompatibility between some of System.Text.Json dependencies and some of the dependencies of Revit.

I am pretty sure that I have made it work in the past, it is interesting that this problem has come back.

As a quick workaround, you can edit Revit.exe.config file which is placed right next to Revit.exe and add to it:

<dependentAssembly>
    <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>