Subscribe: Scott Hanselman's Computer Zen
http://www.hanselman.com/blog/SyndicationService.asmx/GetAtom
Added By: Feedage Forager Feedage Grade A rated
Language: English
Tags:
app service  app  core  dir  dotnet new  dotnet  json  net core  net  new  plan  project  run  scott hanselman  version  web 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Scott Hanselman's Computer Zen

Scott Hanselman's Blog



Scott Hanselman on Programming, User Experience, The Zen of Computers and Life in General



 



Penny Pinching in the Cloud: Running and Managing LOTS of Web Apps on a single Azure App Service

Fri, 17 Feb 2017 22:31:10 GMT

I've blogged before about "penny pinching in the cloud." I'll update that series for 2017 soon, but the underlying concepts still apply. Many if you are still using bigger virtual machines than are needed when doing IaaS (Infrastructure as a Service) or when doing PaaS (Platform as a Service) folks are doing "one website per App Service." That's super expensive. Remember that you can fit as many web applications as memory and CPU will into an Azure App Service Plan. An "App Service Plan" in Azure is effectively the Virtual Machine under your Web Apps. You don't need to think about it as it's totally managed and hidden - but - if you choose think about it you'll be able to squeeze more out of it and you'll pay less. For example, I have 20 web applications running in a plan I named "DefaultServerFarm." It's a Small Standard Plan (S1) and I pay about $70 a month. Some folks use a Basic (B1) plan if they don't need to scale out and that's about $50 a month. Both B1 and S1 support "unlimited" web apps within them, to the limits of memory. That's what allows me to run 20 modest (but real) sites on the one plan and that's what makes it a good deal from a pricing perspective for me. I logged in to the Azure Portal recently and noticed the CPU percentage on my plan was higher than usual and higher than I'd like. That's the CPU of the machine "under" my 20 sites. I can click here on my App Service Plan's "blade" to see the underlying sites, or just click "Apps" in the blade menu. However, when I'm looking at an app that lives within my plan, there's two super powerful menu items to check out. One is  called "Metrics per instance (Apps)" and one is "Metrics per instance (App Service)." Click the latter option. For many of you it's going to become your favorite area in the Azure Portal. It was a game changer for me as it gave me the internal insight I needed to make sure I can get maximum density in my plan (thereby saving the most money). I click here and see "Sites in App Service Plan." I can see that over the last few days my CPU has been going up and up... I can see by site: So now I can filter by site and I see that it's ONE site that's going nuts. I can then dig in, go to the main CPU charge and see exactly when it started: I can change the scale I had a Web Job stuck in a loop. I restarted and will be monitoring but for now, I'm in a much better place for this one app. Now if I check the App Service Plan itself, I can see everything has calmed down. The point here is that even though it's "Platform as a Service" and we want a layer of abstraction, at no point are things HIDDEN from us. If you want to see the hardware, you can. If you want to see the process tree, you can. A good reminder. Sponsor: Excited about the future in ASP.NET? The folks at Progress held an awesome webinar which gives a 360⁰ view of the new ASP.NET Core and how it compares to WebForms and MVC. Watch it now on demand!© 2016 Scott Hanselman. All rights reserved.       [...]



dotnet new angular and dotnet new react

Mon, 13 Feb 2017 05:33:00 GMT

I was exploring the "dotnet new" experience last week and how you can extend templates, then today the .NET WebDev blog posted about Steve Sanderson's work around Single Page Apps (SPA). Perfect timing! Since I have Visual Studio 2017 RC and my .NET Core SDK tools are also RC4:C:\Users\scott\Desktop\fancypants>dotnet --info.NET Command Line Tools (1.0.0-rc4-004771)Product Information: Version: 1.0.0-rc4-004771 Commit SHA-1 hash: 4228198f0eRuntime Environment: OS Name: Windows OS Version: 10.0.15031 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\1.0.0-rc4-004771 I can then do this from the dotnet command line interface (CLI) and install the SPA templates:dotnet new --install Microsoft.AspNetCore.SpaTemplates::* The * is the package version so this is getting the latest templates from NuGet. I'm looking forward to using YOUR templates (docs are coming! These are fresh hot bits.) This command adds new templates to dotnet new. You can see the expanded list here:Templates Short Name Language Tags------------------------------------------------------------------------------------------Console Application console [C#], F# Common/ConsoleClass library classlib [C#], F# Common/LibraryUnit Test Project mstest [C#], F# Test/MSTestxUnit Test Project xunit [C#], F# Test/xUnitEmpty ASP.NET Core Web Application web [C#] Web/EmptyMVC ASP.NET Core Web Application mvc [C#], F# Web/MVCMVC ASP.NET Core with Angular angular [C#] Web/MVC/SPAMVC ASP.NET Core with Aurelia aurelia [C#] Web/MVC/SPAMVC ASP.NET Core with Knockout knockout [C#] Web/MVC/SPAMVC ASP.NET Core with React react [C#] Web/MVC/SPAMVC ASP.NET Core with React and Redux reactredux [C#] Web/MVC/SPAWeb API ASP.NET Core Web Application webapi [C#] Web/WebAPISolution File sln Solution See there? Now I've got "dotnet new react" or "dotnet new angular" which is awesome. Now I just "npm install" and "dotnet restore" followed by a "dotnet run" and very quickly I have a great starter point for a SPA application written in ASP.NET Core 1.0 running on .NET Core 1.0. It even includes a dockerfile if I like. From the template, to help you get started, they've also set up: Client-side navigation. For example, click Counter then Back to return here. Server-side prerendering. For faster initial loading and improved SEO, your Angular 2 app is prerendered on the server. The resulting HTML is then transferred to the browser where a client-side copy of the app takes over. THIS IS HUGE. Webpack dev middleware. In development mode, there's no need to run the webpack build tool. Your client-side resources are dynamically built on demand. Updates are available as soon as you modify any file. Hot module replacement. In development mode, you don't even need to reload the page after making most changes. Within seconds of saving changes to files, your Angular 2 app will be rebuilt and a new instance injected is into the page. Efficient production builds. In production mode, development-time features are disabled, and the webpack build tool produces minified static CSS and JavaScript files. Go and read about these new SPA templates in depth on the WebDev blog. Sponsor: Big thanks to Raygun! Join 40,000+ developers who monitor their apps with Raygun. Understand the root cause of errors, crashes and performance issues in your software applications. Installs in minutes, try it today! © 2016 Scott Hanselman. All rights reserved.       [...]



How to make an offline installer for VS2017

Wed, 08 Feb 2017 03:52:00 GMT

I just got back from Kenya and South Africa and had a great time speaking at NexTech Africa and the Microsoft Tech Summit in Johannesburg. I also got to hang out with my wife's family a bunch. While I was there I was reminded (as one is when one travels) how spoiled many of us with being always connected. Depending on how far out of town you get the quality of internet varies. There's not just bandwidth issues but also issues of latency and reliability. Visual Studio generally - and Visual Studio 2017 specifically - has an online installer and if you lose connectivity during the installation you can run into problems. However, they haven't got an ISO available for downloading for legal reasons. They can't package up the Android Installer from Google, for example, into an ISO. The user needs to download certain things themselves dynamically. Fortunately there's docs that walk you through making an offline installer. These could be used to create USB sticks or DVDs that could then be passed out at User Groups or free Events. First, I went to http://visualstudio.com/free and clicked Download. I use VS Community but you can also do this for Enterprise, etc. I downloaded the bootstrapper .exe and put it in its own folder. If you want EVERYTHING possible then you'd run something like this. Note that is my folder there and I selected en-US as my language.vs_community.exe --layout e:\vs2017offline --lang en-US However if you don't want EVERYTHING - maybe you just want .NET Core, ASP.NET Core, and Azure, then you'll pass those options in on the command line. They call them "Workloads" but that's a Microsoftism. Here is a list of all the Component IDs you can choose from. I did this to get an offline setup for my main four "workloads." I ran this from a cmd prompt.vs_community.exe --layout e:\vs2017offline --lang en-US --add Microsoft.VisualStudio.Workload.Azure Microsoft.VisualStudio.Workload.ManagedDesktop Microsoft.VisualStudio.Workload.NetCoreTools Microsoft.VisualStudio.Workload.NetWeb It will go and download everything you need. If you want everything then it'll take a while, so hang back. If you have trouble or nothing happens, check the dd_bootstrapper*.log file in %TEMP%. When it's all done you'll end up with a folder like this that you can copy to a DVD or USB key. One nice aspect of this system is that you can update a "layout" in place. As updates become available for Visual Studio 2017 (RC or otherwise), you can run the --layout command again, pointing to the same layout folder, to ensure that the folder contains the latest components. Only those components that have been updated since the last time --layout was run will be downloaded. IMPORTANT NOTE: Make sure that your file is named "vs_[SKU].exe." Sometimes you'll end up with a file like vs_community__198521760.1486960229.exe and you'll want to rename it to vs_community.exe for offline to work. Before you run the installer, you'll want to install the root certificates in the \certificates folder. From the team: They are the root certs needed to verify the setup application (the stuff installed under ProgramFiles\Visual Studio\2017\Installer) and the catalog (a json file that lists of all the VS components that could be installed by setup).  Most computers will already have these root certs.  But users on Win7 machine may not.  Once you install these certs, setup will be able to authenticate the content being installed is trusted.  You should not remove them after installing them. I hope this helps you set up offline installers for your classrooms and organizations! You'll save a lot of bandwidth. Sponsor: Big thanks to Raygun! Join 40,000+ developers who monitor their apps with Raygun. Understand the root cause of errors, crashes and performance issues in your software applications. Installs in minutes, try it today!© 2016 Scott Hanselman. All rights reserved.       [...]



Trying out "dotnet new" template updates and csproj with VS2017

Tue, 07 Feb 2017 01:25:00 GMT

I updated my Visual Studio 2017 RC installation today. Here's the release notes. You just run "Visual Studio Installer" if you've already got a version installed and it updates. The updating processes reminds me a little of how Office 365 updates itself. It's not as scary as VS updates of the past. You can download the VS2017 RC at https://www.visualstudio.com and it works side by side with your existing installs. I haven't had any issues yet. It also added/updated a new .NET Core SDK. I am a fan of the command line "dotnet.exe" tooling and I've been pushing for improvements in that experience. A bunch of stuff landed in this update that I've been waiting for. Here's dotnet new:C:\Users\scott\Desktop\poop> dotnet newTemplate Instantiation Commands for .NET Core CLI.Usage: dotnet new [arguments] [options]Arguments: template The template to instantiate.Options: -l|--list List templates containing the specified name. -lang|--language Specifies the language of the template to create -n|--name The name for the output being created. If no name is specified, the name of the current directory is used. -o|--output Location to place the generated output. -h|--help Displays help for this command. -all|--show-all Shows all templatesTemplates Short Name Language Tags--------------------------------------------------------------------------------------Console Application console [C#], F# Common/ConsoleClass library classlib [C#], F# Common/LibraryUnit Test Project mstest [C#], F# Test/MSTestxUnit Test Project xunit [C#], F# Test/xUnitEmpty ASP.NET Core Web Application web [C#] Web/EmptyMVC ASP.NET Core Web Application mvc [C#], F# Web/MVCWeb API ASP.NET Core Web Application webapi [C#] Web/WebAPISolution File sln SolutionExamples: dotnet new mvc --auth None --framework netcoreapp1.0 dotnet new console --framework netcoreapp1.0 dotnet new --help There is a whole new templating engine now. The code is here https://github.com/dotnet/templating and you can read about how to make your own templates or on the wiki. I did a "dotnet new xunit" and it made the csproj file and a Unit Test. Here's what's inside the csproj: Exe netcoreapp1.0 That's not too bad. Here's a a library with no references: netstandard1.4 Note there's no GUIDs in the csproj. Sweet. Remember also that there was talk that you wouldn't have to edit your csproj manually? Check this out:C:\Users\scott\Desktop\poop\lib> dotnet add package Newtonsoft.JsonMicrosoft (R) Build Engine version 15.1.545.13942Copyright (C) Microsoft Corporation. All rights reserved. Writing C:\Users\scott\AppData\Local\Temp\tmpBA1D.tmpinfo : Adding PackageReference for package 'Newtonsoft.Json' into project 'C:\Users\scott\Desktop\poop\lib\lib.csproj'.log : Restoring packages for C:\Users\scott\Desktop\poop\lib\lib.csproj...info : GET https://api.nuget.org/v3-flatcontainer/newtonsoft.json/index.jsoninfo : OK https://api.nuget.org/v3-flatcontainer/newtonsoft.json[...]



NXTA - NexTech Africa Conference - Day 1 perspectives

Sat, 04 Feb 2017 11:46:19 GMT

I'm in Nairobi, Kenya this week attending a fantastic event called NexTech Africa. It is a free event that showcases the best of what Africa's Startup community has to offer. This event is mostly focused on East Africa's tech community but it included delegates from all over the continent. I'm told over 1000 people are here. My wife is Zimbabwean and we have family all over in places like South Africa, Tanzania, and Zimbabwe, and friends in a dozen other countries. I personally feel that access to technology and technical education is a fantastic way to help Africa's burgeoning middle class. However, this trip was for listening. It's silly for me (or anyone who isn't living on the continent) to fly in and "drop the knowledge" and fly out. In fact, it's condescending. So I'm spending this week visiting startups, talking to engineers, university students, and tech entrepreneurs. I spoke at length with the engineers at BRCK, a Kenya-based startup that has a "brick" that's a portable router, NAS, Compute Module, Captive Portal, and so much more. They can drop one of these a little outside of town and give wi-fi to an entire area. Even better, there could be hyper-local content on the devices. Folks with 30+Mbps Internet may be spoiled with HD content, but why not have a smart router download TV shows and Movies that can be served (much like movies stored on an airplane's hard drive that you can watch via wi-fi while you fly) to everyone in the local area. The possibilities are endless and they're doing all the work from hardware to firmware to software in-country with local talent. I also visited iHub's Technology Innovation Community and saw where they teach classes to local students, have maker- and hacker-spaces, support a UXLab and host local tech meetups. I'll be hopefully communicating more and more with the new friends I've met and perhaps bring a few of them to the podcast so you can hear their stories yourself. These are uniquely African solutions to problems that Africans have identified they want to solve. I am learning a ton and have been thrilled to be involved. Since I focus on Open Source .NET and .NET Core, I think there's an opportunity for C# that could enable new mobile apps via Xamarin with backends written in ASP.NET Core and running on whatever operating system makes one happy. Sponsor: Track every change to your database. See who made changes, what they did, & why, with SQL Source Control. Get a full version history in your source control system. See how with Red Gate's SQL Source Control.© 2016 Scott Hanselman. All rights reserved.       [...]



VIDEO: How to get started with technical public speaking!

Thu, 26 Jan 2017 07:39:06 GMT

On .NET is a weekly chat with team members from the .NET team at Microsoft. This week we put together something a little different, and honestly, I think it not only went really well, but I think it's an hour that provides a lot of value that goes well beyond .NET or any technology.

(image)

We put together a panel of folks at different points in their technical careers. Some just starting to speak publicly and some who've been doing it for 20+ years. Some introverts, some extroverts. Some with speaking or theater experience, others with none. And we talked!

We chatted about how to get started, where you can learn to speak on technical topics, how to form a story arc, how to best utilize your gifts, when to be critical and when to breathe.

It was great fun and included myself, Kendra Havens, Maria Naggaga Nakanwagi, Kasey Uhlenhuth, and Donovan Brown. You can view or download it here on Channel 9, or you can watch it on YouTube embedded below.

height="315" src="https://www.youtube.com/embed/AY5Q9jw0n4g" frameborder="0" width="560" allowfullscreen>

Let us know if this kind of content is useful, and if you want to see more in the future.


Sponsor: Big thumbs-up for Kendo UI! They published a comprehensive whitepaper on responsive web design and the best and fastest way to serve desktop and mobile web users in a tailored and cost-effective manner. Check it out!



© 2016 Scott Hanselman. All rights reserved.



Solved and Fixed: StreetPass stopped working on Nintendo 3DS XL

Wed, 25 Jan 2017 06:09:17 GMT

Yes, this is kind of a silly blog post but it's been bugging me for months so I wanted to get it out there in case it helps someone who is googling for the answer! I have a little Nintendo 3DS XL (the "new" one) that I bought for long trips. It's a great little device with a large library of games, plus it plays SNES classics like Super Metroid. All in all, I'm thrilled with the purchase. It has wifi, and both Netflix and Hulu in a pinch for the kids, but it also has some really cool social features using a proprietary wifi connection called "StreetPass." The nutshell is that if you pass by someone (within 30-40 feet in my experience) their "Mii" avatar will jump into your game console and bring with it data from other games. There's simple stuff like Puzzles, there's mini games like Find Mii, and StreetPass enhances more complex games like Mario World or Resident Evil: Revelations by adding in whole new components. In Resident Evil you'll get communications and weapons drops from your colleagues who are apparently fighting zombies at the same time as you. In Shovel Knight you can race the "ghost" of another player. It's safe and anonymous. If you travel it's even cooler as you'll StreetPass people in airports and collect their countries or states of origin. I carry my 3DS to conventions and all over the world. It's a hoot. BUT. A few months back it stopped StreetPassing. Nothing happened, ever. I made sure everything was updated, turned it on and off, but nada. Recently I fixed it and I'm sure it will fix StreetPass for you also. Go into Mii Maker and design a secondary Mii. Doesn't matter what it looks like. I did it quickly. Switch to that secondary Mii. You won't lose anything. Exit Mii Maker, then go back in and switch back to your original Mii. I surmise that this clears things out and re-writes some settings for you. I also changed my Mii's hat and outfit just to make sure it was re-written completely. Head over to Mii Plaza and you should be all set. My system started StreetPassing within a few hours. I hope this helps someone because as a traveller who really digs StreetPass, having it not work was really harshing my mellow. By the way, I REALLY love this "DreamGear" rubber case I got for my 3DS. It changes the shape of it, makes it larger, almost like an Xbox controller. That's an Amazon link that you can use that will help me get more 3DS games. ;) Sponsor: Big thumbs-up for Kendo UI! They published a comprehensive whitepaper on responsive web design and the best and fastest way to serve desktop and mobile web users in a tailored and cost-effective manner. Check it out!© 2016 Scott Hanselman. All rights reserved.       [...]



Working with Multiple .NET Core SDKs - both project.json and msbuild/csproj

Sat, 21 Jan 2017 01:58:00 GMT

As .NET Core and ASP.NET Core make the transition from project.json style project files to MSBuild (csproj) style files, I'm starting to get myself up to speed on what's needed, what's changing, and why/if it's a good thing. Documentation is still getting updated but there's a great blog post from Nate McMaster who works on the team. As I touched on in a previous post, you can continue working on project.json based projects while experimenting with the newer stuff. Here I have a global.json with the version pinned to an earlier SDK. Then I move to another folder and the .NET CLI gives me another version. Projects can remember and pin their SDK versions. This is assuming that you do have multiple versions (and the ones you want) installed: To be clearer, I'll run "dotnet new" in one folder and again run "dotnet new" in another. Note that one has global.json pinned older "LTS" (Long Term Support) SDK with project.json and one will use the later "Current" (bleeding-edge) stuff. See how that works?C:\Users\scott\Desktop\csprojstuff> dotnet newCreated new C# project in C:\Users\scott\Desktop\csprojstuff.C:\Users\scott\Desktop\csprojstuff> dir Volume in drive C is Windows Volume Serial Number is 00C1-AED2 Directory of C:\Users\scott\Desktop\csprojstuff01/23/2017 01:09 PM .01/23/2017 01:09 PM ..12/07/2016 09:49 PM 422 csprojstuff.csproj12/07/2016 09:49 PM 133 Program.cs 2 File(s) 555 bytes 2 Dir(s) 149,845,356,544 bytes freeC:\Users\scott\Desktop\csprojstuff> cd ..\projjsonstuffC:\Users\scott\Desktop\projjsonstuff> dotnet newCreated new C# project in C:\Users\scott\Desktop\projjsonstuff.C:\Users\scott\Desktop\projjsonstuff> dir Volume in drive C is Windows Volume Serial Number is 00C1-AED2 Directory of C:\Users\scott\Desktop\projjsonstuff01/23/2017 01:10 PM .01/23/2017 01:10 PM ..01/23/2017 01:05 PM 95 global.json06/21/2016 07:10 PM 214 Program.cs06/21/2016 07:10 PM 367 project.json 3 File(s) 676 bytes 2 Dir(s) 149,844,484,096 bytes free Now I can also "migrate" that project.json forward with "dotnet migrate." That's a NEW command so look what happens if I just run it locally there without changing the global.json pinned SDK version? Doesn't work. For this example I'll delete global.json and run it again. C:\Users\scott\Desktop\projjsonstuff> dotnet migrateNo executable found matching command "dotnet-migrate"C:\Users\scott\Desktop\projjsonstuff> del global.jsonC:\Users\scott\Desktop\projjsonstuff> dotnet migrateProject projjsonstuff migration succeeded (C:\Users\scott\Desktop\projjsonstuff)SummaryTotal Projects: 1Succeeded Projects: 1Failed Projects: 0C:\Users\scott\Desktop\projjsonstuff> dir Volume in drive C is Windows Volume Serial Number is 00C1-AED2 Directory of C:\Users\scott\Desktop\projjsonstuff01/23/2017 01:11 PM .01/23/2017 01:11 PM ..01/23/2017 01:11 PM backup06/21/2016 07:10 PM 214 Program.cs01/23/2017 01:11 PM 944 projjsonstuff.csproj 2 File(s) 1,158 bytes 3 Dir(s) 149,843,054,592 bytes free Again, go check out Nate's excellent blog on the topic. He also covers briefly how you can publish "Standalone" or "Self-Contained" Deployments, and points out that in MSBuild world, all projects are portable until you decide to target a runtime:dotnet publish --framework netcoreapp1.0 /p:RuntimeIdentifier=osx.10.11-x64 More on this as it comes! Sponsor: Do you deploy the same application multiple times for each of your end customers? The team at Octopus have taken the pain out of multi-tenant deployments. Check[...]