4. Continuous innovation: Release every ~6 months
Sept
2012
ASP.NET
4.5
VS2012
Feb
2013
ASP.NET
and Web
Tools
2012.2
Fall
2013
VS2013
5. No “upfront decision”
on any ASP.NET
technology
Unified dialog
One Project: Web
Forms, MVC, Web API
Add any framework to any project
Scaffolding works across all
frameworks
Configurable authentication
Bootstrap used for
layout and styling
Templates based on
Bootstrap.js
Popular CSS layout framework
Many themes available
Completely new
scaffolding system
for One ASP.NET
Web application code
generation based on your data
model
Targets data-driven and CRUD
boilerplate code
11. OWIN = Open
Web Interface
for .NET
Common interface that
decouples apps from servers
Standards for
connecting
servers to
frameworks
Deeply integrated with the
ASP.NET pipeline
Run your web
APIs on any
OWINcompliant host
(your own
process)
13. Portable
Easily substituted for new
components
Third-party frameworks can
seamlessly run on Microsoft
servers
Microsoft frameworks can
potentially run on third-party
servers and hosts
Modular/flexible Lightweight/
Small and focused components
performance/
Lightweight
scalable
Consume fewer computing
resources
Handle more load
15. Enable CORS
in web API
Per action
Per controller
[EnableCors(origins: "http://www.example.com", headers:
"*", methods: "*")]
public class ItemsController : ApiController
{
public HttpResponseMessage GetAll() { ... }
public HttpResponseMessage GetItem(int id) { ... }
public HttpResponseMessage Post() { ... }
[DisableCors]
public HttpResponseMessage PutItem(int id) { ... }
Globally
}
16. Bring your routes closer to your resources
config.Routes.MapHttpRoute(
name: “TodosForTodoList",
routeTemplate: "api/todolists/{id}/todos",
defaults: new { controller = “todolists”, action = “GetTodos” }
);
public IEnumerable<TodoItem> GetTodos() { … }
17. Bring your routes closer to your resources
config.MapHttpAttributeRoutes();
[HttpGet("api/todolists/{id}/todos")]
public IEnumerable<TodoItem> GetTodos(int id) { … }
18. Optional values
Default values
[HttpGet(“Demographics/{zipcode?}")]
public Demographics Get(int? zipcode) { … }
[HttpGet("Demographics/{zipcode=98052}")]
public Demographics Get(int zipcode) { … }
[HttpGet("people/{id:int}")]
public Person Get(int id) { … }
[HttpGet("people/{name:alpha}")]
public Person Get(string name) { … }
19. How to add support for:
OData provides a standard solution for common Web API
patterns
21. Incredibly simple realtime web for .NET
How can I use real-time
functionality in my app?
Simplicity
Anytime a user refreshes the page or you
use polling
Dashboards and monitoring
Collaborative anything
Gaming
Real-time forms and concurrency management
Reach
Performance
24. Not just the
code
Accepting
contributions
Source code
Only EF team has commit rights
Nightly builds
Same code review process as
internal changes
Issue tracking
Feature specs
Design meeting notes
Only affects
how we
develop, not
how we ship
Same license
Same support
Same quality
All of ASP.NET is a single platform, including Web-Forms. It’s more than just MVC and Web API. There is ONE ASP.NET and all of our Web Frameworks work together with similar features.There is one dialog for creating Web Forms, MVC, Web API, and SPA applications.Differences: MVC approach is newer and more powerful, but Web-Forms is easier and what many customers use.Example: With Friendly URLs, people using Web-Forms can do Mobile as well.Authorization is configurable at project creation time and will be extended with more options later.We made a simple UI for creating projects that offer support for multiple ASP.NET frameworks (Web Forms, MVC, and Web API). New features are available for Web Forms that used to be offered only for MVC, such as automatic test project creation and an intranet site template.Different authentication configurations can be chosen, which works the same in all ASP.NET frameworks and in web-hosting software other than IIS.
ASP.NET and Web Tools Cadence is fast (every 6 months), and it is now separatefrom VS releases.This approach (including OSS) is more agile and provides a great continuous innovation with fewer surprises compared to big releases every 2 years, like Microsoft used to do a few years ago.This approach also relies heavily on NuGet packages, so developers can get new versions of ASP.NET much faster, without waiting for other releases.
One ASP.NET means…:Unified DialogScaffolding for everyoneMVC, Web Forms, Web API togetherNew extensible Identity SystemOWIN (Open Web Interface for .NET)No ASP.NET technology “upfront decision”Mix and match any ASP.NET technology (MVC, WebForms, WebAPI, etc.) within any VS web-projectBootstrap used for layout and stylingPopular CSS layout framework for simple and consistent page layoutBuilt-in responsive design for mobile, and glyphs for iconographyHighly themeable with many themes; both free and premium availableASP.NET Scaffolding is a code generation framework for ASP.NET Web applications. Visual Studio 2013 includes pre-installed code generators for MVC, Web Forms, and Web API projects. You add a scaffold to your project when you want to quickly add boilerplate code that interacts with data models. Using scaffolding can reduce the amount of time to develop standard data operations in your project.Code generation based on your data models; targets data-driven boilerplate codeSupports Web Forms, MVC, Web API, and moreDistribution via NuGet
See Demo 1 – ASP.NET MVC new scaffolding (One ASP.NET, Scaffolding and BootStrap)
ASP.NET Identity is the new membership system for building ASP.NET web applications. ASP.NET Identity allows you to add logon features to your application and makes it easy to customize data about the logged-on user.The ASP.NET Identity membership system is a complete rewrite of the old Membership feature. Membership was a built-in way to validate and store user credentials, to manage user authentication in websites using the provider model to make it extensible, but it had many limitations. The new Identity system still supports user management and adding login features to applications, but it's easier to customize the data you store about each user. The magic of customizing user information happens through the use of Entity Framework's Code First feature. You can extend the Plain Old C# Object (POCO) classes it uses to automatically update the data store for the custom data. Identity uses a database by default, but you can also store it in other locations, such as SharePoint, Azure Table Service, or NoSql databases by plugging in a different storage provider.Featuresof the ASP.NET Identity system include:One ASP.NET Identity systemASP.NET Identity can be used with all of the ASP.NET frameworks such as ASP.NET MVC, Web Forms, Webpages, Web API, and SignalRPlug in profile data about the userWhen you create new users in your application, it is now easy to add extra information about the user, for example,to add a birthdate option for users when they register an account in your application.ASP.NET Identity uses Entity Framework Code First and you can extend the POCO classes.Persistence controlBy default the ASP.NET Identity system will store all the user information in a database. ASP.NET Identity uses Entity Framework Code First to implement all of its persistence mechanism.If your application requiresthat this information be stored in SharePoint, Azure Table Service, NoSql databases, etc., it is now possible to plug in different storage providers.Unit testabilityASP.NET Identity lets you write Unit Tests for the parts of your application that use ASP.NET IdentitySimple Role providerA Simple Role provider lets you restrict access to parts of your application by Roles. You can easily create Roles such as “Admin” and add Users to Roles.Claims BasedASP.NET Identity supports claims-based authentication, where the user’s identity is represented as a set of claims. The benefit of claims-based authentication is that it abstracts the individual elements of identity and access control into two parts: a general notion of claims and the concept of a trusted issuer or authority. This is a new way of thinking about identity and authentication that can overcome the limitations of relying on usernames and passwords, and now it's built into ASP.NET.External Logons You can easily add external logons such as Microsoft Account, Facebook, Twitter, and Google to your application and store the user specific data in your application using this system.You can also add logon functionality using Windows Azure Active Directory and store the user specific data in your application using this system.
SeeDemo 2 – ASP.NET Identity
Browser Link – SignalR channel between browser and Visual StudioBrowser Link is a new feature that uses a SignalR channel between browsers and Visual Studio 2013. It allows manually refreshing of all connected browsers by clicking the toolbar refresh button. You can connect multiple browsers to your development site, including mobile emulators, and click refresh to refresh all the browsers at the same time.Browser Link is just a channel between your Visual Studio IDE and any open browser. This will allow dynamic data exchange between your web application and Visual Studio. This feature is enabled by default in Visual Studio 2013 Preview. When Browser Link is enabled we register an HTTPModule with ASP.NET, which will then inject a <script> reference to every page request from the server. This JavaScript connects the browser to Visual Studio. For Preview,a feature called the “Refresh Linked Browsers” uses this channel between browsers and IDE.Because the browser-side code is all JavaScript, it should work on all browsers, without requiring any other browser plug-in. It also works on iPad/iPhone emulators. The connection between the browser and Visual Studio uses SignalR, an ASP.NET technology for bi-directional communication over HTTP. When Browser link is enabled, Visual Studio acts as a SignalR server, to which multiple clients (the browsers) can connect.New HTML editorIn VS2013 a new HTML editor is released for Razor files and web project HTML files. Web Form files and Windows Store JavaScript application HTML files still use the legacy editor. The new HTML editor provides a single unified HTML5-based schema. It has some improvement such as automatic brace completion, jQuery UI and AngularJS attribute IntelliSense, attribute IntelliSense Grouping. The tools\options\Text Editors settings are different for legacy and new HTML editors, they are named “HTML (Razor)” (For web projects HTML files and razor files) and “HTML” (Web Forms and pages in Windows 8 Modern JavaScript app).“Enable Edit and Continue” debugging option is now on by default for new web applications.
SeeDemo 3 – Visual Studio Web Tooling Demo 3.1– Browser link Demo 3.2 – IE11 Developer tools (optional)Demo 3.3 – Edit and continue“Edit and continue” demo could show in the “What´s New .NET 4.5.1” talk.
NOTE for Speaker: Ifyou need to eliminate content because of time, OWIN/KATANA can be simplified because they are deeper internal infrastructure details.The Open Web Interface for .NET (OWIN)Inspired by the benefits achieved by Rack in the Ruby community, Node.JS, etc.,several members of the .NET community set out to create an abstraction between Web servers and framework components. Two design goals for the OWIN abstraction were that it would be simple and that it would have the fewest possible dependencies on other framework types. These two goals help ensure:New components could be more easily developed and consumed.Applications could be more easily ported between hosts and potentially entire platforms/operating systems.Open Web Interface for .NET (OWIN) defines an abstraction between .NET web servers and web applications. OWIN decouples the web application from the server, which makes OWIN ideal for self-hosting a web application in your own process, outside of IIS–for example, inside an Azure worker role.More Info => http://www.asp.net/aspnet/overview/owin-and-katana/an-overview-of-project-katana
NOTE for Speaker: Ifyou need to eliminate content because of time, OWIN/KATANA can be simplified because they are deeper internal infrastructure details.Project KatanaWhereas both the OWIN specification and Owin.dll are community-owned and community-run,open-source efforts, the Katana project is the set of OWIN components that, while open source, are built and released by Microsoft.These components include infrastructure components, such as hosts and servers, as well as functional components, such as authentication and bindings to frameworks such as SignalR and ASP.NET Web API. More Info => http://www.asp.net/aspnet/overview/owin-and-katana/an-overview-of-project-katana
NOTE for Speaker: Ifyou need to eliminate content because of time, OWIN/KATANA can be simplified because they are deeper internal infrastructure details.The project has the following three high-level goals: Portable – Components should be able to be easily substituted for new components as they become available. This includes everythingfrom the framework to the server and host. This means third-party frameworks can seamlessly run on Microsoft servers while Microsoft frameworks can potentially run on third-party servers and hosts.Modular/flexible – Unlike many frameworks which include a multitude of features that are turned on by default, Katana project components should be small and focused, giving the application developer control in decidingwhich components to use in her application.Lightweight/performance/scalable – By breaking the traditional idea of a framework into a set of small, focused components which are added explicitly by the application developer, a Katana application should consume fewer computing resources and handle more load than other types of servers and frameworks. As the application requires more features from the underlying infrastructure, they can be added to the OWIN pipeline, but that should be an explicit decision of the application developer. Additionally, the substitutability of lower level components means that as they become available, new high performance servers can seamlessly be introduced to improve the performance of OWIN applications without breaking those applications.
Visual Studio 2013 and ASP.NET 4.5.1 expand the security options for Single Page Applications (SPA) and Web API services to integrate with external authentication services, which include several OAuth/OpenID and social media authentication services: Microsoft Accounts, Twitter, Facebook, and Google.Using External Authentication ServicesThe abundance of external authentication services that are currently available to web developers help to reduce development time when creating new web applications. Web users typically have several existing accounts for popular web services and social media websites. When a web application usesauthentication services from an external web service or social media website, it saves development time that would have been spent creating an authentication implementation. Plus, using an external authentication service saves end users from having to create another account for your web application, and from having to remember another username and password.Visual Studio 2013 and ASP.NET 4.5.1 make integration with external authentication services easier for developers by providing built-in integration for the following authentication services:FacebookGoogleMicrosoft Accounts (Windows Live ID accounts)TwitterRouting is how Web API matches a URI to an action. Web API 2 supports a new type of routing, called attribute routing. Open Web Interface for .NET (OWIN) defines an abstraction between .NET web servers and web applications. OWIN decouples the web application from the server, which makes OWIN ideal for self-hosting a web application in your own process, outside of IIS, for example, inside an Azure worker role.ASP.NET Web API OData makes it really simple to expose your IQueryable backend to be queried using the OData query syntax.
CORS Support.Browser security prevents a webpage from making AJAX requests to another domain. This restriction is called the same-origin policy. However, sometimes you might want to let other sites call your web API. Cross Origin Resource Sharing (CORS) is a W3C standard that allows a server to relax the same-origin policy. Using CORS, a server can explicitly allow some cross-origin requests while rejecting others.You can enable CORS per action, per controller, or globally for all Web API controllers in your application. To enable CORS for a single action, set the [EnableCors] attribute on the action method If you set [EnableCors] on the controller class, it applies to all the actions on the controllerGlobally in Global.asax fileIf you apply the attribute at more than one scope, the order of precedence is:ActionControllerGlobalIf a browser supports CORS, it sets these headers automatically for cross-origin requests; you don’t need to do anything special in your JavaScript code.
Routing is how Web API matches a URI to an action. Web API 2 supports a new type of routing, called attribute routing. As the name implies, attribute routing uses attributes to define routes. Attribute routing gives you more control over the URIs in your web API. For example, you can easily create URIs that describe hierarchies of resources.The earlier style of routing, called convention-based routing, is still fully supported. In fact, you can combine both techniques in the same projectThe first release of Web API used convention-based routing. In that type of routing, you define one or more route templates, which are basically parameterized strings. When the framework receives a request, it matches the URI against the route template.One advantage of convention-based routing is that templates are defined in a single place, and the routing rules are applied consistently across all controllers. Unfortunately, convention-based routing makes it hard to support certain URI patterns that are common in RESTful APIs.
With attribute routing, it’s trivial to define a route for each URI. You simply add an attribute to the controller action
The Open Data Protocol (OData) is a data access protocol for the web. OData provides a uniform way to structure data, query the data, and manipulate the data set through CRUD operations (create, read, update, and delete). OData supports both AtomPub (XML) and JSON formats. OData also defines a way to expose metadata about the data. Clients can use the metadata to discover the type information and relationships for the data set.Microsoft .NET developers have been able to create OData feeds since before there was even an OData spec. By using WCF Data Services, you could expose an Entity Data Model (EDM) over the Web using Representational State Transfer (REST). In other words, you could consume these services through HTTP calls: GET, PUT, DELETE and so on. As the framework for creating these services evolved (and was renamed a few times along the way), the output evolved as well and eventually became encapsulated in the OData specification (odata.org). Now there’s a great variety of client APIs for consuming OData—from .NET, from PHP, from JavaScript and from many other clients as well. But until recently, the only easy way to create a service was with WCF Data Services.
ASP.NET Web API OData makes it easy to create an OData endpoint for a data set. You can control exactly which OData operations the endpoint supports. You can host multiple OData endpoints, alongside non-OData endpoints. You have full control over your data model, back-end business logic, and data layer.ASP.Net Web API OData makes it really simple to expose your IQueryable backend to be queried using the OData query syntax. If you are building using Entity Framework as your ORM (object-relational mapping) to talk to your database or just to store all your data in-memory (Linq2Objects), you are in good shape as you have an existingIQueryable.One of the ways Web API OData beatsWCF Data Services for building OData services is flexibility. What are $select and $expand?The $select operator allows a client to pick a subset of the properties of an entity to be retrieved when querying a feed or a single entity. The $expand operator allows a client to retrieve related entities for a given navigation property in line with the entities being retrieved.By using $select and $expand, we can make sure that we get the data we need in an optimal way. For example, we could use $select to return only the ID and Name properties of an entity, and we could use $expand to retrieve a Customer and his related Orders on a single query.Configuration options and formatter support for $select and $expandWhen dealing with a real application, we need a way to configure operators like $expand so that a client (by mistake or maliciously), can’t send an expensive query to the service. In the case of $expand, wecan configure the depth of the expansions we allow our clients to perform in their queries so they don’t cause a denial of service on the database.
ASP.NET SignalR is a library for ASP.NET developers that simplifies the process of adding real-time web functionality to applications. Real-time web functionality is the ability to have server code push content to connected clients instantly as it becomes available, rather than having the server wait for a client to request new data. SignalR uses Websockets when it is supported by the browser and the server, and gracefully falls back to other techniques and technologies when it is not. Either way, your application code stays the same. SignalR can be used to add any sort of "real-time" web functionality to your ASP.NET application. While chat is often used as an example, you can do a whole lot more. Anytime a user refreshes a web page to see new data, or the page implements long polling to retrieve new data, it is a candidate for using SignalR. Examples include dashboards and monitoring applications, collaborative applications (such as simultaneous editing of documents), job progress updates, and real-time forms.SignalR also enables completely new types of web applications that require high frequency updates from the server, for example, real-time gaming. Apart from Web support, the PCL lib provides support for WinRT, Silverlight, WPF, console application, and Windows Phone clients, for both .NET 4 and .NET 4.5.SignalR provides a simple API for creating server-to-client remote procedure calls (RPC) that call JavaScript functions in client browsers (and other client platforms) from server-side .NET code. SignalR also includes API for connection management (for instance, connect and disconnect events), and grouping connections.SignalR handles connection management automatically and lets you broadcast messages to all connected clients simultaneously, like a chat room. You can also send messages to specific clients. The connection between the client and server is persistent, unlike a classic HTTP connection which is re-established for each communication.SignalR supports "server push" functionality, in which server code can call out to client code in the browser using Remote Procedure Calls (RPC), rather than the request-response model common on the web today. Supported Platforms => http://www.asp.net/signalr/overview/getting-started/supported-platforms
Apart from Web support, the PCL lib provides support for WinRT, Silverlight, WPF, console application, and Windows Phone clients, for both .NET 4 and .NET 4.5.ASP.NET SignalR is a library for ASP.NET developers that simplifies the process of adding real-time web functionality to applications. Real-time web functionality is the ability to have server code push content to connected clients instantly as it becomes available, rather than having the server wait for a client to request new data. SignalR uses Websockets when it is supported by the browser and the server, and gracefully falls back to other techniques and technologies when it is not. Either way, your application code stays the same. SignalR can be used to add any sort of "real-time" web functionality to your ASP.NET application. While chat is often used as an example, you can do a whole lot more. Anytime a user refreshes a web page to see new data, or the page implements long polling to retrieve new data, it is a candidate for using SignalR. Examples include dashboards and monitoring applications, collaborative applications (such as simultaneous editing of documents), job progress updates, and real-time forms.SignalR also enables completely new types of web applications that require high frequency updates from the server, for example, real-time gaming. SignalR provides a simple API for creating server-to-client remote procedure calls (RPC) that call JavaScript functions in client browsers (and other client platforms) from server-side .NET code. SignalR also includes API for connection management (for instance, connect and disconnect events), and grouping connections.SignalR handles connection management automatically, and lets you broadcast messages to all connected clients simultaneously, like a chat room. You can also send messages to specific clients. The connection between the client and server is persistent, unlike a classic HTTP connection, which is re-established for each communication.SignalR supports "server push" functionality, in which server code can call out to client code in the browser using Remote Procedure Calls (RPC), rather than the request-response model common on the web today. SupportedPlatforms=> http://www.asp.net/signalr/overview/getting-started/supported-platforms
Entity Framework and Open SourceThe Entity Framework source code is released under an open source license (Apache 2.0), and the code repository is hosted on CodePlex to further increase development transparency. This enables everyone in the community to engage and provide feedback on code check-ins, bug fixes, and new feature development. They can build and test the product on a daily basis using the most up to date version of the source code and tests. Community contributions also are welcomed, so you can help shape and build Entity Framework into an even better product.Microsoft continues to ship official builds of Entity Framework as a fully supported Microsoft product, both standalone as well as part of Visual Studio (the same as today). It continues to be staffed by the same Microsoft developers, and is supported through the same Microsoft support mechanisms. The goal is to increase the development feedback loop even more, allowing us to deliver an even better product.
ToolingOur focus with the tooling has been on adding EF6 support and shipping out-of-band between releases of Visual Studio. The tooling itself does not include any new features, but most of the new runtime features can be used with models created in the EF Designer.Runtime (Available on NuGet)Async Query and Save adds support for the task-based asynchronous patterns that were introduced in .NET 4.5Custom Code First Conventions allow you to write your own conventions to help avoid repetitive configuration. We provide a simple API for lightweight conventions as well as some more complex building blocks to allow you to author more complicated conventions. Code First Mapping to Insert/Update/Delete Stored Procedures Connection Resiliency enables automatic recovery from transient connection failuresCode-Based Configuration gives you the option of performing configuration in code that was traditionally performed in a config file.Dependency Resolution introduces support for the Service Locator pattern and we factored out some pieces of functionality that can be replaced with custom implementations.Enums, Spatial and Better Performance on .NET 4.0 - By moving the core components that used to be in the .NET Framework into the EF NuGet package we are now able to offer enum support, spatial data types and the performance improvements from EF5 on .NET 4.0Configurable Migrations History Table allows you to customize the definition of the migrations history table. This is particularly useful for database providers that require the appropriate data types. etc.. to be specified for the Migrations History table to work correctly. DbContext can now be created with a DbConnection that is already opened which enables scenarios where it would be helpful if the connection could be open when creating the context (such as sharing a connection between components where you cannot guarantee the state of the connection).
See:Demo 5 – Entity Framework 6
In a more dynamic market, enterprises want their line-of-business applications to be accessible at any time from any device without sacrificing quality, agility, and time-to-market. This is why we are thrilled to announce our support for building cross-browser, mobile web clients with Visual Studio LightSwitch!The HTML5 and JavaScript-based client addresses the increasing need to build touch-oriented business applications that run well on modern mobile devices. LightSwitch HTML clients are built on standards-compliant HTML5 and JavaScript and provide modern, touch-first experiences on Windows RT, Windows Phone 8, iPhones and iPads with iOS 5/6, and Android 4.x devices.With the new SharePoint 2013 apps model, we’re also bringing the simplicity and ease of building custom business apps with LightSwitch into SharePoint / Office 365. Many enterprises today use SharePoint as a collaboration hub to better people, content, and processes. Although you can still choose to host your apps on your own or in Azure, enabling SharePoint in your LightSwitch apps allows you to take advantage of the app lifecycle management, identity, and access control capabilities within SharePoint—not to mention the business data and processes already running in SharePoint in your enterprise.
More new featureswith Visual Studio 2013:You no longer need to switch between Logical View and File View because all your project content is available under one view in Solution Explorer.LightSwitch projects work more seamlessly with the IDE, so using the scoping, search, and browse history features are all now available in your LightSwitch projects.You can view multiple designers at the same time. Each screen, table, and query is now opened in its own document tab. Improved team development! Each entity, screen, and query now persists in its own .lsml model file, dramatically reducing the likelihood of merge conflicts when multiple developers work on the same project. We’ve also improved compatibility with existing source code control providers. Intrinsic database management with linked database project, so you can generate reference data and make schema enhancements. Improved JavaScript IntelliSense, as well as improvements to the core JavaScript experience such as code editor and DOM Explorer enhancements. API support for refreshing data on lists and screens in the runtime app. Integration with other Visual Studio features, such as Team Build and Code Analysis.
In the demo script “MyCompany Tour” see:Demo - MyCompany Staff