locked
async Task gives compiler warning

    Question

  • I have a method that is declared async Task. Sometimes I want to call it asynchronously and sometimes synchronously. That compiles fine but I get a compiler warning. Can I suppress a compiler warning on a case by case basis?


    • Edited by Arne MN Wednesday, November 21, 2012 1:10 PM
    Friday, October 5, 2012 8:14 PM

Answers

  • I have a method that is declared async Task. Sometimes I want to call it asynchronously and sometimes synchronously. That compiles fine but I get a compiler warning. Can I suppress a compiler warning on a case by case basis?

    I hope you find the following link useful:

    http://msdn.microsoft.com/en-us/library/vstudio/edzzzth4(v=vs.100).aspx


    If you want something you've never had, you need to do something you've never done.
    Everyone(not just the thread starter) should take the time to mark helpful posts, propose answers, and mark answers to questions.

    • Marked as answer by Arne MN Wednesday, November 21, 2012 1:10 PM
    Monday, November 19, 2012 11:59 PM

All replies

  • What compiler warning are you receiving?

    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    • Proposed as answer by Paul Ishak Monday, November 19, 2012 11:57 PM
    Friday, October 5, 2012 8:36 PM
    Moderator
  • I have a method that is declared async Task. Sometimes I want to call it asynchronously and sometimes synchronously. That compiles fine but I get a compiler warning. Can I suppress a compiler warning on a case by case basis?

    I hope you find the following link useful:

    http://msdn.microsoft.com/en-us/library/vstudio/edzzzth4(v=vs.100).aspx


    If you want something you've never had, you need to do something you've never done.
    Everyone(not just the thread starter) should take the time to mark helpful posts, propose answers, and mark answers to questions.

    • Marked as answer by Arne MN Wednesday, November 21, 2012 1:10 PM
    Monday, November 19, 2012 11:59 PM