.NET Blog

Free. Cross-platform. Open source. A developer platform for building all your apps.

Latest posts

Feb 6, 2013
Post comments count 0
Post likes count 0

Protect your Queryable API with the validation feature in ASP.NET Web API OData

Hongmei Ge

In the previous blog post, you can see how easy it is to enable OData query syntax for a particular action using Web API OData. Simply add a Queryable attribute to your action as follows, and you are done. It not only works for those actions using OData format, but also applies to any vanilla web api actions using other formats such as JSON.NET. It greatly reduces the need to write a lot of actions to perform operations like top, skip, orderby as well as filter. It is so powerful that it is almost hard to imagine building a real Web API application without it. Now everything works beautifull...

Feb 5, 2013
Post comments count 0
Post likes count 0

Managing Package Owners on nuget.org

Jeff Handley

While each NuGet package's nuspec metadata defines the package's owner(s), the NuGet gallery at nuget.org ignores that piece of nuspec metadata. Instead, ownership of a package is defined by who publishes the package to the gallery. Sometimes this metadata needs to be managed beyond the initial package publishing too, which means the owner metadata needs to be mutable while the package itself is not. Setting a Package's Initial Owner When a brand new package is published to nuget.org, its initial owner is defined by the user that published the package. Specifying Additional Package Owners It's common for...

Jan 29, 2013
Post comments count 0
Post likes count 0

Getting started with ASP.NET Web API OData in 3 simple steps

Youssef Moussaoui - MSFT

With the upcoming ASP.NET 2012.2 release, we’ll be adding support for OData to Web API. In this blog post, I’ll go over the three simple steps you’ll need to go through to get your first OData service up and running: Before we dive in, the code snippets in this post won’t work if you’re using the RC build. You can upgrade to using our latest nightly build by taking a look at this helpful blog post. 1) Creating your EDM model First, we’ll create an EDM model to represent the data model we want to expose to the world. The ODataConventionModelBuilder class makes this this easy by using a set of conv...

Jan 28, 2013
Post comments count 0
Post likes count 0

Psychic Debugging of Async Methods

Stephen Toub - MSFT

These days it’s not uncommon for me to receive an email or read a forum post from someone concerned about a problem they’re experiencing with an async method they’ve written, and they’re seeking help debugging the issue.  Sometimes plenty of information about the bug is conveyed, but other times the communication is void of anything more than a root problem statement.  That’s when I engage my powers of psychic debugging to suggest what the root cause might be, without actually knowing more about the developer’s codebase.  Here are four of the more common issues I...

Jan 25, 2013
Post comments count 0
Post likes count 0

ASP.NET MVC, Data Access, and Deployment Content Maps Published

Tom Dykstra - MSFT

We are pleased to announce the publication on the ASP.NET site of three guides to ASP.NET documentation resources: The content maps provide links to good quality up-to-date tutorials, articles, blogs, videos, and forum and StackOverflow threads. The guides exist on MSDN, but we’re publishing updated versions on the ASP.NET site now in hopes that they’ll get more use and generate more feedback.  With your help, we hope to update them every 4-6 weeks with the latest and best links. The top of each page includes an invitation to email us with suggestions: If you know a great blog post,...

Jan 23, 2013
Post comments count 0
Post likes count 0

Introducing SvcPerf – An End-to-End trace Analysis tool for WCF

Sajay Antony

Standardizing on ETW In 4.5 we introduced ETW tracing for WCF. In the past couple of months we have been trying to establish some common tools that can be used to debug and analyze ETW traces from WCF. We have a large number of tools that allow ETW analysis and the one aspect we wanted to do was to allow activity correlation which WCF uses extensively. Folks who have already used ETW in its full capacity already know about ETW activities and how they are propagated. Those of you who don't, this FAQ: Common Questions for ETW and Windows Event Log should be a good start point. Others who just want to jump in, hop ...

Jan 13, 2013
Post comments count 0
Post likes count 2

Cooperatively pausing async methods

Stephen Toub - MSFT

Recently I was writing an app that processed a bunch of files asynchronously.  As with the Windows copy file dialog, I wanted to be able to provide the user with a button that would pause the processing operation.To achieve that, I implemented a simple mechanism that would allow me to pass a “pause token” into the async method, which the async method could asynchronous wait on at appropriate points.  public async Task ProcessFiles(     IEnumerable<StorageFile> files, PauseToken pauseToken) {     foreach(var file in files) ...

Jan 10, 2013
Post comments count 0
Post likes count 0

XDT (web.config) transform engine released on NuGet

Sayed Ibrahim Hashimi

We have just released the XDT transform engine on NuGet, with a license which allows you to redistribute the assembly with your own product. . If you are not familiar with XDT it is a XML transformation engine which drives our web.config transforms in Visual Studio. You can read more about XDT at here. You can now take a dependency on XDT and ship it with your own product.For specifics on the terms of use please read the license. Why are we doing this?One of the top 10 most voted features for NuGet is Support Visual Studio (XDT) web.config transforms. To summarize the request, NuGet package authors would like to ...

Jan 9, 2013
Post comments count 0
Post likes count 0

Real Scenario: folder deployment scenarios with MSDeploy

Sayed Ibrahim Hashimi

Hi everyone Sayed here. I recently had a customer, Johan, contact me to help with some challenges regarding deployment automation. He had some very specific requirements, but he was able to automate the entire process. He has been kind enough to agree to write up his experience to share with everyone. His story is below. If you have any comments please let us know. I will pass them to Johan. I’d like to thank Johan for his willingness to write this up and share it. FYI if you’d like me to help you in your projects I will certainly do my best, but if you are willing to share your story like Johan it will motivate...