The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

P.H.M. (2) [Avatar] Offline
#1
First of all - I do like the book so far. It has provided me with some excellent insight to AOP and as starting to grasp the idea and how to implement, it is of great use! Thank you!

However, I do have one suggestion or rather question.

Why do you no use the language feature of C# 5.0 (async & await)?
Does PostSharp not support that?
Or is there another reason?
matthew.groves (46) [Avatar] Offline
#2
Re: use of await/async C# 5.0
You aren't the first to ask smilie

You can replace use of Thread with Task in aspects. I've added this to the book, but it's not in the MEAP yet.

And here's a blog post about async/await in regards to PostSharp: http://www.sharpcrafters.com/blog/post/C-50-asyncawait-vs-PostSharp.aspx
P.H.M. (2) [Avatar] Offline
#3
Re: use of await/async C# 5.0
Thank's for the reply.
I tried to replace 'Thread' with 'Task' and it worked fine.
And from the article you've directed me to I learned that PostSharp itself does not support async/await (yet).
I hope to see the next chapters of your book any time soon!
Cheers,
Peter
matthew.groves (46) [Avatar] Offline
#4
Re: use of await/async C# 5.0
Saying that PostSharp doesn't "support" async/await isn't quite accurate. You can use any language feature you want inside of an aspect.

The PostSharp Threading Toolkit has some features that might help with async/await, but note that the PostSharp toolkits only work with the full paid version of PostSharp. For more information, see this post: http://www.sharpcrafters.com/blog/post/PostSharp-Threading-Toolkit-Thread-Dispatching.aspx