Quantcast
Channel: Scott Hanselman's Blog
Viewing all 1148 articles
Browse latest View live

Teaching coding from the Metal Up or from the Glass Back?

$
0
0
* Stock photo by WOCInTech Chat used under CC

Maria on my team and I have been pairing (working in code and stuff together) occasionally in order to improve our coding and tech skills. We all have gaps and it's a good idea to go over the "digital fundamentals" every once in a way to make sure you've got things straight. (Follow up post on this topic tomorrow.)

As we were white boarding and learning and alternating teaching each other (the best way to make sure you know a topic is to teach it to another person) I was getting the impression that, well, we weren't feeling each other's style.

Now, before we get started, yes, this is a "there's two kinds of people in this world" post. But this isn't age, background, or gender related from what I can tell. I just think folks are wired a certain way.  Yes, this a post about generalities.

Here's the idea. Just like there are kinesthetic learners and auditory learners and people who learn by repetition, in the computer world I think that some folks learn from the metal up and some folks learn from the glass back.

Learning from Metal Up

Computer Science instruction starts from the metal, most often. The computer's silicon is the metal. You start there and move up. You learn about CPUs, registers, you may learn Assembly or C, then move your way up over the years to a higher level language like Python or Java. Only then will you think about Web APIs and JSON.

You don't learn anything about user interaction or user empathy. You don't learn about shipping updates or test driven development. You learn about algorithms and Turing. You build compilers and abstract syntax trees and frankly, you don't build anything useful from a human perspective. I wrote a file system driver in Minix. I created new languages and built parsers and lexers.

  • When your type cnn.com and press enter you can pretty much tell you from the address bar down to electrons what happens. AND YOU LOVE IT.
  • Your feel like you own the whole stack and you understand computers like your mechanic friends understand internal combustion engines.
  • You'll open the hood of a car and look around before you drive it.
  • You'll open up a decompiler and start poking around to learn.
  • When you learn something new, you want to open it up and see what makes it tick. You want to see how it relates to what you already know.
  • If you need to understand the implementation details then an abstraction is leaking.
  • You know you will be successful because you can have a FEEL for the whole system from the computer science perspective.

Are you this person? Were you wired this way or did you learn it? If you teach this way AND it lines up with how your students learn, everyone will be successful.

Learning from the Glass Back

Learning to code instruction starts from the monitor, most often. Or even the user's eyeballs. What will they experience? Let's start with a web page and move deeper towards the backend from there.

You draw user interfaces and talk about user stories and what it looks like on the screen. You know the CPU is there and how it works but CPU internals don't light you up. If you wanted to learn more you know it's out there on YouTube or Wikipedia. But right now you want to build an application for PEOPLE an the nuts and bolts are less important. 

  • When this person types cnn.com and presses enter they know what to expect and the intermediate steps are an implementation detail.
  • You feel like you own the whole experience and you understand people and what they want from the computer.
  • You want to drive a car around a while and get a feel for it before you pop the hood.
  • You'll open F12 tools and start poking around to learn.
  • When you learn something new, you want to see examples of how it's used in the real world so you can build upon them.
  • If you need to understand the implementation details then someone in another department didn't do their job.
  • You know you will be successful because you can have a FEEL for the whole system from the user's perspective.

Are you this person? Were you wired this way or did you learn it? If you teach this way AND it lines up with how your students learn, everyone will be successful.

    Conclusion

    Everyone is different and everyone learns differently. When teaching folks to code you need to be aware of not only their goals, but also their learning style. Be ware of their classical learning style AND the way they think about computers and technology.

    My personal internal bias sometimes has me asking "HOW DO YOU NOT WANT TO KNOW ABOUT THE TOASTER INTERNALS?!?!" But that not only doesn't ship the product, it minimizes the way that others learn and what their educational goals are.

    I want to take apart the toaster. That's OK. But someone else is more interested in getting the toast to make a BLT. And that's OK.

    * Stock photo by WOCInTech Chat used under CC


    Sponsor: Big thanks to Telerik! They recently published a comprehensive whitepaper on The State of C#, discussing the history of C#, what’s new in C# 7 and whether C# is the top tech to know. Check it out!


    © 2016 Scott Hanselman. All rights reserved.
         

    What .NET Developers ought to know to start in 2017

    $
    0
    0

    .NET ComponentsMany many years ago I wrote a blog post about what .NET Developers ought to know. Unfortunately what was just a list of questions was abused by recruiters and others who used it as a harsh litmus test.

    There's a lot going on in the .NET space so I though it would be nice to update with a gentler list that could be used as a study guide and glossary. Jon Galloway and I sat down and put together this list of terms and resources.

    Your first reaction might be "wow that's a lot of stuff, .NET sucks!" Most platforms have similar glossaries or barriers to entry. There's TLAs (three letter acronyms) in every language and computer ecosystems. Don't get overwhelmed, start with Need To Know and move slowly forward. Also, remember YOU decide when you want to draw the line. You don't need to know everything. Just know that every layer and label has something underneath it and the whatever program you're dealing with may be in a level you have yet to dig into.

    Draw a line under the stuff you need to know. Know that, and know you can look the other stuff up.  Some of us want the details – the internals. Others don't. You may learn from the Metal Up or from the Glass Back. Know your style, and revel in it.

    First, you can start learning .NET and C# online at https://dot.net. You can learn F# online here http://www.tryfsharp.org. Both sites let you write code without downloading anything. You just work in your browser.

    When you're ready, get .NET Core and Visual Studio Code at https://dot.net and start reading! 

    Need To Know

    • What's .NET? .NET has some number of key components. We'll start with runtimes and languages.
    • Here are the three main runtimes:
      • .NET Framework - The .NET framework helps you create mobile, desktop, and web applications that run on Windows PCs, devices and servers.
      • .NET Core - .NET Core gives you a fast and modular platform for creating server applications that run on Windows, Linux and Mac.
      • Mono for Xamarin - Xamarin brings .NET to iOS and Android, reusing skills and code while getting access to the native APIs and performance. Mono is an open source .NET that was created before Xamarin and Microsoft joined together. Mono will support the .NET Standard as another great .NET runtime that is open source and flexible. You'll also find Mono in the Unity game development environment.
    • Here are the main languages:
      • C# is simple, powerful, type-safe, and object-oriented while retaining the expressiveness and elegance of C-style languages. Anyone familiar with C and similar languages will find few problems in adapting to C#. Check out the C# Guide to learn more about C# or try it in your browser at https://dot.net
      • F# is a cross-platform, functional-first programming language that also supports traditional object-oriented and imperative programming. Check out the F# Guide to learn more about F# or try it in your browser at http://www.tryfsharp.org 
      • Visual Basic is an easy language to learn that you can use to build a variety of applications that run on .NET. I started with VB many years ago.
    • Where do I start?
    • After runtimes and languages, there's platforms and frameworks.
      • Frameworks define the APIs you can use. There's the .NET 4.6 Framework, the .NET Standard, etc. Sometimes you'll refer to them by name, or in code and configuration files as a TFM (see below)
      • Platform (in the context of .NET) - Windows, Linux, Mac, Android, iOS, etc. This also includes Bitness, so x86 Windows is not x64 Windows. Each Linux distro is its own platform today as well.
    • TFMs (Target Framework Moniker) - A moniker (string) that lets you refer to target framework + version combinations. For example, net462 (.NET 4.6.2), net35 (.NET 3.5), uap (Universal Windows Platform). For more information, see this blog post. Choosing a TFM decides which APIs are available to you, and which frameworks your code can run on.
    • NuGet - NuGet is the package manager for the Microsoft development platform including .NET. The NuGet client tools provide the ability to produce and consume packages. The NuGet Gallery is the central package repository used by all package authors and consumers.
    • What's an Assembly? - An assembly is typically a DLL or EXE containing compiled code. Assemblies are the building blocks of .NET Full Framework applications; they form the fundamental unit of deployment, version control, reuse, activation scoping, and security permissions. In .NET Core, the building blocks are NuGet packages that contain assemblies PLUS additional metadata
    • .NET Standard or "netstandard" - The .NET Standard simplifies references between binary-compatible frameworks, allowing a single target framework to reference a combination of others. The .NET Standard Library is a formal specification of .NET APIs that are intended to be available on all .NET runtimes.
    • .NET Framework vs. .NET Core: The .NET Framework is for Windows apps and Windows systems, while the .NET Core is a smaller cross platform framework for server apps, console apps, web applications, and as a core runtime to build other systems from.

    Should Know

      • CLR – The Common Language Runtime (CLR), the virtual machine component of Microsoft's .NET framework, manages the execution of .NET programs. A process known as just-in-time compilation converts compiled code into machine instructions which the computer's CPU then executes.
      • CoreCLR - .NET runtime, used by .NET Core.
      • Mono - .NET runtime, used by Xamarin and others.
      • CoreFX - .NET class libraries, used by .NET Core and to a degree by Mono via source sharing.
      • Roslyn - C# and Visual Basic compilers, used by most .NET platforms and tools. Exposes APIs for reading, writing and analyzing source code.
      • GC - .NET uses garbage collection to provide automatic memory management for programs. The GC operates on a lazy approach to memory management, preferring application throughput to the immediate collection of memory. To learn more about the .NET GC, check out Fundamentals of garbage collection (GC).
      • "Managed Code" - Managed code is just that: code whose execution is managed by a runtime like the CLR.
      • IL – Intermediate Language is the product of compilation of code written in high-level .NET languages. C# is Apples, IL is Apple Sauce, and the JIT and CLR makes Apple Juice. ;)
      • JIT – Just in Time Compiler. Takes IL and compiles it in preparation for running as native code.
      • Where is  .NET on disk? .NET Framework is at C:\Windows\Microsoft.NET and .NET Core is at C:\Program Files\dotnet. .NET Core can also be bundled with an application and live under that application's directory as a self-contained application.
      • Shared Framework vs. Self Contained Apps - .NET Core can use a shared framework (shared by multiple apps on the same machine) or your app can be self-contained with its own copy. Sometimes you'll hear "xcopy-deployable / bin-deployable" which implies that the application is totally self-contained.
      • async and await– The async and await keywords generate IL that will free up a thread for long running (awaited) function calls (e.g. database queries or web service calls). This frees up system resources, so you aren't hogging memory, threads, etc. while you're waiting.
      • Portable Class Libraries -  These are "lowest common denominator" libraries that allow code sharing across platforms. Although PCLs are supported, package authors should support netstandard instead. The .NET Platform Standard is an evolution of PCLs and represents binary portability across platforms.
      • .NET Core is composed of the following parts:
        • A .NET runtime, which provides a type system, assembly loading, a garbage collector, native interop and other basic services.
        • A set of framework libraries, which provide primitive data types, app composition types and fundamental utilities.
        • A set of SDK tools and language compilers that enable the base developer experience, available in the .NET Core SDK.
        • The 'dotnet' app host, which is used to launch .NET Core apps. It selects the runtime and hosts the runtime, provides an assembly loading policy and launches the app. The same host is also used to launch SDK tools in much the same way.

      Nice To Know

        • GAC – The Global Assembly Cache is where the .NET full Framework on Windows stores shared libraries. You can list it out with "gacutil /list."  
        • Assembly Loading and Binding - In complex apps you can get into interesting scenarios around how Assemblies are loaded from disk
        • Profiling (memory usage, GC, etc.) - There's a lot of great tools you can use to measure – or profile – your C# and .NET Code. A lot of these tools are built into Visual Studio.
        • LINQ - Language Integrated Query is a higher order way to query objects and databases in a declarative way
        • Common Type System and Common Language Specification define how objects are used and passed around in a way that makes them work everywhere .NET works, interoperable. The CLS is a subset that the CTS builds on.
        • .NET Native - One day you'll be able to compile to native code rather than compiling to Intermediate Language.
        • .NET Roadmap - Here's what Microsoft is planning for .NET for 2017
        • "Modern" C# 7 – C# itself has new features every year or so. The latest version is C# 7 and has lots of cool features worth looking at.
        • Reactive Extensions - "The Reactive Extensions (Rx) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators." You can create sophisticated event-based programs that work cleanly and asynchronously by applying LINQ-style operators to data streams.

        NOTE: Some text was taken from Wikipedia's respective articles on each topic, edited for brevity. Creative Commons Attribution-ShareAlike 3.0. Some text was taken directly from the excellent .NET docs. This post is a link blog and aggregate. Some of it is original thought, but much is not.


        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.
             

        Monday Vision, Daily Outcomes, Friday Reflection for Remote Team Management

        $
        0
        0

        Monday Vision, Friday ReflectionMy friend J.D. Meier has an amazing blog called Sources of Insight and he's written a fantastic book called Getting Results the Agile Way. You can buy his book on Amazon (it's free on Kindle Unlimited!). I put J.D. up there with David Allen and Stephen Covey except J.D. is undiscovered. For real. If you've seen my own live talk on Personal Productivity and Information Overload you know I reference J.D.'s work a lot.

        I've been a people manager as well as an IC (individual contributor) for a while now, and while I don't yet have the confidence to tell you I'm a good manager, I can tell you that I'm trying and that I'm introspective about my efforts.

        My small team applies J.D.'s technique of "Monday Vision, Daily Outcomes, Friday Reflection" to our own work. As he says, this is the heart of his results system.

        The way it works is, on Mondays, you figure out the 3 outcomes you want for the week.  Each day you identify 3 outcomes you want to accomplish.  On Friday, you reflect on 3 things going well and 3 things to improve.  It’s that simple. - J.D. Meier

        We are a remote team and we are in three different time zones so the "morning standup" doesn't really work so well for us. We want a "scrum" style standup, but we're a team that lives in Email/Slack/Microsoft Teams/Skype.

        Here's how Monday Vision works for us as a team. We are transparent about what we're working on and we are honest about what works and when we stumble.

        • On Monday morning each of us emails the team with:
          • What we hope to accomplish this week. Usually 3-5 things.
          • This isn't a complete list of everything on our minds. It's just enough to give context and a vector/direction.

        It's important that we are clear on what our goals are. What would it take for this week to be amazing? What kinds of things are standing in our way? As a manager I think my job is primarily as traffic cop and support. My job is to get stuff out of my team's way. That might be paperwork, other teams, technical stuff, whatever is keeping them out of their flow.

        These emails might be as simple as this (~real) example from a team member.

        Last Week:

        • DevIntersection Conference
          • Workshop and 2 sessions
        • Got approval from Hunter for new JavaScript functionality

        This Week:

        • Trip Report, Expenses, and general administrivia from the event last week
        • Final planning for MVP Summit
        • Spring Planning for ASP.NET Web Forms, IIS Express, EF4, WCF, and more 
        • Modern ASP.NET Web Forms research paper
        • Thursday evening – presenting over Skype to the London.NET user-group “Introduction to Microservices in ASP.NET Core”

        Again, the lengths and amount of detail vary. Here's the challenge part though - and my team hasn't nailed this yet and that's mostly my fault - Friday Reflection. I have an appointment on my calendar for Friday at 4:30pm to Reflect. This is literally blocked out time to look back and ask these questions....

        • On Friday evening on the way out, email the team with:
          • What worked this week? Why didn't Project Foo get done? Was the problem technical? Logistical? Organizational?
          • Did you feel amazing about this week? Why? Why not? How can we make next week feel better?

        What do you do to kick off and close down your week?

        Related J.D. Meier productivity reading


        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.
             

        Three FREE Training Courses on ASP.NET Core from Microsoft Virtual Academy

        $
        0
        0

        This time last year we did a Microsoft Virtual Academy class on what was then called "ASP.NET 5." It made sense to call it 5 since 5 > 4.6, right? But since then ASP.NET 5 has become .NET Core 1.0 and ASP.NET Core 1.0. It's 1.0 because it's smaller, newer, and different. As the .NET "full" framework marches on, on Windows, .NET Core is cross-platform and for the cloud.

        Command line concepts like dnx, dnu, and dnvm have been unified into a single "dotnet" driver. You can download .NET Core at http://dot.net and along with http://code.visualstudio.com you can get a web site up and running in 10 minutes on Windows, Mac, or many flavors of Linux.

        So, we've decided to update and refresh our Microsoft Virtual Academy. In fact, we've done three days of training. Introduction, Intermediate, and Cross-Platform and all three days are now available! We just released training for ASP.NET Core 1.0 Cross-Platform that shows Mac, Ubuntu, and Docker!

        Head over to Microsoft Virtual Academy and watch our new, free "Introduction to ASP.NET Core 1.0." It's a great relaxed pace if you've been out of the game for a bit, or you're a seasoned .NET "Full" developer who has avoided learning .NET Core thus far. If you don't know the C# language yet, check out our online C# tutorial first, then watch the video.

        Introduction to ASP.NET Core 1.0

        Join experts Scott Hanselman and Maria Naggaga, and find out how to build .NET Core applications on any operating system. Bring your web development expertise and roll up your sleeves, for this first in a three-part series.

        image

        Intermediate ASP.NET Core 1.0

        Want a deeper dive into ASP.NET Core 1.0? Build on what you learned in Introduction to ASP.NET Core 1.0, and explore this new technology even further, as Scott Hanselman, Jeff Fritz, and Rowan Miller offer an in-depth, intermediate-level look at ASP.NET Core 1.0.

        Intermediate ASP.NET Core 1.0

        ASP.NET Core 1.0 Cross-Platform

        Ready to build and deploy ASP.NET Core 1.0 apps? Join experts Scott Hanselman, Maria Naggaga, and Glenn Condron, and see how to do just that using Mac and Linux. Revisit content from the Introduction to ASP.NET Core 1.0 course, but using a Mac and Linux.

        image

        Do us a favor when you watch these, rate them (5 stars!) and SHARE them on your social networks.

        NOTE: There's a LOT of quality free courseware for learning .NET Core and ASP.NET Core. We've put the best at http://asp.net/free-courses and I encourage you to check them out!

        Hope you have as much fun with these courses as we had creating them!


        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 out their latest 3.4 release



        © 2016 Scott Hanselman. All rights reserved.
             

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

        $
        0
        0

        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.

        Global.json is useful

        This is assuming that you do have multiple versions (and the ones you want) installed:

        Here I have 4 SDKs installed and I can see them in my installation folder

        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 new
        
        Created 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\csprojstuff

        01/23/2017 01:09 PM <DIR> .
        01/23/2017 01:09 PM <DIR> ..
        12/07/2016 09:49 PM 422 csprojstuff.csproj
        12/07/2016 09:49 PM 133 Program.cs
        2 File(s) 555 bytes
        2 Dir(s) 149,845,356,544 bytes free

        C:\Users\scott\Desktop\csprojstuff> cd ..\projjsonstuff

        C:\Users\scott\Desktop\projjsonstuff> dotnet new
        Created 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\projjsonstuff

        01/23/2017 01:10 PM <DIR> .
        01/23/2017 01:10 PM <DIR> ..
        01/23/2017 01:05 PM 95 global.json
        06/21/2016 07:10 PM 214 Program.cs
        06/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 migrate
        
        No executable found matching command "dotnet-migrate"

        C:\Users\scott\Desktop\projjsonstuff> del global.json

        C:\Users\scott\Desktop\projjsonstuff> dotnet migrate
        Project projjsonstuff migration succeeded (C:\Users\scott\Desktop\projjsonstuff)
        Summary
        Total Projects: 1
        Succeeded Projects: 1
        Failed Projects: 0


        C:\Users\scott\Desktop\projjsonstuff> dir
        Volume in drive C is Windows
        Volume Serial Number is 00C1-AED2

        Directory of C:\Users\scott\Desktop\projjsonstuff

        01/23/2017 01:11 PM <DIR> .
        01/23/2017 01:11 PM <DIR> ..
        01/23/2017 01:11 PM <DIR> backup
        06/21/2016 07:10 PM 214 Program.cs
        01/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 out their latest 3.4 release


        © 2016 Scott Hanselman. All rights reserved.
             

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

        $
        0
        0

        Nice to meet you! says my MiiYes, 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.

        Photo Jan 24, 9 59 42 PM

        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.
             

        VIDEO: How to get started with technical public speaking!

        $
        0
        0

        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.

        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.
             

        NXTA - NexTech Africa Conference - Day 1 perspectives

        $
        0
        0

        imageI'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.

        image

        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.

        image

        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.



        © 2016 Scott Hanselman. All rights reserved.
             

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

        $
        0
        0

        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.

        New Templating Engine for .NET Core CLI

        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 new
        
        Template 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 templates


        Templates Short Name Language Tags
        --------------------------------------------------------------------------------------
        Console Application console [C#], F# Common/Console
        Class library classlib [C#], F# Common/Library
        Unit Test Project mstest [C#], F# Test/MSTest
        xUnit Test Project xunit [C#], F# Test/xUnit
        Empty ASP.NET Core Web Application web [C#] Web/Empty
        MVC ASP.NET Core Web Application mvc [C#], F# Web/MVC
        Web API ASP.NET Core Web Application webapi [C#] Web/WebAPI
        Solution File sln Solution

        Examples:
        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:

        <Project Sdk="Microsoft.NET.Sdk">
          <PropertyGroup>
            <OutputType>Exe</OutputType>
            <TargetFramework>netcoreapp1.0</TargetFramework>
          </PropertyGroup>
          <ItemGroup>
            <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20170123-02" />
            <PackageReference Include="xunit" Version="2.2.0-beta5-build3474" />
            <PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta5-build1225" />
          </ItemGroup>
        </Project>

        That's not too bad. Here's a a library with no references:

        <Project Sdk="Microsoft.NET.Sdk">
          <PropertyGroup>
            <TargetFramework>netstandard1.4</TargetFramework>
          </PropertyGroup>
        </Project>

        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.Json
        
        Microsoft (R) Build Engine version 15.1.545.13942
        Copyright (C) Microsoft Corporation. All rights reserved.

        Writing C:\Users\scott\AppData\Local\Temp\tmpBA1D.tmp
        info : 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.json
        info : OK https://api.nuget.org/v3-flatcontainer/newtonsoft.json/index.json 1209ms
        info : GET https://api.nuget.org/v3-flatcontainer/newtonsoft.json/9.0.1/newtonsoft.json.9.0.1.nupkg
        info : OK https://api.nuget.org/v3-flatcontainer/newtonsoft.json/9.0.1/newtonsoft.json.9.0.1.nupkg 181ms
        info : Package 'Newtonsoft.Json' is compatible with all the specified frameworks in project 'C:\Users\scott\Desktop\poop\lib\lib.csproj'.
        info : PackageReference for package 'Newtonsoft.Json' version '9.0.1' added to file 'C:\Users\scott\Desktop\poop\lib\lib.csproj'.

        Doing "dotnet add package foo.bar" automatically gets the package from NuGet and adds it to your csproj. Just like doing "Add NuGet Package" (or add reference) in Visual Studio. You don't even have to open or look at your csproj.

        I'm going to keep digging into this. We're getting into a nice place where someone could easily make a custom template then "nuget in" that templates then "File | New | Your Company's Template" without needed yeoman, etc.

        Please shared your feedback:

        Also, be sure to check out the new and growing Docs site at https://docs.microsoft.com/en-us/dotnet


        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.
             

        How to make an offline installer for VS2017

        $
        0
        0

        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 great 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.

        Give us a minute, we'll be done soon...

        If you have trouble or nothing happens, check the dd_bootstrapper*.log file in %TEMP%.

        DOS prompt downloading Visual Studio

        When it's all done you'll end up with a folder like this that you can copy to a DVD or USB key.

        The result of the VS offline Layout generator

        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.
             

        dotnet new angular and dotnet new react

        $
        0
        0

        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!

        image

        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: 4228198f0e

        Runtime 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/Console
        Class library classlib [C#], F# Common/Library
        Unit Test Project mstest [C#], F# Test/MSTest
        xUnit Test Project xunit [C#], F# Test/xUnit
        Empty ASP.NET Core Web Application web [C#] Web/Empty
        MVC ASP.NET Core Web Application mvc [C#], F# Web/MVC
        MVC ASP.NET Core with Angular angular [C#] Web/MVC/SPA
        MVC ASP.NET Core with Aurelia aurelia [C#] Web/MVC/SPA
        MVC ASP.NET Core with Knockout.js knockout [C#] Web/MVC/SPA
        MVC ASP.NET Core with React.js react [C#] Web/MVC/SPA
        MVC ASP.NET Core with React.js and Redux reactredux [C#] Web/MVC/SPA
        Web API ASP.NET Core Web Application webapi [C#] Web/WebAPI
        Solution 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.
             

        Three FREE Training Courses on ASP.NET Core from Microsoft Virtual Academy

        $
        0
        0

        This time last year we did a Microsoft Virtual Academy class on what was then called "ASP.NET 5." It made sense to call it 5 since 5 > 4.6, right? But since then ASP.NET 5 has become .NET Core 1.0 and ASP.NET Core 1.0. It's 1.0 because it's smaller, newer, and different. As the .NET "full" framework marches on, on Windows, .NET Core is cross-platform and for the cloud.

        Command line concepts like dnx, dnu, and dnvm have been unified into a single "dotnet" driver. You can download .NET Core at http://dot.net and along with http://code.visualstudio.com you can get a web site up and running in 10 minutes on Windows, Mac, or many flavors of Linux.

        So, we've decided to update and refresh our Microsoft Virtual Academy. In fact, we've done three days of training. Introduction, Intermediate, and Cross-Platform and all three days are now available! We just released training for ASP.NET Core 1.0 Cross-Platform that shows Mac, Ubuntu, and Docker!

        Head over to Microsoft Virtual Academy and watch our new, free "Introduction to ASP.NET Core 1.0." It's a great relaxed pace if you've been out of the game for a bit, or you're a seasoned .NET "Full" developer who has avoided learning .NET Core thus far. If you don't know the C# language yet, check out our online C# tutorial first, then watch the video.

        Introduction to ASP.NET Core 1.0

        Join experts Scott Hanselman and Maria Naggaga, and find out how to build .NET Core applications on any operating system. Bring your web development expertise and roll up your sleeves, for this first in a three-part series.

        image

        Intermediate ASP.NET Core 1.0

        Want a deeper dive into ASP.NET Core 1.0? Build on what you learned in Introduction to ASP.NET Core 1.0, and explore this new technology even further, as Scott Hanselman, Jeff Fritz, and Rowan Miller offer an in-depth, intermediate-level look at ASP.NET Core 1.0.

        Intermediate ASP.NET Core 1.0

        ASP.NET Core 1.0 Cross-Platform

        Ready to build and deploy ASP.NET Core 1.0 apps? Join experts Scott Hanselman, Maria Naggaga, and Glenn Condron, and see how to do just that using Mac and Linux. Revisit content from the Introduction to ASP.NET Core 1.0 course, but using a Mac and Linux.

        image

        Do us a favor when you watch these, rate them (5 stars!) and SHARE them on your social networks.

        NOTE: There's a LOT of quality free courseware for learning .NET Core and ASP.NET Core. We've put the best at http://asp.net/free-courses and I encourage you to check them out!

        Hope you have as much fun with these courses as we had creating them!


        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 out their latest 3.4 release



        © 2016 Scott Hanselman. All rights reserved.
             

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

        $
        0
        0

        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.

        Global.json is useful

        This is assuming that you do have multiple versions (and the ones you want) installed:

        Here I have 4 SDKs installed and I can see them in my installation folder

        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 new
        
        Created 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\csprojstuff

        01/23/2017 01:09 PM <DIR> .
        01/23/2017 01:09 PM <DIR> ..
        12/07/2016 09:49 PM 422 csprojstuff.csproj
        12/07/2016 09:49 PM 133 Program.cs
        2 File(s) 555 bytes
        2 Dir(s) 149,845,356,544 bytes free

        C:\Users\scott\Desktop\csprojstuff> cd ..\projjsonstuff

        C:\Users\scott\Desktop\projjsonstuff> dotnet new
        Created 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\projjsonstuff

        01/23/2017 01:10 PM <DIR> .
        01/23/2017 01:10 PM <DIR> ..
        01/23/2017 01:05 PM 95 global.json
        06/21/2016 07:10 PM 214 Program.cs
        06/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 migrate
        
        No executable found matching command "dotnet-migrate"

        C:\Users\scott\Desktop\projjsonstuff> del global.json

        C:\Users\scott\Desktop\projjsonstuff> dotnet migrate
        Project projjsonstuff migration succeeded (C:\Users\scott\Desktop\projjsonstuff)
        Summary
        Total Projects: 1
        Succeeded Projects: 1
        Failed Projects: 0


        C:\Users\scott\Desktop\projjsonstuff> dir
        Volume in drive C is Windows
        Volume Serial Number is 00C1-AED2

        Directory of C:\Users\scott\Desktop\projjsonstuff

        01/23/2017 01:11 PM <DIR> .
        01/23/2017 01:11 PM <DIR> ..
        01/23/2017 01:11 PM <DIR> backup
        06/21/2016 07:10 PM 214 Program.cs
        01/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 out their latest 3.4 release


        © 2016 Scott Hanselman. All rights reserved.
             

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

        $
        0
        0

        Nice to meet you! says my MiiYes, 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.

        Photo Jan 24, 9 59 42 PM

        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.
             

        VIDEO: How to get started with technical public speaking!

        $
        0
        0

        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.

        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.
             

        NXTA - NexTech Africa Conference - Day 1 perspectives

        $
        0
        0

        imageI'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.

        image

        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.

        image

        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.
             

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

        $
        0
        0

        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.

        New Templating Engine for .NET Core CLI

        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 new
        
        Template 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 templates


        Templates Short Name Language Tags
        --------------------------------------------------------------------------------------
        Console Application console [C#], F# Common/Console
        Class library classlib [C#], F# Common/Library
        Unit Test Project mstest [C#], F# Test/MSTest
        xUnit Test Project xunit [C#], F# Test/xUnit
        Empty ASP.NET Core Web Application web [C#] Web/Empty
        MVC ASP.NET Core Web Application mvc [C#], F# Web/MVC
        Web API ASP.NET Core Web Application webapi [C#] Web/WebAPI
        Solution File sln Solution

        Examples:
        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:

        <Project Sdk="Microsoft.NET.Sdk">
          <PropertyGroup>
            <OutputType>Exe</OutputType>
            <TargetFramework>netcoreapp1.0</TargetFramework>
          </PropertyGroup>
          <ItemGroup>
            <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20170123-02" />
            <PackageReference Include="xunit" Version="2.2.0-beta5-build3474" />
            <PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta5-build1225" />
          </ItemGroup>
        </Project>

        That's not too bad. Here's a a library with no references:

        <Project Sdk="Microsoft.NET.Sdk">
          <PropertyGroup>
            <TargetFramework>netstandard1.4</TargetFramework>
          </PropertyGroup>
        </Project>

        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.Json
        
        Microsoft (R) Build Engine version 15.1.545.13942
        Copyright (C) Microsoft Corporation. All rights reserved.

        Writing C:\Users\scott\AppData\Local\Temp\tmpBA1D.tmp
        info : 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.json
        info : OK https://api.nuget.org/v3-flatcontainer/newtonsoft.json/index.json 1209ms
        info : GET https://api.nuget.org/v3-flatcontainer/newtonsoft.json/9.0.1/newtonsoft.json.9.0.1.nupkg
        info : OK https://api.nuget.org/v3-flatcontainer/newtonsoft.json/9.0.1/newtonsoft.json.9.0.1.nupkg 181ms
        info : Package 'Newtonsoft.Json' is compatible with all the specified frameworks in project 'C:\Users\scott\Desktop\poop\lib\lib.csproj'.
        info : PackageReference for package 'Newtonsoft.Json' version '9.0.1' added to file 'C:\Users\scott\Desktop\poop\lib\lib.csproj'.

        Doing "dotnet add package foo.bar" automatically gets the package from NuGet and adds it to your csproj. Just like doing "Add NuGet Package" (or add reference) in Visual Studio. You don't even have to open or look at your csproj.

        I'm going to keep digging into this. We're getting into a nice place where someone could easily make a custom template then "nuget in" that templates then "File | New | Your Company's Template" without needed yeoman, etc.

        Please shared your feedback:

        Also, be sure to check out the new and growing Docs site at https://docs.microsoft.com/en-us/dotnet


        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.
             

        How to make an offline installer for VS2017

        $
        0
        0

        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.

        Give us a minute, we'll be done soon...

        If you have trouble or nothing happens, check the dd_bootstrapper*.log file in %TEMP%.

        DOS prompt downloading Visual Studio

        When it's all done you'll end up with a folder like this that you can copy to a DVD or USB key.

        The result of the VS offline Layout generator

        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.
             

        dotnet new angular and dotnet new react

        $
        0
        0

        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!

        image

        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: 4228198f0e

        Runtime 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/Console
        Class library classlib [C#], F# Common/Library
        Unit Test Project mstest [C#], F# Test/MSTest
        xUnit Test Project xunit [C#], F# Test/xUnit
        Empty ASP.NET Core Web Application web [C#] Web/Empty
        MVC ASP.NET Core Web Application mvc [C#], F# Web/MVC
        MVC ASP.NET Core with Angular angular [C#] Web/MVC/SPA
        MVC ASP.NET Core with Aurelia aurelia [C#] Web/MVC/SPA
        MVC ASP.NET Core with Knockout.js knockout [C#] Web/MVC/SPA
        MVC ASP.NET Core with React.js react [C#] Web/MVC/SPA
        MVC ASP.NET Core with React.js and Redux reactredux [C#] Web/MVC/SPA
        Web API ASP.NET Core Web Application webapi [C#] Web/WebAPI
        Solution 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.
             

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

        $
        0
        0

        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.

        Why is that web app using so much CPU?

        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.

        Running 20 apps in a Single Azure App Service

        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).

        Metrics per Instance - App Service Plan

        I click here and see "Sites in App Service Plan."

        20 sites in a single plan

        I can see that over the last few days my CPU has been going up and up...

        The CPU is going up and up over a few days

        I can see by site:

        A graph showing ALL 20 sites and their CPU

        So now I can filter by site and I see that it's ONE site that's going nuts.

        One site is using all the CPU

        I can then dig in, go to the main CPU charge and see exactly when it started:

        The site is using 2.12 days of CPU

        I can change the scale

        It started on Feb 11th

        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 it's calming down

        Now if I check the App Service Plan itself, I can see everything has calmed down.

        Things have calmed down after the one rogue site was restarted

        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.
             
        Viewing all 1148 articles
        Browse latest View live