System.IO.Abstractions icon indicating copy to clipboard operation
System.IO.Abstractions copied to clipboard

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

Open morrisonbrett opened this issue 3 years ago • 5 comments

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 avatar Nov 19 '21 02:11 morrisonbrett

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

<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>

morrisonbrett avatar Nov 19 '21 23:11 morrisonbrett

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?

fgreinacher avatar Nov 22 '21 10:11 fgreinacher

Not sure. Maybe @davidfowl knows?

morrisonbrett avatar Nov 22 '21 17:11 morrisonbrett

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

flq avatar Jan 11 '22 10:01 flq

@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?

fgreinacher avatar Jan 11 '22 12:01 fgreinacher