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.IO.FileNotFoundException #957

Closed
sungam3r opened this issue Feb 8, 2021 · 7 comments · Fixed by #959
Closed

System.IO.FileNotFoundException #957

sungam3r opened this issue Feb 8, 2021 · 7 comments · Fixed by #959
Labels
Bug This issue describes behavior that is not working as expected
Milestone

Comments

@sungam3r
Copy link

sungam3r commented Feb 8, 2021

See explanation in DotNetAnalyzers/IDisposableAnalyzers#259

How to deal with that error ?

@JoeRobich
Copy link
Member

@sungam3r Thanks for opening this issue. I added a test for this analyzer package. It had no issue loading on its own, so the issue may be that multiple versions of the Gu.Roslyn.Extensions are being loaded and we are not isolating these dependencies (which is a bug filed under #734).

I also noticed that the FixAllProviders were failing from this package and implemented a fix to support them. See #958.

@JoeRobich JoeRobich added the Question This issue is requesting information about dotnet-format label Feb 8, 2021
@JoeRobich JoeRobich added Bug This issue describes behavior that is not working as expected and removed Question This issue is requesting information about dotnet-format labels Feb 8, 2021
@JoeRobich
Copy link
Member

After updating the test to load more of the Analyzers from your project, the true issue was revealed. We resolve dependencies when the Analyzer and CodeFix types are realized. However, we were only tracking the last analyzer assembly paths as a search path. In this case the Gu.Roslyn.Extensions assembly isn't present in that final path causing the FileNotFoundException.

@JoeRobich
Copy link
Member

Going to take this a step further and simply isolate each analyzer into its own assemblyloadcontext.

@sungam3r
Copy link
Author

sungam3r commented Feb 8, 2021

I'm glad to hear that.

@sungam3r
Copy link
Author

sungam3r commented Feb 8, 2021

How can I get a new version to try the fix?

@JoeRobich
Copy link
Member

@sungam3r Typically we have a nightly build, but I kicked it off special for these fixes. You should be able to uninstall and reinstall the dotnet-format tool to get the latest version.

@sungam3r
Copy link
Author

sungam3r commented Feb 9, 2021

Thank you. It works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This issue describes behavior that is not working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants