Saturday, February 18, 2012

Windows Dev News for February 18, 2012 - #0042

Windows Dev News for February 18, 2012 - #0042


Windows Dev News for February 18, 2012 - #0042

Posted: 18 Feb 2012 01:10 PM PST

Windows Dev News for February 18, 2012 - #0042 [SC1218] In This Issue: John Papa ( -2- ), András Velvárt , Daniel Egan , Matthias Shapiro , Ayad Boudiab , David Tong , Bary Nusz , Christian Schormann and Pam Keesey , Arturo Toledo , Shawn Wildermuth ...( read more )...(read more)

How to create a Web Deploy package when publishing a ClickOnce project

Posted: 18 Feb 2012 10:57 AM PST

The other day I saw a question on StackOverflow (link in resources below) asking How you can create a Web Deploy (AKA MSDeploy) package when publishing a ClickOnce project. The easiest way to do this is to use the Web Deploy command line utility, msdeploy.exe. With the command line you can easily create an MSDeploy package from a folder with a command like the following: %msdeploy% -verb:sync -source:contentPath="C:\Temp\_NET\WebPackageWithClickOnce\WebPackageWithClickOnce\bin\Debug\app.publish" -dest:package="C:\Temp\_NET\WebPackageWithClickOnce\WebPackageWithClickOnce\bin\Debug\co-pkg.zip"   Here you can see that I'm using the sync verb, along with a contentPath provider ( which points to a folder ) as the source and...(read more)

C++ Precon at Tech Ed 2012 – Orlando and Amsterdam

Posted: 18 Feb 2012 12:02 AM PST

At both Tech Ed North America 2012 (June 11th-14th) and Tech Ed Europe 2012 (June 26th-29th) there will be a C++ all day preconference! The title is C++ in 2012: Modern, Readable, Safe, Fast. Our C++ MVP Kate Gregory will deliver it and here's the abstract:

C++ is gaining momentum as a development language, so whether you've never used C++ or stopped using it a decade ago, it may be time to brush up on your skills. With a new standard release providing new keywords and capabilities, C++ is a  featured language for many of the new Microsoft technologies and enables some amazing speed-ups of your application using libraries like PPL and C++ AMP. What's more, Visual Studio offers tools to native developers that have only been available for managed developers in earlier versions. This all-day session will show you what all the fuss is about and give you the skills you need to understand the advantages of C++ today and how to start applying those benefits to your application.

There are three main categories of attendees who would enjoy this session:

 

  • It's perfect for those who used C++ a long time ago and need a refresher, a way to catch up with all that has happened to C++ in the last ten years.
  • Developers who have never written a line of C++ code, but are solid in C# or Java will know the basic syntax (if, while, etc) and be able to follow this session and see why there is so much excitement around C++ these days.
  • C++ developers who are not using Visual Studio and not developing for Windows can come and see how their C++ skills will translate to these technologies and how quickly they can be productive on a new platform.

This preconference is technical and has lots of code in it. It's not an "introduction to C++" that starts from scratch. It's about providing the inspiration you need to start using particular features and starting writing modern C++. While you're at TechEd, you can also attend some C++ breakout sessions to go deeper into particular technologies and tools that caught your interest. If you watched the sessions from the GoingNative 2012 conference, and could follow them, you know how much C++ programming has changed this century. If not, and you're curious what the buzz is about, come and find out! It's a great way to start your TechEd experience, June 10th in Orlando or June 25th in Amsterdam. We'll see you there!

Using JSON.NET with ASP.NET Web API

Posted: 17 Feb 2012 04:10 PM PST

Json.Net is a popular framework for working with JSON. In particular, it has a bunch of features that are not supported by the DataContractJsonSerializer such as being much more flexible in what kind of types it can serialize and exactly how they should be serialized. The ASP.NET Web API Beta supports an open-ended set of formatters that can read and write data to and from any media type you want to support. For example, if you want to support the vCard format which has the media type text/vcard (previously it was text/directory) media type then you can write a formatter for vCard and register it for the media type (or types) in question. The complete sample is posted on Code Gallery . Note : If you are completely new to ASP.NET Web API then...(read more)

HttpClient: Downloading to a Local File

Posted: 17 Feb 2012 02:34 AM PST

Downloading content to a local file is a common thing to do. The current version of HttpClient doesn't yet provide out of the box support for saving content to a file but this sample shows how to extend HttpClient with new ways of reading content retrieved using HttpClient. This sample is also available on Code Gallery . ReadAs Extension Methods The HttpContent class contains content to be sent to a client (in the case of PUT, POST, etc.) as well as data being read from the server in a response. The basic System.Net.Http NuGet package provides support for reading the content as a stream, a string, or a byte array using one of HttpContent.ReadAsStringAsync HttpContent.ReadAsStreamAsync HttpContent.ReadAsByteArrayAsync The way to extend how an...(read more)

Push and Pull Streams using HttpClient

Posted: 16 Feb 2012 09:11 PM PST

One of the common discussions to have around network APIs is whether streams should be push or pull . That is, do you push content to the network, or does the infrastructure pull it from you and copy it to the network? In general there is no "right" way of determining this, it is a matter of taste and what fits more naturally in the object model in question. HttpContent is the common abstraction for any kind of content in HttpClient regardless of whether it be as part of an HttpRequestMessage or an HttpResponseMessage. Luckily it supports both patterns. The pull pattern is supported by StreamContent which is one of the default implementations of HttpContent. Here the input stream is read (pulled) by the infrastructure and copied to the network...(read more)

Extending HttpClient with OAuth to Access Twitter

Posted: 16 Feb 2012 01:41 PM PST

Many popular Web APIs such as the twitter API use some form of OAuth for authentication. HttpClient does not have baked in support for OAuth but using the HttpClient extensibility model you can add OAuth as part of the HttpMessageHandler pipeline. The HttpMessageHandler pipeline is the main extensibility point for the HTTP object model underlying both HttpClient and ASP.NET Web API (they use the exact same model). The pipeline allows up to insert message handlers that can inspect, modify, and process HTTP requests and responses as they pass by. The following diagram shows where HttpMessageHandlers sit in the message path on both client (HttpClient) and server side (ASP.NET Web API). The work like "Russian Dolls" in that each handler passes the...(read more)

HttpClient is Here!

Posted: 16 Feb 2012 01:59 AM PST

HttpClient is a modern HTTP client for .NET. It provides a flexible and extensible API for accessing all things exposed through HTTP. HttpClient has been available for a while as part of WCF Web API preview 6 but is now shipping as part of ASP.NET Web API and directly in .NET 4.5. You can also download it using NuGet – we just use the following three NuGet packages in this blog: System.Net.Http : The main NuGet package providing the basic HttpClient and related classes System.Net.Http.Formatting : Adds support for serialization, deserialization as well as for many additional features building on top of System.Net.Http System.Json : Adds support for JsonVaue which is a mechanism for reading and manipulating JSON documents In case you haven't...(read more)

No comments:

Post a Comment