Thank goodness, I cam across a page that did have the gear icon you told me about. Thank you. ![]()
Discussions
-
-
'System.Net.Http.HttpContent' does not contain a definition for 'ReadAsAsync' and no extension method
Jan 25, 2013 at 4:53 AMAfter a long struggle, I found the solution.
Solution: Add a reference to System.Net.Http.Formatting.dll. This assembly is also available in the C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies folder.
The method ReadAsAsync is an extention method declared in the class HttpContentExtensions, which is in the namespace System.Net.Http in the library System.Net.Http.Formatting.
Reflector came to rescue! -
'System.Net.Http.HttpContent' does not contain a definition for 'ReadAsAsync' and no extension method
Jan 25, 2013 at 4:41 AMI made a console app to consume a Web API I just made. The console app code does not compile. It gives me the compilation error:
'System.Net.Http.HttpContent' does not contain a definition for 'ReadAsAsync' and no extension method 'ReadAsAsync' accepting a first argument of type 'System.Net.Http.HttpContent' could be found (are you missing a using directive or an assembly reference?)
Here's a test method in which this error occurs.static IEnumerable<Foo> GetAllFoos() { using (HttpClient client = new HttpClient()) { client.DefaultRequestHeaders.Add("appkey", "myapp_key"); var response = client.GetAsync("http://localhost:57163/api/foo").Result; if (response.IsSuccessStatusCode) return response.Content.ReadAsAsync<IEnumerable<Foo>>().Result.ToList(); } return null; }
I have used this method and consumed it from an MVC client. -
Sometimes, all the excitement about JavaScript seems pretentious to me.
I understand that most of the enthusiasm displayed is conspicuous, learned behavior. In other words, developers pretend to be in love with JavaScript just because they see, hear or read other developers pretend to be in love with it, who pretend because they see, hear or read other developers...you get the idea.
Reading and debugging JavaScript code is a serious, unremitting pain in the posterior. I don't understand why this alone shouldn't reduce its popularity with developers.
-
Just a thought: EnsureBlah isn't an appropriate naming scheme when the thing can't be ensured
Jan 24, 2013 at 6:59 AM29 minutes ago, wkempf wrote
*snip*
I think you read that wrong. It's a famous quote. I'll write it different to clarify.
There are only two hard things in computer science:
1. cache invalidation
2. naming things
3. off by one errors
Eureka! Splendid.
-
Just a thought: EnsureBlah isn't an appropriate naming scheme when the thing can't be ensured
Jan 24, 2013 at 6:22 AMSure, it doesn't give me diarrhea. It's alright. Just saying it would have been nicer if we (I and Ms. EnsureX) would have met having known each other slightly better.
Anyway, now that I know her, I'll remember to be more careful.
-
1 minute ago, figuerres wrote
*snip*
LOL .... I worked on one system and I always tell folks the DB diagram they printed out looked like one of the micro pictures of a CPU with so many lines going all around and tiny blocks.
That's still something. I'm worried mine might look like a swarm of worms on top of each other having sex.
-
Just like the programmers. That's right, Dr. Herbie. It was so obvious I didn't bother completing the sentence. Thanks for the help.

-
Just a thought: EnsureBlah isn't an appropriate naming scheme when the thing can't be ensured
Jan 24, 2013 at 6:10 AM> so tell me which one of those throws and which returns a Boolean without looking it up in the MSDN
That's a tough answer to guess. I would guess that the check one doesn't throw any exception because it is only meant to check and report; and verify seems a bit assertive. But then if the answer turned out to be the opposite, I might find that I find no difficulty convincing myself of it.
What's naming things off and on by one?
I think threading is difficult, too. There's too much to learn there.
-
In all honesty, I think Microsoft released Windows 8 a little too early. Just like they released Windows Vista a little earlier than it was ripe, and like they released Windows Me the same way.
From a business point-of-view, that's not such a bad thing. There's good news in that.
While it means that they will not have much immediate revenue from it, the good thing is: it will get talked about a whole lot. That will give Microsoft feedback and time to fix things until the product matures.
In time, I think Windows 8 will be a robust and successful operating system. All ground-breaking products take time to mature. In a sense, Windows 8 is a trail-blazer but they took it out too soon.
While in the short term, it seems like bad news for everyone, from the long looks of it, it's good business sense.
My weird review here: http://sathyaish.net/writing/WindowChange.aspx