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

IAsyncDisposable Support? #560

Closed
Mike-E-angelo opened this issue Dec 24, 2021 · 10 comments
Closed

IAsyncDisposable Support? #560

Mike-E-angelo opened this issue Dec 24, 2021 · 10 comments

Comments

@Mike-E-angelo
Copy link

Greetings,

Looking through the issues and I do not see any mention of IAsyncDisposable. I do see this issue:

dotnet/extensions#1751

But it does not look like anything definitive was made from that conversation.

I would like to create this issue to track this.

Thank you for any consideration. 🙏

@seesharper
Copy link
Owner

seesharper commented Jan 17, 2022

Hi @Mike-E-angelo and happy new years although a little late :)

Yeah, you@re right. This is something that should have been implemented for quite some time.

Right now I'm trying to clean up all the TFM's in LightInject.

Up until now I've had all these target frameworks in the test project in order to test all different TFM's in LightInject.

Supporting different version of netstandard is a big pain in the b.... 😀. Even worse when it comes to testing.

But then I came across this on SO https://stackoverflow.com/questions/48526219/is-there-a-way-to-force-a-project-reference-to-net-standard-project-to-a-specif

I assume that's you. You always have this politeness and a positive spin I wish I saw more of in the OSS community 👍

Anyways, IAsyncDisposable is next once I've cleaned up my test projects

@Mike-E-angelo
Copy link
Author

Awww thank you for that @seesharper, that really means a lot and made my day! I am still grateful for your efforts in seesharper/LightInject.Microsoft.AspNetCore.Hosting#54 and am still amazed you took the extra effort of actually installing an Oauth application to get it to reproduce. I was actually thinking about that last month or so and how cool that was and thought for sure I was up a creek with that issue. But to the contrary, it is the only issue I encountered and everything has been working great with LightInject since!

Incidentally, I am still working on that same application and LightInject is very much a part of it. It's been two years of full development and I am about to post and make an announcement in a few weeks' time. I'll be sure to update here with the info. :)

BACK ON TOPIC HERE 😅... sounds good on the rest. I've had to do some workarounds to get IAsyncDisposable working but having it as a first-class feature from the DI container would be great and most definitely appreciated. Looking forward to any progress. 👍

@Mike-E-angelo
Copy link
Author

I'll be sure to update here with the info. :)

FWIW I announced this product yesterday:
https://blog.starbeam.one/2022/02/announcing-mvp-alpha-preview/

And LightInject is mentioned in my acknowledgements here:
https://alpha.starbeam.one/about/acknowledgements

@seesharper
Copy link
Owner

@Mike-E-angelo IAsyncDisposable in LightInject 👍😃 #573

@Aragas
Copy link

Aragas commented Sep 19, 2022

There's an issue with it! net462 and netstandard2.0 do not support both IAsyncDisposable and ValueTask, so they are broken now!

@Aragas
Copy link

Aragas commented Sep 19, 2022

Could this be enabled/disabled via a define variable? We can't afford to import Microsoft.Bcl.AsyncInterfaces!

@seesharper
Copy link
Owner

You can conditionally add the package like it is done in LightInject.csproj

 <ItemGroup Condition=" '$(TargetFramework)' == 'net462' OR '$(TargetFramework)' == 'netstandard2.0'">
    <PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
  </ItemGroup>

@Aragas
Copy link

Aragas commented Sep 19, 2022

I understand, but we can't add new dependencies. We use LightInject.Source because it didn't introduce any external dependencies

@seesharper
Copy link
Owner

I understand. We will enable this only for netcoreapp3.1 and above 👍😃 #574

@Mike-E-angelo
Copy link
Author

Very awesome @seesharper ! Thank you very very much for attending to this. 👍 Unfortunately my codebase is baked and fried at this point but I will definitely keep it in mind going forward. :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants