Giter Club home page Giter Club logo

Comments (6)

StephenCleary avatar StephenCleary commented on September 16, 2024

What's the target platform for this code?

If you need an immediate solution, you can use SemaphoreSlim (built-in to newer versions of .NET). The syntax is a bit more awkward but it'll get the job done.

from asyncex.

mol avatar mol commented on September 16, 2024

Thanks for the fast reply :)

Framework is 4.5.1 and platform is x86. I'm awaiting other stuff, which works fine - just for some reason not this one.

I didn't know the SemaphoreSlim could handle the await inside, but I'll check that out, thanks.

from asyncex.

StephenCleary avatar StephenCleary commented on September 16, 2024

OK, SemaphoreSlim is available on that platform. It's just a bit more awkward because you have to use try/finally instead of using.

I'll look into this later tonight.

from asyncex.

mol avatar mol commented on September 16, 2024

I just tried the AsyncLock from here instead:
http://blogs.msdn.com/b/pfxteam/archive/2012/02/12/10266988.aspx

I took everything exactly and not changing anything in your example, and it compiled. I'm using your NuGet package by the way - I don't know if that makes any difference. Strange. Anyway - thanks for looking into it :)

from asyncex.

StephenCleary avatar StephenCleary commented on September 16, 2024

Sorry, I've tried this with a few versions of VS, and I'm not able to repro this behavior.

It's possible that something got messed up during the NuGet install (or something weird happened like it was installed while the project was targeting .NET 4.0). If you could post a minimal repro, I can reopen this issue.

from asyncex.

mol avatar mol commented on September 16, 2024

That's alright, thanks for looking into it. I took your suggestion and used SemaphoreSlim instead, so until I need more complex async handling I'm good :) Thanks again.

from asyncex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.