Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7812083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:23:52+00:00 2026-06-02T04:23:52+00:00

I am quite new to Metro dev and I only hope I will be

  • 0

I am quite new to Metro dev and I only hope I will be able to express my question in an understandable way…

Actually I am porting a part of my old application to Metro. The logic part is a separated project (Portable Library) and it should serve to 1) the old WPF app and 2) the new Metro app. The basic logic is the same but some subsystems (for example file operations manager) must be coded differently – i.e. async way for Metro.

My question is: Do I have to rewrite the whole chain of methods caller-callee to the new async paradigm? Let’s say I have a chain of 4 methods, starting by method A = Metro UI event async handler (it makes sense to me to code it as async void as it is the top fire&forget event), through the next 2 methods (B and C) placed in different layers of my application, down to the method D containing “await CreateFileAsync” method (made async by Microsoft).

Now: async CreateFileAsync method should be called with await. That forces me to make method D async too. To call method D from C and C from B and B from A – do I have to rewrite all A, B and C into the async-await style?

I can feel I am missing a deeper knowledge so I am trying to educate myself but concurrently I wanted to try my luck here…

Do I have to rewrite a big part of my code? Is any of my statements above wrong?

Many thanks in advance, Hans

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T04:23:54+00:00Added an answer on June 2, 2026 at 4:23 am

    I recommend that you do rewrite your portable library to be asynchronous. It’s not as bad as it used to be; Microsoft worked very hard on async/await to make it as easy as possible to convert synchronous code to asynchronous. I expect that a whole lot of others will be doing the same in the near future, and R# will probably implement a “make async” rewriting.

    There are non-obvious pitfalls when mixing synchronous and asynchronous code – see Stephen Toub’s last blog post Should I expose synchronous wrappers for asynchronous methods? For this reason, I think it’s just cleaner to expose asynchronous operations as asynchronous APIs (and synchronous operations as synchronous APIs).

    Update: If you do want synchronous code to call asynchronous code, then you can use the Task.WaitAndUnwrapException extension method in my AsyncEx library. However, you still have the problems mentioned in Stephen Toub’s post, namely these:

    1. You can deadlock if your library doesn’t use ConfigureAwait(false) everywhere it can.
    2. You can also deadlock if you run into the maximum number of threads in the thread pool.

    (2) is not that common anymore, but (1) is a real possibility. It’s regularly brought up by people who are just testing out async so they mix it with synchronous code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm quite new in PHP dev and I can't find a way to solve
I am quite new to Aforge.Net and I am looking for a way to
Am quite new to namespacing etc so hopefully this will be straightforward. I have
Being quite new at JavaScript, I'm assuming the answer to my question is extremely
I am quite new and I hope it's not too obvious, but I just
Quite new to xslt so forgive me if this is a basic question -
I'm quite new at Rails but can find my way around for the time
Im quite new to NHibernate and I am having a question regarding the Mapping
im quite new to android, so i apologise if this is a noob-ish question
I quite new with CMake, but I have a problem with porting an existing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.