Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Type or namespace name 'async' could not be found

In VS2012.2 I have a week-old ASP.NET MVC 4 app targeting .NET 4.5 that, if I use the async keyword, works as expected.

In a class library project created around the same time, targeting 4.5, I cannot use the async keyword.

So I created a new ASP.NET MVC 4 (4.5) web app project and again I am unable to use async

Type or namespace name 'async' could not be found

It's one of those problems where I feel like I'm doing something totally stupid. Afterall, I was in Le Mans watching the race and drinking all weekend.

I mean, it should just work in any .NET 4.5 project right? Its a compiler feature.

like image 874
Luke Puplett Avatar asked Jun 27 '13 11:06

Luke Puplett


1 Answers

Blimey. It was something stupid, just didn't add the void or the return type! Obviously async is interpreted as a type since I didn't include one. I could delete my question, but I'm happy to look like a fool if it helps others ;)

like image 66
Luke Puplett Avatar answered Oct 04 '22 23:10

Luke Puplett