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

Azure Functions in .NET 6. Failed to load System.IO.Abstractions. #761

Open
morrisonbrett opened this issue Nov 19, 2021 · 5 comments
Open
Labels
state: needs discussion Issues that need further discussion type: bug Issues that describe misbehaving functionality

Comments

@morrisonbrett
Copy link

morrisonbrett commented Nov 19, 2021

Cannot run with System.IO.Abstractions latest version

To Reproduce

Create an Azure Functions project for .NET 6.
Run it. Note the runtime error:

[2021-11-19T02:33:26.035Z] Could not load file or assembly 'System.IO.Abstractions, Version=13.0.0.0, Culture=neutral, PublicKeyToken=96bf224d23c43e59'. The system cannot find the file specified.

Expected behavior
It properly loads

Would be great if there was a way to get System.IO.Abstractions to load regardless of what version is expected. How?

@morrisonbrett morrisonbrett added state: needs discussion Issues that need further discussion type: bug Issues that describe misbehaving functionality labels Nov 19, 2021
@morrisonbrett
Copy link
Author

I got past it! THIS fixed it for me. Add this to a <PropertyGroup> in your .csproj.

<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>

@fgreinacher
Copy link
Contributor

I got past it! THIS fixed it for me. Add this to a <PropertyGroup> in your .csproj.

<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>

OK, this is really weird. Any idea why this is necessary?

@morrisonbrett
Copy link
Author

Not sure. Maybe @davidfowl knows?

@flq
Copy link

flq commented Jan 11, 2022

I really have questions here 😅...

  • How did you people figure out that that Property value would fix the issue?
  • why would any build step involving the function host in fact remove assemblies that are referenced by the functions project?
  • Why is this issue closed?

Apart from that, yes, after adding that property, my .NET6 / Function Tools v4 project starts again with System.IO.Abstractions usage

@fgreinacher
Copy link
Contributor

@fabiocav I see you have last touched the clean-up list https://github.com/Azure/azure-functions-host/blob/dev/tools/ExtensionsMetadataGenerator/test/ExtensionsMetadataGeneratorTests/ExistingRuntimeAssemblies.txt.

Should the third-party-library System.IO.Abstractions.dll (from this repository) really be there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: needs discussion Issues that need further discussion type: bug Issues that describe misbehaving functionality
Projects
None yet
Development

No branches or pull requests

3 participants