Fri, 17 Feb 2017 22:31:10 GMTI'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. [...]
Wed, 08 Feb 2017 03:52:00 GMTI 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. [...]
Tue, 07 Feb 2017 01:25:00 GMTI 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:
Sat, 04 Feb 2017 11:46:19 GMTI'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. [...]
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.
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.
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!
Wed, 25 Jan 2017 06:09:17 GMTYes, 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. [...]
Sat, 21 Jan 2017 01:58:00 GMTAs .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