Luke Puplett
Luke Puplett

Reputation: 45135

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.

Upvotes: 12

Views: 11854

Answers (1)

Luke Puplett
Luke Puplett

Reputation: 45135

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 ;)

Upvotes: 40

Related Questions