{"id":43,"date":"2014-12-01T02:00:00","date_gmt":"2014-12-01T02:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/cesardelatorre\/2014\/12\/01\/myshuttle-biz-asp-net-5-web-apps-and-services\/"},"modified":"2014-12-01T02:00:00","modified_gmt":"2014-12-01T02:00:00","slug":"myshuttle-biz-asp-net-5-web-apps-and-services","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/myshuttle-biz-asp-net-5-web-apps-and-services\/","title":{"rendered":"MyShuttle.biz ASP.NET 5 Web Apps and Services"},"content":{"rendered":"<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0523.image_3814A29A.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1104.image_thumb_0CD00B93.png\" alt=\"image\" width=\"148\" height=\"108\" border=\"0\" \/><\/a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1512.image_6CB4FED5.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6403.image_thumb_339E21D3.png\" alt=\"image\" width=\"268\" height=\"56\" border=\"0\" \/><\/a><\/p>\n<p><strong>[***&nbsp;March 2015 &ndash; UPDATED to Visual Studio 2015 CTP&nbsp;6 version ***]<\/strong><\/p>\n<p>If you want to have a detailed overview about <a href=\"http:\/\/blogs.msdn.com\/b\/cesardelatorre\/archive\/2014\/11\/18\/what-is-net-core-5-and-asp-net-5-within-net-2015-preview.aspx\">ASP.NET 5 and .NET Core 5, check this blog post<\/a> out that I wrote a few days ago.<\/p>\n<p>This actual blog post (focusing on ASP.NET 5 web apps development) is the second post of a blog posts series covering the different scenarios implemented by the MyShuttle.biz apps. Here&rsquo;s the list of blog posts:<\/p>\n<p><em><a href=\"http:\/\/blogs.msdn.com\/b\/cesardelatorre\/archive\/2014\/11\/30\/myshuttle-biz-demo-apps-from-connect-visual-studio-and-azure-event.aspx\"><strong>1. Blog Post: Global Intro of the MyShuttle.biz demo apps from Connect(); Visual Studio and Azure event<\/strong><\/a><\/em><\/p>\n<p><em><a href=\"http:\/\/blogs.msdn.com\/b\/cesardelatorre\/archive\/2014\/11\/21\/myshuttle-biz-asp-net-5-demos.aspx\"><strong>2. (Current blog post) MyShuttle.biz ASP.NET 5 Web Apps and Services<\/strong><\/a><\/em><\/p>\n<p><em><a href=\"http:\/\/blogs.msdn.com\/b\/cesardelatorre\/archive\/2014\/11\/30\/myshuttle-biz-and-cross-platform-mobile-development-of-native-apps-for-ios-android-and-windows-with-net-and-xamarin.aspx\"><strong>3. Blog Post: MyShuttle.biz and Cross-platform Mobile Development of native apps for iOS, Android and Windows with .NET and Xamarin<\/strong><\/a><\/em><\/p>\n<p><em><a href=\"http:\/\/blogs.msdn.com\/b\/cesardelatorre\/archive\/2014\/11\/30\/myshuttle-biz-and-multi-device-development-of-hybrid-apps-for-ios-android-and-windows-with-visual-studio-tools-for-apache-cordova.aspx\"><strong>4. Blog Post: MyShuttle.biz and multi device development of hybrid apps for iOS, Android and Windows with Visual Studio Tools for Apache Cordova<\/strong><\/a><\/em><\/p>\n<p><em><a href=\"http:\/\/blogs.msdn.com\/b\/cesardelatorre\/archive\/2014\/12\/10\/myshuttle-biz-azure-backend-services-and-lob-integration-to-o365-and-salesforce.aspx\"><strong>5. Blog post: MyShuttle.biz Azure backend integration with LOB services (Invoicing, O365 API and SalesForce API)<\/strong><\/a><\/em><\/p>\n<p>As introduced in my <a href=\"http:\/\/blogs.msdn.com\/b\/cesardelatorre\/archive\/2014\/11\/30\/myshuttle-biz-demo-apps-from-connect-visual-studio-and-azure-event.aspx\">MyShuttle.biz demo apps all up intro (Post #1)<\/a>, we created several applications and services based on ASP.NET 5 (codename &ldquo;Project K&rdquo;):<\/p>\n<p>&#8211; <strong>ASP.NET 5 MVC<\/strong> site &#8211; &ldquo;Public&rdquo; site targeting the initial engagement with carriers and customer companies.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/5635.image_28749789.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3582.image_thumb_4F42ADC9.png\" alt=\"image\" width=\"319\" height=\"281\" border=\"0\" \/><\/a><\/p>\n<p>&#8211; <strong>ASP.NET 5 Web API<\/strong> and <strong>SignalR<\/strong> services as backend for the mobile apps and the web SPA application.<\/p>\n<p>&#8211; <strong>SPA<\/strong> (<strong>Single Page Application<\/strong>) &#8211; &ldquo;Private&rdquo; web application targeting the carriers&rsquo; admins so they manage their vehicles, drivers and other assets.<\/p>\n<p>&nbsp;<a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/2210.image_34C6B352.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1122.image_thumb_5B94C992.png\" alt=\"image\" width=\"307\" height=\"200\" border=\"0\" \/><\/a><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/2514.image_2F27A10C.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/2526.image_thumb_55F5B74C.png\" alt=\"image\" width=\"314\" height=\"287\" border=\"0\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h2>Setting up the MyShuttle.biz ASP.NET 5 Web applications and Web API Services<\/h2>\n<h2>Requirements<\/h2>\n<p>&#8211; <strong>Visual Studio 2015 CTP 6<\/strong>: <a href=\"http:\/\/www.visualstudio.com\/news\/vs2015-vs\">Get Visual Studio 2015 CTP 6<\/a><\/p>\n<p>&#8211; <strong>Windows Azure Subscription<\/strong>: <a href=\"http:\/\/azure.microsoft.com\/es-es\/pricing\/free-trial\/\">Get Microsoft Azure Trial<\/a><\/p>\n<blockquote>\n<p>Azure is optional if you are just testing the ASP.NET 5 Web Apps.<\/p>\n<p>Azure is recommended for ASP.NET 5 Services deployment if you&acute;ll use the Mobile Apps consuming the services, later on.<\/p>\n<\/blockquote>\n<p>&#8211; <strong>Download<\/strong> the <strong>MyShuttle.biz<\/strong> Apps code from <a href=\"https:\/\/code.msdn.microsoft.com\/MyShuttle-demo-applications-1a4b68fe\"><strong>here<\/strong><\/a>.<\/p>\n<p>&#8211; Open the <strong>SOLUTION<\/strong> named <strong>04_Demos_ASPNET5.sln<\/strong> (rename the extensi&oacute;n to <strong>.sln<\/strong>, first. Due to that the MSDN Samples can have a single .sln within the .ZIP, I had to rename the rest of the Solutions before publishing the .ZIP..)<\/p>\n<p>&#8211; <strong>NuGet config: <\/strong><\/p>\n<p>Depending on the version of Visual Studio 2015 you are using, you need to configure NuGet package sources differently.<\/p>\n<p><strong>If using Visual Studio 2015 CTP 6 <\/strong><\/p>\n<p>In <strong>VS 2015 CTP 6<\/strong>, the <strong>ASP.NET<\/strong> web application uses the <strong>KRE BETA2<\/strong> (<strong>Project K Runtime Environment<\/strong> Beta 2, which is <strong>ASP.NET 5 Beta 2<\/strong>) so you need to make sure that Visual Studio is using the right NuGet feed: <a title=\"https:\/\/www.nuget.org\/api\/v2\/curated-feeds\/microsoftdotnet\/\" href=\"https:\/\/www.nuget.org\/api\/v2\/curated-feeds\/microsoftdotnet\/\">https:\/\/www.nuget.org\/api\/v2\/curated-feeds\/microsoftdotnet\/<\/a><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/8623.image_6423E552.png\"><img decoding=\"async\" style=\"padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1602.image_thumb_03D2BF1B.png\" alt=\"image\" width=\"552\" height=\"324\" border=\"0\" \/><\/a><\/p>\n<p><strong>\/* **** OUTDATED ****<\/strong>&nbsp;<\/p>\n<p><strong>If using Visual Studio 2015 Preview (November 2014)<\/strong><\/p>\n<p>(OUTDATED for VS 2015 PREVIEW) &#8211; The <strong>ASP.NET<\/strong> web application uses the <strong>KRE BETA1<\/strong> (<strong>Project K Runtime Environment<\/strong> Beta 1, which is <strong>ASP.NET 5 Beta 1<\/strong>) so you need to make sure that Visual Studio is using the right NuGet feed: <a href=\"https:\/\/www.myget.org\/F\/aspnetrelease\/api\/v2\">https:\/\/www.myget.org\/F\/aspnetrelease\/api\/v2<\/a>&nbsp;<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/2818.image_69CAE77C.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3007.image_thumb_1439A94B.png\" alt=\"image\" width=\"547\" height=\"319\" border=\"0\" \/><\/a><\/p>\n<p><strong>**** OUTDATED **** *\/<\/strong><\/p>\n<p><strong>&#8211; Bing Maps config<\/strong>: Set your<strong> Bing Maps key <\/strong>in <strong>wwwroot&gt;Scripts&gt;Pages&gt;config.js<\/strong><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/4403.image_7962A0BC.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0216.image_thumb_35223970.png\" alt=\"image\" width=\"552\" height=\"82\" border=\"0\" \/><\/a><\/p>\n<p>You will need this same Bing Maps key when configuring the client mobile Apps. Here&acute;s some info about it.<\/p>\n<p><strong>Bing Maps key<\/strong><\/p>\n<p>The same Bing Maps key is also used by the MyShuttle&rsquo;s Xamarin, Cordova and Windows apps.<\/p>\n<p>If you don&rsquo;t have any <strong>Bing Maps key<\/strong>, you need to obtain that from Microsoft, since in order to use the <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd877180.aspx\">Bing Maps APIs<\/a>, you must have a Bing Maps Key.<\/p>\n<p>The Bing Maps APIs include map controls and services that you can use to incorporate <a href=\"http:\/\/www.bing.com\/maps\">Bing Maps<\/a> in applications and websites. In addition to interactive and static maps, the APIs provide access to other geospatial features such as geocoding, route and traffic data and spatial data sources that you can use to store and query data that has a spatial component, such as store locations.<\/p>\n<p>This would be the procedure if you need to: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ff428642.aspx\"><strong>Getting a Bing Maps Key<\/strong><\/a>.<\/p>\n<h2>Starting from the beginning: An ASP.NET 5 Hello World<\/h2>\n<p>But before getting into the specifics of these web applications, I want to start from scratch in ASP.NET 5, so let&rsquo;s start with a hello-world, what&rsquo;s the experience you get in Visual Studio 2015 and after that we&rsquo;ll drill down into the MyShuttle.biz web application.<\/p>\n<p>So, first things first. The new ASP.NET 5 applications are included as part of the familiar ONE ASP.NET dialog experience. If you go to File &#8211;&gt;New Project &#8211;&gt; Visual C# &ndash;&gt;Web&#8211;&gt;ASP.NET Web Application, you can use the ONE ASP.NET template:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/5148.image_68F51243.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0842.image_thumb_56AC4B81.png\" alt=\"image\" width=\"550\" height=\"261\" border=\"0\" \/><\/a><\/p>\n<p>You can see how we have the new ASP.NET 5 templates integrated as part of the One ASP.NET dialog experience. <br \/>The rest of the templates are the traditional templates based on ASP.NET 4.6.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6327.image_11491D0B.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/4274.image_thumb_712E104D.png\" alt=\"image\" width=\"504\" height=\"375\" border=\"0\" \/><\/a> <br \/>We have a single ASP.NET 5 project type because MVC, Web API and SignalR are now unified in a single framework! <br \/>You can go ahead and chose the ASP.NET 5 Starter Web template so you have some meat to play with.<\/p>\n<p>If you do Ctrl+F5 and run it, you&rsquo;ll see that &ldquo;from the outside&rdquo;, this app looks like a typical ASPNET MVC hello world app.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1121.image_3C21811D.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/5353.image_thumb_30F7F6D3.png\" alt=\"image\" width=\"244\" height=\"164\" border=\"0\" \/><\/a>&nbsp;<a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6648.image_62EF975D.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/4505.image_thumb_57C60D13.png\" alt=\"image\" width=\"105\" height=\"164\" border=\"0\" \/><\/a> <br \/>But, it is not, it is based on the new ASP.NET 5 technologies with tons of news for us. Let&rsquo;s drill down into the new features.<\/p>\n<h2>News for front-end web developers (HTML, JavaScript and CSS) and VS 2015 Tooling for Bower, NPM, Grunt and Gulp<\/h2>\n<p>First differences you&rsquo;ll see when comparing this new ASP.NET 5 projects to older MVC projects are in the structure of the solution and the project.<\/p>\n<table style=\"width: 796px\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"200\"><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0804.image_09BDAD9E.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1464.image_thumb_457D4651.png\" alt=\"image\" width=\"201\" height=\"286\" border=\"0\" \/><\/a><\/td>\n<td valign=\"top\" width=\"594\">\n<p>For instance, now all your code in your solution will be stored within the &ldquo;<strong>src<\/strong>&rdquo; folder.<\/p>\n<p>If you had Unit Testing code (you should! \ud83d\ude09 ), you will also have a second root level folder called &ldquo;<strong>test<\/strong>&rdquo;.<\/p>\n<p>You can see how this is managed by the &ldquo;<strong>global.json<\/strong>&rdquo; file:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0815.image_25623994.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7762.image_thumb_599662DA.png\" alt=\"image\" width=\"244\" height=\"62\" border=\"0\" \/><\/a><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/4628.image_397B561D.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7271.image_thumb_19604960.png\" alt=\"image\" width=\"244\" height=\"103\" border=\"0\" \/><\/a><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>We also have a new folder within the web project called &ldquo;<strong>wwwroot<\/strong>&rdquo;.<\/p>\n<table style=\"width: 797px\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"200\"><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/5127.image_27328F5B.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3073.image_thumb_1C090511.png\" alt=\"image\" width=\"241\" height=\"294\" border=\"0\" \/><\/a><\/td>\n<td valign=\"top\" width=\"595\">We also have a new folder within the web project called &ldquo;wwwroot&rdquo;. This folder should contain your static code, like JavaScript files and .CSS files. You could modify your content directly, or if you are using <strong>Grunt\/Gulp<\/strong>, like we&rsquo;ll do later, <strong>Grunt<\/strong> would copy your content into this &ldquo;static folder&rdquo;. <br \/><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/MSDNBlogsFS\/prod.evol.blogs.msdn.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/84\/75\/metablogapi\/8764.image_7BEDF853.png\"><img decoding=\"async\" style=\"float: none;margin-left: auto;margin-right: auto\" title=\"image\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/MSDNBlogsFS\/prod.evol.blogs.msdn.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/84\/75\/metablogapi\/5611.image_thumb_2DE598DE.png\" alt=\"image\" width=\"244\" height=\"156\" border=\"0\" \/><\/a> <br \/>But, web development, specifically front end web development, is fast becoming as complex and sophisticated as traditional back end development. Most projects don&#8217;t just upload some JS and CSS files via FTP. There&#8217;s now a front end build process that can include expansion of SASS and LESS, minification of CSS\/JS, running JSHint or JSLint, and much more. These build tasks and processes are coordinated with tools like Grunt. Additionally, client-side libraries are managed as packages using management systems like NPM and BOWER.<\/p>\n<p>The important word here? &ldquo;automation&rdquo;. The less work you have to do when performing repetitive tasks like minification, compilation, unit testing, etc, the easier your job becomes.<\/p>\n<p>The good news? VS 2015 provides first-class support for <strong>Grunt<\/strong>, <strong>Gulp<\/strong>, <strong>Bower<\/strong> and <strong>NPM<\/strong>!<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>So, in addition to NuGet, Visual Studio now supports two more package managers:<\/p>\n<p><strong>1. Bower<\/strong>, for client side packages: <strong>Bower<\/strong> is very similar to NuGet, but it is tailored specifically to target client side packages, like JavaScript libraries and CSS frameworks.<\/p>\n<p><strong>2. NPM<\/strong>, the Node package manager, for managing web developer tools. You can also see NPM dependencies here.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3566.image_22BC0E94.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/4137.image_thumb_308E548F.png\" alt=\"image\" width=\"224\" height=\"238\" border=\"0\" \/><\/a><\/p>\n<p>Let&rsquo;s take a look at <strong>Bower.json<\/strong> which is the file that you need to use to define what packages you want to use.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0602.image_16763207.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6153.image_thumb_042D6B45.png\" alt=\"image\" width=\"584\" height=\"224\" border=\"0\" \/><\/a><\/p>\n<p>You can see how we get <strong>intellisense<\/strong> about the packages&hellip;:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6786.image_7E2A810F.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3005.image_thumb_3022219A.png\" alt=\"image\" width=\"312\" height=\"331\" border=\"0\" \/><\/a><\/p>\n<p>We also have <strong>smart-tags<\/strong> to manage the packages to install, uninstall or update the packages so you have full control within the JSON editor.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/2500.image_3DF46795.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/4087.image_thumb_6FEC081F.png\" alt=\"image\" width=\"394\" height=\"259\" border=\"0\" \/><\/a><\/p>\n<p>Regarding the NPM file (package.json) we have similar intellisense features, by the way.<\/p>\n<p>So Visual Studio 2015 and ASP.NET will automatically make a packages restore, so when you open the solution, all the bower and NPM packages will be restored so you don&rsquo;t have to check them into your source control system.<\/p>\n<h2>Task Runner Explorer in MyShuttle.biz ASP.NET 5 demo apps<\/h2>\n<p>Open the Solution called &ldquo;<strong>04_Demos_ASPNET5.sln<\/strong>&rdquo;. (Rename the extension to &ldquo;.sln&rdquo; if you Still didn&acute;t do it.<\/p>\n<p>Wait a few seconds until all the NuGet dependencies are restored.<\/p>\n<p>Set the <strong>MyShuttle.Web<\/strong> project as the <em>startup project<\/em>.<\/p>\n<p>You should have something similar to the following SOLUTION.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0777.image_0471579E.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3010.image_thumb_4B5A7A9B.png\" alt=\"image\" width=\"423\" height=\"252\" border=\"0\" \/><\/a><\/p>\n<p>Before getting into the ASP.NET 5 server side, I want to dig into some more new great tooling in Visual Studio for task runners like Grunt and Gulp to provide build tasks for client side purposes.<\/p>\n<p>You could compare those task runners as <strong>MSBuild<\/strong> but for client side code. It is great for compiling LESS and SASS, or CoffeeScript or TypeScript, as well as doing bundling and minification and other client side tasks.<\/p>\n<p>So, in Visual Studio we now have the <strong>TASK RUNNER EXPLORER<\/strong> that supports both <strong>Grunt<\/strong> and <strong>Gulp<\/strong>.<\/p>\n<p>It will automatically list all the different tasks that are defined for your project (in this case, with our MyShuttle.biz projects, with Grunt).<\/p>\n<p>If you go in VS 2015 to <strong>View &ndash;&gt; Windows&mdash;&gt;Other Windows&mdash;&gt;Task Runner Explorer<\/strong>, you&rsquo;ll see how we have it configured:<\/p>\n<p>&nbsp;<a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3414.image_4030F051.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6646.image_thumb_722890DB.png\" alt=\"image\" width=\"419\" height=\"241\" border=\"0\" \/><\/a><\/p>\n<p>So you can easily double click on any task, like &ldquo;<strong>jshint<\/strong>&rdquo; and see the results right there in Visual Studio without going and using the command-line window:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7217.image_520D841E.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/5164.image_thumb_31F27761.png\" alt=\"image\" width=\"764\" height=\"159\" border=\"0\" \/><\/a><\/p>\n<p>You could also hook up different grunt\/gulp tasks to Visual Studio events. For instance, you could set that after compiling with Visual Studio, you wanna run any <strong>Grunt<\/strong> task (in this case jshint) you would specify that in the <strong>After Build event<\/strong> like here:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/5008.image_1609FF12.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/2867.image_thumb_7897AE05.png\" alt=\"image\" width=\"315\" height=\"274\" border=\"0\" \/><\/a><\/p>\n<p>So if you build the solution (<strong>Ctrl+Shift+B<\/strong>) you can see how Grunt kicks in and runs the Grunt build task automatically!<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6661.image_664EE743.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0317.image_thumb_2618CDC9.png\" alt=\"image\" width=\"739\" height=\"191\" border=\"0\" \/><\/a><\/p>\n<p>So this VS tooling makes it easy to use the most popular client side frameworks within having to leave Visual Studio!<\/p>\n<h2>ASP.NET 5: The server side!<\/h2>\n<p>Now, let&rsquo;s get to the area where ASP.NET 5 matters the most, the server side!<\/p>\n<p><strong>ASP.NET 5<\/strong>, based on <strong>.NET Core 5<\/strong> (altogether is what in codename was called <strong>Project K<\/strong>) features faster startup times, lower memory and higher server density, you can use low-level sockets, develop with high-level web components framework or mixed and match both. ASP.NET 5 is really optimized for server and cloud workloads. <br \/>You can also develop ASP.NET 5 applications with Visual Studio, any third-party editor, or a cloud editor. And ASP.NET 5 is open source with contributions by default, and runs cross-platform!. Dude, it has all you can desire! \ud83d\ude09<\/p>\n<p>I&rsquo;m now going to drill down on the new server side technologies that we&rsquo;re using to support the MyShuttle.biz web applications and services as the backend for the mobile apps. <br \/>Below you can see our solution <strong>04_Demos_ASPNET5.sln<\/strong> in VS 2015.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6746.image_3B4E3C95.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6574.image_thumb_02375F93.png\" alt=\"image\" width=\"645\" height=\"247\" border=\"0\" \/><\/a><\/p>\n<p>Sure, you could have all your web apps&rsquo; code within a single project (the <strong>MyShuttle.Web<\/strong> project, for instance), but we preferred to have several projects in order to have specific code areas situated in clear places, you know, <a href=\"http:\/\/en.wikipedia.org\/wiki\/Separation_of_concerns\">separation of concerns (SoC) design principle<\/a> and <a href=\"http:\/\/martinfowler.com\/bliki\/LayeringPrinciples.html\">layering principles<\/a>. For instance, the <strong>MyShuttle.Web<\/strong> project takes care of anything related to the Web Site apps and the front-end SPA application, so it is very focused on HTML and JavaScript.<\/p>\n<p>On the other hand, we&nbsp; extracted and put all the Web API controllers in a separated library called MyShuttle.API, although you could have all the Web API controllers within the same MyShuttle.Web project, if you&rsquo;d prefer.<\/p>\n<p>Then, we have a specific library with all the infrastructure data persistence code (Repositories, etc.) related to <strong>Entity Framework 7<\/strong> and an additional simple library with our <strong>entity data-model<\/strong> based on <strong>POCO entity classes<\/strong>.<\/p>\n<p>Going further, if your app would have a lot of domain logic, you&rsquo;d probably will design your app in a more <em>Domain-Driven Design<\/em> approach. This is not the case, MyShuttle.biz demo apps are pretty simple and very <em>Data-Driven<\/em> and CRUD oriented.<\/p>\n<p>If you go ahead and run the &ldquo;MyShuttle&rdquo; MVC app (public web site) with Ctrl+F5, the first time it&rsquo;ll take a little longer, since we&rsquo;re creating a <strong>SQL Server 2014 LocalDB database<\/strong> &ldquo;on the fly&rdquo; and populating it with sample data. Here&rsquo;s how it should look like:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1768.image_621C52D5.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/8625.image_thumb_08EA6916.png\" alt=\"image\" width=\"244\" height=\"200\" border=\"0\" \/><\/a> <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6562.image_3AE209A0.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0714.image_thumb_2FB87F56.png\" alt=\"image\" width=\"287\" height=\"202\" border=\"0\" \/><\/a><\/p>\n<p>This application is a modern web site with a responsive UI. You can see how its layout changes depending on the size of the browser.<\/p>\n<p>If you want to take a look to the generated database, you can connect to it from VS, like here:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7651.image_0F9D7299.png\"><img decoding=\"async\" style=\"margin-left: 0px;margin-right: 0px\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/5516.image_thumb_6F8265DB.png\" alt=\"image\" width=\"480\" height=\"500\" align=\"left\" border=\"0\" \/><\/a>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>So you can check the populated data from Visual Studio 2015 (you could do a similar check from SQL Server Management Studio):<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6177.image_4F67591E.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/2476.image_thumb_5D399F19.png\" alt=\"image\" width=\"782\" height=\"435\" border=\"0\" \/><\/a><\/p>\n<p>But our demo web app is more than just a simple web site made with MVC. If you log in, you also have a private web app, supposedly for the carriers&rsquo; admins, which is a <strong>SPA<\/strong> (<strong>Single Page Application<\/strong>) with a heavy volume of <strong>JavaScript<\/strong>, <strong>Angular.js<\/strong>, and consuming <strong>ASP.NET 5 Web API<\/strong> services (local or deployed as Azure Web Sites).<\/p>\n<p>The authentication method for this SPA private app is pretty simple and just based on <strong>ASP.NET Identity<\/strong>. You can log in after hitting the &ldquo;Login&rdquo; link, with:<\/p>\n<p><strong>User: carrier<\/strong><\/p>\n<p><strong>Password: P2ssw0rd0)<\/strong><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/2703.image_69670F8D.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3364.image_thumb_345A805D.png\" alt=\"image\" width=\"338\" height=\"220\" border=\"0\" \/><\/a><\/p>\n<p>You can notice there&rsquo;s no round-trip when loading the whole page if I move between the different sections, like going from Drivers to Vehicles to Rides. It is JavaScript consuming remote ASP.NET 5 Web API Services, underneath.<\/p>\n<table style=\"width: 400px\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"200\"><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0825.image_43D19BDF.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/8168.image_thumb_6A9FB21F.png\" alt=\"image\" width=\"495\" height=\"452\" border=\"0\" \/><\/a><\/td>\n<td valign=\"top\" width=\"200\">&nbsp;<a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/2705.image_7871F81A.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/5037.image_thumb_7152BBA2.png\" alt=\"image\" width=\"244\" height=\"215\" border=\"0\" \/><\/a> <\/p>\n<p>&nbsp;<a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/5050.image_66293158.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3806.image_thumb_0CF74799.png\" alt=\"image\" width=\"244\" height=\"215\" border=\"0\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>&nbsp;<\/h2>\n<h2>NuGet packages, References and .NET Frameworks<\/h2>\n<p>But, let&rsquo;s move to the .NET and server side and Visual Studio.<\/p>\n<p>In this new world of ASP.NET 5, all .NET features are shipped as NuGet packages.<\/p>\n<p>You can notice that I can run my app on different frameworks since I have dependencies on .NET and .NET Core packages.<\/p>\n<table style=\"width: 760px\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"200\"><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/2311.image_6CDC3ADB.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/5543.image_thumb_1ED3DB66.png\" alt=\"image\" width=\"202\" height=\"133\" border=\"0\" \/><\/a><\/td>\n<td valign=\"top\" width=\"558\">The plain &ldquo;ASP.NET 5&rdquo; runs on top of the full .NET Framework 4.6 and the regular CLR. <br \/>&rdquo;ASP.NET Core 5&rdquo; runs on top of .NET Core 5. <br \/>The important point here to highlight is that there&rsquo;s a single ASP.NET 5 framework that can run on top of .NET Framework 4.6 stack or the new, smaller and leaner .NET Core 5. <br \/>As mentioned, if you want to have deeper details about what I&rsquo;m talking about, check this blog post that I published a few days ago: <a href=\"http:\/\/blogs.msdn.com\/b\/cesardelatorre\/archive\/2014\/11\/18\/what-is-net-core-5-and-asp-net-5-within-net-2015-preview.aspx\">What is .NET Core 5 and ASP.NET 5 within .NET 2015 Preview<\/a> <\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"200\"><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0654.image_20C9E718.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1643.image_thumb_7C385993.png\" alt=\"image\" width=\"244\" height=\"93\" border=\"0\" \/><\/a><\/td>\n<td valign=\"top\" width=\"558\">\n<p>But if I go to the menu option to manage the dependencies, you can see that all I can do is to manage the dependencies with my own projects within the SOLUTION, you cannot reference directly to external assemblies or .DLLs!<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/8512.image_50F3C28C.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3821.image_thumb_29B97957.png\" alt=\"image\" width=\"653\" height=\"104\" border=\"0\" \/><\/a><\/p>\n<p>This is because in this new world of ASP.NET 5 the &ldquo;unit of measure&rdquo; for the external .NET dependencies is based on NuGet packages. NuGet is mainstream now!<\/p>\n<p>So you need to go and manage the external dependencies thru &ldquo;Manage NuGet Packages&rdquo;<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1680.image_59E354CB.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7450.image_thumb_407B5191.png\" alt=\"image\" width=\"351\" height=\"328\" border=\"0\" \/><\/a><\/p>\n<p>And you can see the new NuGet Management screen, filter by Install\/All, etc.:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/4338.image_2E328ACF.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/5822.image_thumb_62D2E70A.png\" alt=\"image\" width=\"588\" height=\"345\" border=\"0\" \/><\/a><\/p>\n<p>But the important point here is that anything that I can do from the IDE, I can also do it by using any file editor, so in fact, the NuGet packages that I&rsquo;m depending on are specified in the <strong>project.json<\/strong> file.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/5023.image_3B989DD5.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0068.image_thumb_0934CA56.png\" alt=\"image\" width=\"607\" height=\"434\" border=\"0\" \/><\/a><\/p>\n<p>Notice how in this ASP.NET 5 project we can target or run on top of the regular CLR from .NET Framework 4.6 or on top of Core CLR from .NET Core 5.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/8081.image_04BE498F.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3276.image_thumb_7D9F0D16.png\" alt=\"image\" width=\"244\" height=\"100\" border=\"0\" \/><\/a><\/p>\n<p>You can change the Runtime and framework you are targeting (either .NET Framework 4.6 or .NET Core 5) from the IDE by going to the project&rsquo;s properties of each of your projects in your SOLUTION.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3465.image_589ACD61.png\" alt=\"\" \/><\/p>\n<h4>Running the MyShuttle.biz ASP.NET 5 web applications and Web API Services on <strong>.NET Core 5<\/strong> and the <strong>Core CLR<\/strong>.<\/h4>\n<p>You can run MyShuttle.biz web Apps and services on <strong>.NET Core 5<\/strong> and the <strong>Core CLR<\/strong> because when developing MyShuttle.biz ASP.NET 5 apps and services we made sure that we&acute;re not using any library\/API not available for .NET Core. So just by simply changing the <strong>Target KRE-CLR<\/strong> version to ALL of the following projects (all the projects\/dependencies need to be in sync regarding the framework), you&acute;d be able to run it on .NET Core 5.<\/p>\n<p>So, select the Core-CLR KRE version within the projects&rsquo; properties and in the Application tab, for each of the four projects in the solution:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6303.image_053ECD71.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6864.image_thumb_6523C0B3.png\" alt=\"image\" width=\"427\" height=\"48\" border=\"0\" \/><\/a><\/p>\n<p><strong>&#8211; MyShuttle.Web project&ndash;&gt; KRE-CoreCLR-x86.1.0.0-beta1<\/strong><\/p>\n<p><strong>&#8211; MyShuttle.Model&nbsp; project&ndash;&gt; KRE-CoreCLR-x86.1.0.0-beta1<\/strong><\/p>\n<p><strong>&#8211; MyShuttle.Data&nbsp; project &ndash;&gt; KRE-CoreCLR-x86.1.0.0-beta1<\/strong><\/p>\n<p><strong>&#8211; MyShuttle.API&nbsp; project &ndash;&gt; KRE-CoreCLR-x86.1.0.0-beta1<\/strong><\/p>\n<p>But, like I said, one of the goals of this effort was to make a NuGet package the primary unit of reference. So, one of the scenarios this allows is the ability to depend on a NuGet package, and then later clone the source into your project and use source without changing anything in your project. This significantly reduces the friction of debugging and fixing a library you have source for.<\/p>\n<p>If you take a look to <strong>C:\\Users\\[your user]\\.kre\\packages\\KRE-CoreCLR-amd64.1.0.0-beta1<\/strong> for instance, you have the .NET Core 5 framework in there just as a single NuGet package! A single 15MB file for the whole .NET Core 5 framework and runtime!:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0247.image_41DB85D8.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7103.image_thumb_73D32662.png\" alt=\"image\" width=\"783\" height=\"176\" border=\"0\" \/><\/a><\/p>\n<p>You can explorer the KRE-CoreCLR framework NuGet package by using the <a href=\"http:\/\/npe.codeplex.com\/\">NuGet package explorer<\/a><em><\/em>, and see the mscorlib.dll or the different &ldquo;k&rdquo; libraries:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7026.image_53B819A5.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0753.image_thumb_7A862FE5.png\" alt=\"image\" width=\"720\" height=\"554\" border=\"0\" \/><\/a><\/p>\n<p>But it is not just about NuGet packages and libraries. The second double click and most important news about composability is that the Framework can ship as part of the application and because of that you get true side by side, such that two applications running different versions of the CLR can run SxS on the same server without conflicting with each other.<\/p>\n<p>This allows Zero day security bugs patched by Microsoft, the same code runs in development and production and the developer opts into new versions, allowing breaking changes between different applications.<\/p>\n<h2>Unified MVC\/Web API controllers and out-of-the-box Dependency Injection<\/h2>\n<p>I want to drill down a little into the new code you can write in ASP.NET5.<\/p>\n<p>This is the C# code of the <strong>HomeController<\/strong> for this web app.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6835.image_246D2357.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/8103.image_thumb_590D7F92.png\" alt=\"image\" width=\"649\" height=\"367\" border=\"0\" \/><\/a><\/p>\n<p>We have <strong>unified the ASP.NET Controllers<\/strong>. They are the same class type whether they are used for MVC or Web API services. Even more, these controllers can be POCO (Plain Old CLR Object) controllers, by convention, so as you can see, it doesn&rsquo;t have any base class. Although it could also derive from the Controller base class.<\/p>\n<p>If you open any of the Web API controllers that we placed in the MyShuttle.API (although they could also be within the same web Project, as mentioned at the beginning of the post), in this case we&acute;re using an explicit Controller base class, but it is a unified based class either for MVC controllers or Web API controllers.<\/p>\n<p>Within these controllers we&acute;re implementing code that is accessing a SQL Server database or Azure SQL DB thru Repository classes that are using Linq to Entities and EF infrastructure code, like in the _vehicleRepository.GetAsync() method.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/5282.image_6D92CF10.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1565.image_thumb_7445D893.png\" alt=\"image\" width=\"704\" height=\"383\" border=\"0\" \/><\/a><\/p>\n<p>At the end of the day, you can Check how the Controllers are unified if you go to the Startup.Routes.cs file in the Web Project, where you can see the routes definition either for regular MVC controllers or Web API controllers which are now simply the same kind of &ldquo;controllers&rdquo; with just a different Map Route. \ud83d\ude42<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3247.image_41E20514.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7624.image_thumb_16313B18.png\" alt=\"image\" width=\"726\" height=\"395\" border=\"0\" \/><\/a><\/p>\n<p>In regards to Dependency Injection, you also have now <strong>out-of-the-box Dependency Injection in ASPNET 5<\/strong>, in this case, we&rsquo;re using <strong>Constructor based DI<\/strong> to inject a Repository and <strong>property based DI<\/strong> to inject a IUrlHelper and a ViewDataDictionary. Internally, ASP.NET features a basic IoC container but you could also hok your preferred IoC container like <strong>AutoFac<\/strong> or <strong>Ninject<\/strong>.<\/p>\n<p>The <strong>Dependency Injection Registration code<\/strong> in the MyShuttle.biz ASP.NET project is placed in the <strong>Startup.Dependencies.cs<\/strong> file.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6371.image_26CE5768.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/5148.image_thumb_3B7AE2EC.png\" alt=\"image\" width=\"714\" height=\"392\" border=\"0\" \/><\/a><\/p>\n<p>You can notice for instance how we&acute;re saying that whenever the application code (in a constructor or property) requests for an object of type ICarrierRepository, our IoC container will instantiate an object of the type\/class CarrierRepository, and so on..<\/p>\n<p>And that &ldquo;types registration&rdquo; task method, ConfigureDependencies() is called from the global <strong>Startup.cs<\/strong><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3404.image_610981AF.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/4861.image_thumb_00B85B78.png\" alt=\"image\" width=\"713\" height=\"388\" border=\"0\" \/><\/a><\/p>\n<p>But the important thing about DI in this new world is that ASPNET 5 is natively built with Dependency Injection down to the runtime execution, across the entire stack, which is why you can easily switch to different runtimes (CLR to Core CLR or viceversa) or run ASP.NET on top of different SOs (Windows, Mac or Linux) in a very transparent way.<\/p>\n<h2>&ldquo;Edit C# code, save .cs file and refresh the browser&rdquo;: No explicit compilation!<\/h2>\n<p>I also want to show how you can have a faster development experience with a lower friction with compile time and other traditional experiences. Although this approach what is also allowing is to have development experiences with simple editors, since the implicit compilation takes place when running the app.<\/p>\n<p>If you go to the Project&rsquo;s folder and bin\\Debug folder, you can see we have no explicit compiled assemblies in there. For instance, right click on the project menu option and select the &ldquo;<strong>Open Folder in File Explorer<\/strong>&rdquo; so we go to our Project folder. Then move to bin\\Debug:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7026.image_69233EB5.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0753.image_thumb_28ED253B.png\" alt=\"image\" width=\"526\" height=\"148\" border=\"0\" \/><\/a><\/p>\n<p>You can see that the folder is empty. No compiled .DLLs.<\/p>\n<p>No, run the application with NO debugging by hitting Ctrl+F5. You&acute;ll get the MVC app running in the browser. Do not close the browser after checking it out!:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7115.image_4FBB3B7B.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3162.image_thumb_240A717F.png\" alt=\"image\" width=\"338\" height=\"275\" border=\"0\" \/><\/a><\/p>\n<p>Now, come back to the <strong>HomeController<\/strong> and change the C# line of code that has &ldquo;<strong>The Ultimate B2B Shuttle Service Solution<\/strong>&rdquo; to any other string, like &ldquo;<strong>Cool C# change with no explicit compilation!<\/strong>&rdquo;<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3755.image_5B75A40F.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0535.image_thumb_6228AD92.png\" alt=\"image\" width=\"630\" height=\"343\" border=\"0\" \/><\/a><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0451.image_16C909CE.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3603.image_thumb_72377C49.png\" alt=\"image\" width=\"516\" height=\"335\" border=\"0\" \/><\/a><\/p>\n<p>And now just go ahead and refresh the browser page in IE. Voila! \ud83d\ude42<\/p>\n<p>You&acute;ll notice how it takes a few seconds to load, since it is compiling underneath based on the .NET Compiler Platform (&ldquo;Roslyn&rdquo;) which is compiling in the &ldquo;server side&rdquo;. But take into account that it could be any C# code change rather tan just an string:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/5661.image_7F9D8F4F.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6685.image_thumb_7407D210.png\" alt=\"image\" width=\"873\" height=\"269\" border=\"0\" \/><\/a><\/p>\n<p>Even more, if you come back to the \/bin\/obj folder you&rsquo;ll see that it is still empty!<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1488.image_4F76448C.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6201.image_thumb_283BFB57.png\" alt=\"image\" width=\"492\" height=\"138\" border=\"0\" \/><\/a><\/p>\n<p>Of course, you could also enforce DLLs compilation and deploy just binaries to the server:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7776.image_7CF7644F.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3580.image_thumb_7814B093.png\" alt=\"image\" width=\"504\" height=\"121\" border=\"0\" \/><\/a><\/p>\n<p>So if you re-compile, you&acute;ll get NuGet packages for your app:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/2425.image_1EE2C6D4.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/8640.image_thumb_1A6C460D.png\" alt=\"image\" width=\"540\" height=\"142\" border=\"0\" \/><\/a><\/p>\n<p>And the specific assemblies depending on what framework\/runtime you want (.NET 4.6 or .NET Core 5):<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/8255.image_24BFFB1E.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6840.image_thumb_151FF00D.png\" alt=\"image\" width=\"550\" height=\"136\" border=\"0\" \/><\/a><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0576.image_0E00B395.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/8508.image_thumb_34CEC9D5.png\" alt=\"image\" width=\"543\" height=\"143\" border=\"0\" \/><\/a><\/p>\n<p>But this &ldquo;no explicit compilation&rdquo; feature is oriented towards agile development environments where you could be editing C# code with any editor (<strong>VS<\/strong>, <strong>Sublime<\/strong>, <strong>Emacs<\/strong>, <strong>Notepad<\/strong>), or even an online browser based editor like <strong>Monaco<\/strong> or any other editor running on any operating System, either <strong>Windows<\/strong>, <strong>Mac<\/strong> or <strong>Linux<\/strong>. You just need to edit C# code!.<\/p>\n<h2>How to deploy MyShuttle.biz ASP.NET 5 Web\/Services to an Azure Web Site<\/h2>\n<p>Our final step, especially if you intend to re-use the Web API Services as the backend for the MyShuttle.org Mobile Apps, is to deploy this web app and services to and <strong>Azure Web Sites.<\/strong><\/p>\n<p>Go ahead and right click on the Project and select &ldquo;<strong>Publish<\/strong>&rdquo;:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/8787.image_3C2E32C7.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0358.image_thumb_4A0078C2.png\" alt=\"image\" width=\"419\" height=\"161\" border=\"0\" \/><\/a><\/p>\n<p>You&acute;ll see a wizard, hit on Microsoft Azure Websites and after signing in with your Azure Subscription credentials, you should be able to create a new Web Site, by hitting the &ldquo;new&rdquo; button:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/8304.image_42E13C4A.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/5008.image_thumb_77819885.png\" alt=\"image\" width=\"334\" height=\"201\" border=\"0\" \/><\/a><\/p>\n<p>So, in this case I&acute;m calling this web site as <strong>myshuttlebiz<\/strong>.azurewebsites.net<\/p>\n<p>You can either create the Azure SQL DB here or create the DB and Azure SQL DB Server from the portal, as you wish.<\/p>\n<p>I think it is better to explicitely create an Azure DB Server from the portal so you can specify a more meaningful name tan something like &ldquo;hdkjmgwm1i&rdquo; or similar :), but for the sake of having less steps here, in this case I&acute;m creating it directly from Visual Studio.<\/p>\n<p>The important Point is that you need to know the name of your Azure SQL DB server, the name of the database, the username and the password.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/2867.image_7DC86F13.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0317.image_thumb_60561E07.png\" alt=\"image\" width=\"557\" height=\"474\" border=\"0\" \/><\/a><\/p>\n<p>Hit &ldquo;Create&rdquo; and accept changes into the profile, so you&acute;ll get something like the following. This is simply the info in order to be able to connect to the Azure web site:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6082.image_5217A517.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7028.image_thumb_54C060C8.png\" alt=\"image\" width=\"529\" height=\"422\" border=\"0\" \/><\/a><\/p>\n<p>Click &ldquo;Next&rdquo; so you get to the following dialog:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1185.image_5624839A.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3757.image_thumb_4854CE50.png\" alt=\"image\" width=\"540\" height=\"428\" border=\"0\" \/><\/a><\/p>\n<p>Here you have to decide what .NET framework you want to use, either the .NET Framework 4.6 (KRE-CLR-xxxxxx) or .NET Core 5 (KRE-CoreCLR-xxxxxxx).<\/p>\n<p>For now, just leave the default option which is KRE-CLR-x86.1.0.0.-beta1.<\/p>\n<p><strong><strong>********************************<strong>********************************<strong>******************************** <\/strong><\/strong><\/strong><\/strong><\/p>\n<p><strong>IMPORTANT!!!<\/strong><\/p>\n<p><strong>CONNECTION STRING CONFIGURATION IN &ldquo;PROJECT K&rdquo; and AZURE WEB SITE APP SETTINGS<\/strong><\/p>\n<p><strong>DO NOT click on &ldquo;Publish&rdquo; just yet! <\/strong>(If you did, it is ok, you&acute;ll just need to set the con-string in Azure settings and reload the app)<strong> <\/strong>\ud83d\ude42<\/p>\n<p><strong><strong>*<strong>********************************<\/strong>*******************************<\/strong><strong>******************************** <\/strong><\/strong><\/p>\n<p>Before publishing the ASP.NET 5 into Azure, you need to <strong>update the connection string that the ASP.NET 5<\/strong> site is going to use.<\/p>\n<p>This Configuration is different in ASP.NET 5 (Project K) compared to the traditional ASP.NET and EF before ASP.NET 5.<\/p>\n<p>So, in ASP.NET 5 (codename Project K) the Configuration is based on Environment Variables, so it works the same way either for a deployment into Windows Server or Microsoft Azure. This is great news, parity for on-premises vs. the cloud. But, where do I have to change that?<\/p>\n<p>Our con-string for the Development environment which is using SQL Server LocalDB is placed in the <strong>config.json<\/strong> file, as you can Check here:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7043.image_6F22E490.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/0068.image_thumb_15F0FAD1.png\" alt=\"image\" width=\"827\" height=\"138\" border=\"0\" \/><\/a><\/p>\n<p>But, like I said, that connection string points to a local SQL Server localDB. That won&acute;t help for an Azure deployment, right?<\/p>\n<p>But wait!, you don&acute;t need to change that file, the cleanest way to do it is simply to update the Azure Web Site Configuration in the Azure portal that Will override this property settings.<\/p>\n<p>So, before publishing, go to your Web Site Configuration in the Azure Portal, either with the new Azure portal or the old portal, and look for your <strong>Web Site SETTINGS&mdash;&gt;Application Settings<\/strong>. In this case, I&acute;m using the new Azure portal:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/4762.image_65C9B00D.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1145.image_thumb_25939693.png\" alt=\"image\" width=\"601\" height=\"263\" border=\"0\" \/><\/a><\/p>\n<p>And within the Application Settings, go to the&nbsp; &ldquo;<strong>Connection strings<\/strong>&rdquo; section, and add:<\/p>\n<p>Name: DefaultConnection<\/p>\n<p>VALUE: <strong>data source=YOUR_SERVER_NAME.database.windows.net;initial catalog=YOUR_DATABASE_NAME;persist security info=True;user <a href=\"mailto:id=YOUR_USER_NAME@YOUR_SERVER_NAME;password=YOUR_PASSWORD;MultipleActiveResultSets=True\">id=YOUR_USER_NAME@YOUR_SERVER_NAME;password=YOUR_PASSWORD;MultipleActiveResultSets=True<\/a><\/strong>&nbsp;<\/p>\n<p>Where:<\/p>\n<p>YOUR_SERVER_NAME == Your Azure SQL DB Server name<\/p>\n<p>YOUR_DATABASE_NAME == Your Azure SQL DB database name<\/p>\n<p>YOUR_USER_NAME == The user name you chose when creating the Azure SQL DB database<\/p>\n<p>YOUR_PASSWORD == The password you chose when creating the Azure SQL DB database<\/p>\n<p>So you&acute;d have something similar to the following:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6622.image_45D6193C.png\"><img decoding=\"async\" style=\"padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3173.image_thumb_1E9BD007.png\" alt=\"image\" width=\"555\" height=\"261\" border=\"0\" \/><\/a><\/p>\n<p>Notice that I also enabled &ldquo;Remote Debugging&rdquo; just in case I want to debug remotely my app\/services.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>\/* **** OUTDATED ********************<\/strong><\/p>\n<p><strong>ONLY if using MyShuttle app Nov\/Dec 2014 version targeting VS 2015 PREVIEW<\/strong>, we were using an App settings key rather than a regular ConnString:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6443.image_732FC313.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1638.image_thumb_5314B656.png\" alt=\"image\" width=\"583\" height=\"137\" border=\"0\" \/><\/a><\/p>\n<p>So, you have to add a new key-value pair for the connection string, basically, the following:<\/p>\n<p>KEY NAME: <strong>EntityFramework:MyShuttleContext:ConnectionStringKey<\/strong><\/p>\n<p>VALUE: <strong>data source=YOUR_SERVER_NAME.database.windows.net;initial catalog=YOUR_DATABASE_NAME;persist security info=True;user <a href=\"mailto:id=YOUR_USER_NAME@YOUR_SERVER_NAME;password=YOUR_PASSWORD;MultipleActiveResultSets=True\">id=YOUR_USER_NAME@YOUR_SERVER_NAME;password=YOUR_PASSWORD;MultipleActiveResultSets=True<\/a><\/strong><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6874.image_4BF579DE.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/5126.image_thumb_773CA196.png\" alt=\"image\" width=\"611\" height=\"136\" border=\"0\" \/><\/a><\/p>\n<p><strong>**** OUTDATED ************************* *\/<\/strong><\/p>\n<p>(OPTIONAL STEP \/ Checking): If you want to make sure that the Azure SQL DB is right, you could Connect to it from SQL Server Management Studio and using the data I mention above.<\/p>\n<p>But before trying to Connect from the outside of the Azure Cloud (SQL Server Management Studio or VS), you need to provide a rule to your Azure SQL DB SERVER in Azure, like:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1425.image_701D651E.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1121.image_thumb_50025861.png\" alt=\"image\" width=\"491\" height=\"294\" border=\"0\" \/><\/a><\/p>\n<p>Either for a single IP or for all IPs. In this case I opened the rule to all IPs, just so you see the wider rule (not recommended for production systems for obvious reasons).<\/p>\n<p>Then, you should be able to Connect from your machine to the Azure SQL DB in the cloud, so you can ceck that the server and DB are ok.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/3835.image_46A923DE.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/2352.image_thumb_09AA13AE.png\" alt=\"image\" width=\"614\" height=\"256\" border=\"0\" \/><\/a><\/p>\n<p>Or from Visual Studio Server Explorer.<\/p>\n<p>In your case, you still won&acute;t have the tables, since the sample data will be populated the first time that the app runs in the cloud.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/8561.image_0C52CF5F.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7571.image_thumb_5606C8B1.png\" alt=\"image\" width=\"256\" height=\"370\" border=\"0\" \/><\/a> <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/6327.image_43BE01EF.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/4666.image_thumb_27463171.png\" alt=\"image\" width=\"291\" height=\"365\" border=\"0\" \/><\/a><\/p>\n<p>So, once you are sure that you have your connection string right in your Web Site app settings in Azure, hit on &ldquo;Next&rdquo; and &ldquo;Publish&rdquo; the Web Site from Visual Studio.<\/p>\n<p>VS will compile the SOLUTION and start to deploy to Azure:<\/p>\n<p>You can Check how it advances with the &ldquo;Web Publish Activity&rdquo; window in VS:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/8284.image_53F17BFB.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/2821.image_thumb_4CD23F83.png\" alt=\"image\" width=\"707\" height=\"133\" border=\"0\" \/><\/a><\/p>\n<p>Until it finishes like here:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7624.image_218DA87C.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/1803.image_thumb_61578F01.png\" alt=\"image\" width=\"384\" height=\"191\" border=\"0\" \/><\/a><\/p>\n<p>And here you have the MyShuttle.biz site, up and running in a Microsoft Azure Web Site in the cloud!<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/4861.image_0EDB3F76.png\"><img decoding=\"async\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/7181.image_thumb_03458237.png\" alt=\"image\" width=\"487\" height=\"386\" border=\"0\" \/><\/a><\/p>\n<p>Of course, it is not just the MVC site what you have here, it is also all the Web API Services and the SPA app that you can also test when login, etc.<\/p>\n<p>You are now ready to grab and test the MyShuttle.biz mobile Apps (<strong>Universal Windows Apps<\/strong> for <strong>WP<\/strong> and <strong>Windows Store<\/strong> and the <strong>Xamarin<\/strong> Apps for <strong>iOS<\/strong> and <strong>Android<\/strong>) since all those apps consume the same ASP.NET 5 Web API Services.<\/p>\n<h2>SignalR configuration in the Azure Web Site settings<\/h2>\n<p>Even when &ldquo;just for running&rdquo; the web application the following configuration is not required, but when consuming these ASP.NET 5 SignalR services from the mobile apps (Cordova app, Windows Phone app and Xamarin apps) then you&rsquo;ll need to have this parameters as part of the settings of the web site in Azure.<\/p>\n<p>Go to the Web Site <strong>App Settings<\/strong> in the Azure Portal and add the following key\/value pairs:<\/p>\n<p><strong>SignalRHubName: MyShuttleHub<\/strong>&nbsp; (This is the name of the SignalR Hub class)<\/p>\n<p><strong>SignalRUrl<\/strong>: <a title=\"http:\/\/myshuttle2.azurewebsites.net\/web\" href=\"http:\/\/YOUR_WEBSITE.azurewebsites.net\/\">http:\/\/YOUR_WEBSITE.azurewebsites.net\/<\/a><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/4846.image_51C46526.png\"><img decoding=\"async\" style=\"padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/32\/2019\/03\/4034.image_thumb_5B202A5A.png\" alt=\"image\" width=\"643\" height=\"52\" border=\"0\" \/><\/a><\/p>\n<h2>Next steps<\/h2>\n<p>This is all I wanted to show about ASP.NET 5 (codename Project K) and our MyShuttle.biz web application and services.<\/p>\n<p>You could also try to remote debug this application in Visual Studio 2015 attaching to the Azure Web Site process remotely.<\/p>\n<p>Next step would be to run this same application in a Mac!. I&acute;ll plan to publish a specific post about that, as well.<\/p>\n<p>Enjoy <strong>ASP.NET 5<\/strong>! It rocks!<\/p>\n<h2>Download the code!<\/h2>\n<p><em><a href=\"https:\/\/code.msdn.microsoft.com\/MyShuttle-demo-applications-1a4b68fe\"><strong>Download page from MSDN Samples<\/strong><\/a><\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [***&nbsp;March 2015 &ndash; UPDATED to Visual Studio 2015 CTP&nbsp;6 version ***] If you want to have a detailed overview about ASP.NET 5 and .NET Core 5, check this blog post out that I wrote a few days ago. This actual blog post (focusing on ASP.NET 5 web apps development) is the second post of [&hellip;]<\/p>\n","protected":false},"author":362,"featured_media":12806,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-43","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cesardelatorre"],"acf":[],"blog_post_summary":"<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [***&nbsp;March 2015 &ndash; UPDATED to Visual Studio 2015 CTP&nbsp;6 version ***] If you want to have a detailed overview about ASP.NET 5 and .NET Core 5, check this blog post out that I wrote a few days ago. This actual blog post (focusing on ASP.NET 5 web apps development) is the second post of [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/posts\/43","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/users\/362"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/comments?post=43"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/posts\/43\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/media\/12806"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/media?parent=43"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/categories?post=43"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/tags?post=43"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}