Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.lO.FileNotFoundException: #24

Closed
5616760 opened this issue Feb 19, 2024 · 3 comments
Closed

System.lO.FileNotFoundException: #24

5616760 opened this issue Feb 19, 2024 · 3 comments
Labels
bug Something isn't working Revit2021
Milestone

Comments

@5616760
Copy link

5616760 commented Feb 19, 2024

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

@NeVeSpl
Copy link
Owner

NeVeSpl commented Feb 19, 2024

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

@5616760
Copy link
Author

5616760 commented Feb 20, 2024

revit 2021,
image
image

@NeVeSpl NeVeSpl added bug Something isn't working Revit2021 labels Feb 23, 2024
@NeVeSpl
Copy link
Owner

NeVeSpl commented Feb 26, 2024

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>

@NeVeSpl NeVeSpl added this to the v2.2.3 milestone Feb 26, 2024
@NeVeSpl NeVeSpl closed this as completed Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Revit2021
Projects
None yet
Development

No branches or pull requests

2 participants