Home / ASP.NET Weblogs

Latest Microsoft Blogs

Posted to:

ASP.NET Web API: Using Namespaces to Version Web APIs

In this post, I’ll show how to extend the routing logic in ASP.NET Web API, by creating a custom controller selector. Suppose that you want to version your web API by defining URIs like the following: /api/v1/products/ /api/v2/products/ You might try to make this work by creating two different “Products” controllers, and placing them in separate namespaces: namespace MyApp.Controllers.V1 { // Version 1 controller public class ProductsController : ApiController { } } namespace MyApp.Controllers.V2 { // Version 2 controller public class ProductsController : ApiController { } } The problem with this approach is that Web API finds controllers by class name, ignoring the namespace. So there’s no way to make this work using...
Filed under: ,
Posted to:

Visual Studio Web Deployment Tutorial Series Updated for Windows Azure and LocalDB

This week we published an updated version of the popular 12-part tutorial series that shows how to deploy an ASP.NET web application with SQL Server databases. Here are links to the new tutorials, with notes about what’s in them and what’s new: Introduction   Overview of the series, prerequisites, download and run the sample application. New overview of database deployment options. The tutorials show how to use Entity Framework Code First Migrations and the dbDacFx provider (for deploying SQL Server databases without using Migrations).  The old ones showed Migrations and the dbFullSQL provider (for migrating SQL Server Compact to SQL Server). Preparing for Database Deployment   How to set up Code First Migrations and create data...
Posted to:
by: 
03-05-2013, 12:06 AM

Windows Azure Updates: Android Support, SQL Reporting Services, Active Directory, More…

This past weekend we released a number of enhancements to Windows Azure. These new capabilities include: Mobile Services: Android support, East Asia Region Support, iOS dev content SQL Reporting Services: Support in the management portal Active Directory: Support in the azure management portal, user and domain management Availability Monitoring for Cloud Services. Virtual Machines, Web Sites, and Mobile Services Service Bus: New configuration tab and metrics Storage: Ability to download blobs directly in management portal Media Services: New monitoring metrics and quickstart experience Cloud Services: Support for .cer certificate files upload Localization support for five new languages Windows Azure Store Support in 22 Additional Countries All...
Filed under: , ,
Posted to:

Disabling Knockout Intellisense

Web Tools Extensions 1.2, which is part for the Web Platform Installer package named “Windows Azure SDK for .NET (VS 2012) 1.8.1 – February 2013” contains a new feature which provides Intellisense in web forms and web pages for KnockoutJS MVVM data binding.  You can verify that you have Web Tools Extension 1.2 installed by opening Visual Studio’s “About” dialog and scrolling through the installed products list to find:                 Web Developer Tools    1.2.40208.0 Unfortunately, upon installation several customers have reported slow-downs and lock-ups of Visual Studio when editing certain web pages containing Knockout syntax.  We are actively...
Posted to:

Building Web Apps with ASP.NET Jump Start - 8 Hours of FREE Training Videos

Last week Jon Galloway, Damian Edwards and myself (with a raspy throat) were up in Redmond at the Microsoft Campus filming at Microsoft Virtual Academy . They've got a whole studio there so we spent the whole day presenting LIVE. There were several thousand folks watching live and interacting with Very special thanks to Brady Gaster and ASP.NET community members Scott Koon , Peter Mourfield , and Rob Chartier who were furiously handling questions in the chats! Your volunteerism and dedication to the community is deeply appreciated! Let's give them a hand, eh? Jon worked very hard to put together a great day of content based on the successful Web Camps classes we've given all over the world. We took all this and worked to update it...
Posted to:

RELEASED - Download Internet Explorer 10 for Windows 7

Just about a month ago the IEBlog published a post to allow business to manage the update schedule for Internet Explorer 10. It says "this approach lets organizations control when they are ready to deploy IE10 to their Windows 7 users." I took from this that IE10 on Windows 7 was imminent. Today it's out. You can download IE10 for Windows 7 now. The details are over at the IE blog . In the next few weeks and months Windows 7 machines will get automatically upgraded to IE10 . For Web Developers like me, that means that between Windows 8 which already has IE10 and all these Windows 7 users who will now have IE10, that more people will have a modern browser than ever before. IE10 was faster on my machine than IE9, and they say it...
Filed under: , ,
Posted to:

Translating OData queries to HQL

AspNet Web API OData makes it really simple to expose your IQueryable backend to be queried using the OData query syntax. Check out some samples here . If you are building using Entity Framework as your ORM (object-relational mapping) to talk to your database or just store all your data in-memory(Linq2Objects), you are in a good shape as you have an existing IQueryable. If you are talking to your own custom data source, you might not be lucky enough to have a LINQ provider or have a provider that has an incomplete implementation. If you are in this mess and are about to undertake the herculean task of implementing an IQueryable (don’t believe me - check out LINQ: Building an IQueryable provider series ) – STOP now and thank me later. Implementing...
Filed under: , ,
Posted to:

Always have a host or URL prefix on the default Orchard tenant

The multi-tenancy feature in Orchard enables you to host multiple sites within the same Orchard instance. It’s not a a security feature, just a way to improve site density, and to enable you to save on hosting costs. Nevertheless, a request to a specific existing tenant should never be answered with a page from another tenant. Ever. There is however a fallback mechanism that enables one tenant to handle all requests that weren’t identified by another tenant. While this could be considered useful in some scenarios, I’m hereby declaring it bad practice. If for any reason a tenant fails to start, for example, requests to that tenant are going to fall back. Even if you were in a scenario where you considered fallback to be useful, this is an unexpected...
Filed under: ,
Posted to:

MVC Single Page Application Template for ASP.NET and Web Tools 2012.2

With the final release of ASP.NET and Web Tools 2012.2, we refreshed single page application page on asp.net .  It talks about KnockoutJS Template and introduced 4 community created SPA templates that you can install as MVC templates. There are four improvements for the MVC SPA template RTM release over the RC release that worth a note. Antiforgery support for Web API calls The ValidateAntiForgeryToken filter only works on MVC calls. Web API doesn't have a default Antiforgery filter yet. We implemented attribute “ValidateHttpAntiForgeryToken” inside Filters\ValidateHttpAntiForgeryTokenAttribute.cs to support antiforgery in Web API calls.  You can see section Anti-CSRF in KnockoutJS Template article for more information. ValidateHttpAntiForgeryToken...
Posted to:

A Message Flow in ASP.NET Web API OData

One of the biggest benefits that you have with ASP.NET Web API is that it gives 100% transparency of the source code because it is open source. You can easily enlist in the code repository and add the symbol path based on instructions at the CodePlex site , then off you go, you can debug the Web API code as if you were the original code author. Now if you are like me, who like to put a few breakpoints in the source code before hitting F5, you will need to understand the OData stack a little better. If everything goes expected, you might not need those breakpoints. But if anything goes wrong, such as getting a 500 or 400 error, or even a closed connection, understanding the message flow and stopping at the right breakpoints will be very useful...

« First ... < Previous 2 3 4 5 6 Next > ... Last »

Archives