Skip to content

IFileSystem moved to a separate nuget, creating a dependency hell in my project #1337

@borisf94

Description

@borisf94

Describe the bug

I have an issue with a project I work on,
My project depends on a third party that uses TestableIO ver 22.
My project also depends on another third party that uses TestableIO ver 21.

In the build directory I have ver 22.
When trying to execute code that uses ver 21 I get an exception:

System.TypeLoadException: 'Could not load type 'System.IO.Abstractions.IFileSystem' from assembly 'TestableIO.System.IO.Abstractions, Version=22.0.15.0, Culture=neutral, PublicKeyToken=96bf224d23c43e59'.'

To Reproduce
Steps to reproduce the behavior:

  1. Create a console app.
  2. Reference TestableIO ver 22.
  3. Reference any third party that depends on ver 21 (I use https://www.nuget.org/packages/Azure.Bicep.Core)
  4. Instantiate a class from the older ver (in my case I've instantiated BicepCompiler)
  5. Run the project to see the error.

Expected behavior
The change from ver 21 to 22 should be seamless.

Suggested solution
For this to work seamlessly, we can utilize the TypeForwardedToAttribute

This way clients of ver 21 will still be able to find IFileSystem that moved to its new location.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugIssues that describe misbehaving functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions