Scott Hanselman

Visual Studio and IIS Error: Specified argument was out of the range of valid values. Parameter name: site

June 3, '17 Comments [6] Posted in Bugs | IIS
Sponsored By

I got a very obscure and obtuse error running an ASP.NET application under Visual Studio and IIS Express recently. I'm running a Windows 10 Insiders (Fast Ring) build, so it's likely an issue with that, but since I was able to resolve the issue simply, I figured I'd blog it for google posterity .

I would run the ASP.NET app from within Visual Studio and get this totally useless error. It was happening VERY early in the bootstrapping process and NOT in my application. It pretty clearly is happening somewhere in the depths of IIS Express, perhaps in a configurator in HttpRuntime.

Specified argument was out of the range of valid values.
Parameter name: site

I fixed it by going to Windows Features and installing "IIS Hostable Web Core," part of Internet Information Services. I did this in an attempt to "fix whatever's wrong with IIS Express."

Turn Windows Features on or off

That seems to "repair" IIS Express. I'll update this post if I learn more, but hopefully if you got to this post, this fixed it for you also.


Sponsor: Check out JetBrains Rider: a new cross-platform .NET IDE. Edit, refactor, test, build and debug ASP.NET, .NET Framework, .NET Core, or Unity applications. Learn more and get access to early builds!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Choice amongst cross-platform .NET IDEs - VS Code, Visual Studio for Mac, JetBrains Rider

May 31, '17 Comments [20] Posted in DotNetCore
Sponsored By

A few years back, .NET development on a Mac was resigned to Mono and whatever text editor you knew how to exit successfully. Xamarin Studio came out in 2013 as a standalone IDE for mobile app development, but wasn't a generalized or web development IDE. Later the OmniSharp OSS project came along and added intellisense to a half-dozen editors with its smart out of process intellisense server but these code editors with .NET specific features, not strictly IDEs.

Side Note: I've been writing this blog post on and off for a while. Coincidentally JetBrains Rider is sponsoring my blog this week. It's a coincidence, but I want to be transparent about it as I don't do sponsored/directed blog posts - rather, folks sponsor a calendar week.

Fast forward a bit and we've got some choices amongst cross-platform .NET development on non-Windows platforms.

Visual Studio Code

First, there's Visual Studio Code (more of a code editor, but with a TON of plugins and extensions) that is a very competent editor for .NET on Mac or Linux. It's also one of the best node.js editors/debuggers anywhere - nice if you're working on multi-language projects.

Visual Studio Code

If you look in the lower-right corner there in Visual Studio Code you can see the OmniSharp flame logo in the corner, helping power the C# Extension for Visual Studio Code. For ASP.NET Core web developers, VS Code is pretty good, although its lack of support for Razor Views/Pages remains a hole. You don't get intellisense for your C# when you open a code block like @{ } in a Razor View. That said, there are a bunch of extensions that add snippets for dozens (hundreds?) of languages, syntax highlighting for basically everything, and it's all built on an open source base of TypeScript. VS Code supports git natively as well.

JetBrains Rider

Currently in "EAP," that's  Early Access Program/Preview, or beta for the rest of us, JetBrains Rider runs on Windows, Mac, and Linux and lets you manage and build .NET Framework, Mono, and .NET Core solutions. Rider supports C#, VB.NET, ASP.NET syntax, XAML, XML, JavaScript, TypeScript, JSON, HTML, CSS, and SQL within its text editor.

Rider has the smart editor and the 50+ refactorings that fans of ReSharper will appreciate, with lots of choice amongst key-binding. You can tell Rider if you prefer ReSharper, VS, Eclipse, or NetBeans key bindings. It does a ton of custom code analysis and can refactor and analyze your code while you type. It's also got a built in decompiler for exploring libraries you don't have the source for.

Rider also supports Git, Subversion, Mercurial, Perforce and TFVC out of the box and can add more source systems via plugins.

JetBrains Rider

Visual Studio for Mac

VS for Mac is new and while it started as Xamarin Studio, there's been a ton of additions to it according to Miguel de Icaza. In the feature, VS for Mac will share the exact same core editor code that Visual Studio for Windows uses for its text editors like HTML, Razor, CSS and more. One of the things I like the most about Visual Studio for Mac is that it looks like Visual Studio...FOR MAC. By that I mean it doesn't look like Visual Studio on Windows copy-pasted onto the Mac. It has a Mac UI, Mac Icons, a Mac look and feel. Much like Office for Mac, it's a native app that smells native because it is.

Visual Studio for Mac

The release of VS for Mac includes support for ASP.NET Core and .NET Core. Like all these IDEs and editors, it shares csproj and sln files cleanly with Visual Studio for Windows. That means that you can easily share projects and code with some folks on Mac and some on Windows.

Visual Studio for Mac is best when used for these scenarios:

  • Mobile development with Xamarin
  • Cloud development with .NET Core and ASP.NET Core, and publishing to Azure
  • Web development with ASP.NET Core and web editor tooling

For example, when you make a new Mobile app in C#, you can get an ASP.NET Core backend along with it. Then you can easily publish the backend to Azure at the same time you push your app onto Android or iPhone.

Finally, one of the coolest features for mobile developers on Visual Studio for Mac (and Windows) is the "Xamarin Live Player." This allows you to pair your instance of Visual Studio with your development phone and do continuous development and testing. As you make changes in Visual Studio, the changes are immediately visible in the Live Player - no need to redeploy. That feature is in preview as of the time of this writing.

If you're developing but you're not on Windows, there's never been a better time to develop cross-platform with .NET Core. Check out each of these:

Have you tried these out? What have you found?


Sponsor: Check out JetBrains Rider: a new cross-platform .NET IDE. Edit, refactor, test, build and debug ASP.NET, .NET Framework, .NET Core, or Unity applications. Learn more and get access to early builds!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Exploring the preconfigured browser-based Linux Cloud Shell built into the Azure Portal

May 22, '17 Comments [4] Posted in Azure
Sponsored By

At BUILD a few weeks ago I did a demo of the Azure Cloud Shell, now in preview. It's pretty fab and it's built into the Azure Portal and lives in your browser. You don't have to do anything, it's just there whenever you need it. I'm trying to convince them to enable "Quake Mode" so it would pop-up when you click ~ but they never listen to me. ;)

Animated Gif of the Azure Cloud Shell

Click the >_ shell icon in the top toolbar at http://portal.azure.com. The very first time you launch the Azure Cloud Shell it will ask you where it wants your $home directory files to be persisted. They will live in your own Storage Account. Don't worry about cost, remember that Azure Storage is like pennies a gig, so assuming you're storing script files, figure it's thousandths of pennies - a non-issue.

Where do you want your account files persisted to?

It's pretty genius how it works, actually. Since you can setup an Azure Storage Account as a regular File Share (sharing to Mac, Linux, or Windows) it will just make a file share and mount it. The data you save in the ~/clouddrive is persistent between sessions, the sessions themselves disappear if you don't use them.

Now my Azure Cloud Shell Files are available anywhere

Today it's got bash inside a real container. Here's what lsb_release -a says:

scott@Azure:~/clouddrive$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.1 LTS
Release:        16.04
Codename:       xenial

Looks like Ubuntu xenial inside a container, all managed by an orchestrator within Azure Container Services. The shell is using xterm.js to make it all possible inside the browser. That means you can run vim, top, whatever makes you happy. Cloud shells include vim, emacs, npm, make, maven, pip, as well as docker, kubectl, sqlcmd, postgres, mysql, iPython, and even .NET Core's command line SDK.

NOTE: Ctrl-v and Ctrl-c do not function as copy/paste on Windows machines [in the Portal using xterm.js], please us Ctrl-insert and Shift-insert to copy/paste. Right-click copy paste options are also available, however this is subject to browser-specific clipboard access

When you're in there, of course the best part is that you can ssh into your Linux VMs. They say PowerShell is coming soon to the Cloud Shell so you'll be able to remote Powershell in to Windows boxes, I assume.

The Cloud Shell has the Azure CLI (command line interface) built in and pre-configured and logged in. So I can hit the shell then (for example) get a list of my web apps, and restart one. Here I'm getting the names of my sites and their resource groups, then restarting my son's hamster blog.

scott@Azure:~/clouddrive$ az webapp list -o table
ResourceGroup               Location          State    DefaultHostName                             AppServicePlan     Name
--------------------------  ----------------  -------  ------------------------------------------  -----------------  ------------------------
Default-Web-WestUS          West US           Running  thisdeveloperslife.azurewebsites.net        DefaultServerFarm  thisdeveloperslife
Default-Web-WestUS          West US           Running  hanselmanlyncrelay.azurewebsites.net        DefaultServerFarm  hanselmanlyncrelay
Default-Web-WestUS          West US           Running  myhamsterblog.azurewebsites.net             DefaultServerFarm  myhamsterblog

scott@Azure:~/clouddrive$ az webapp restart -n myhamsterblog -g "Default-Web-WestUS"

Pretty cool. I'm going to keep exploring, but I like the way the Azure Portal is going from a GUI and DevOps dashboard perspective, but it's also nice to have a CLI preconfigured whenever I need it.


Sponsor: Did you know VSTS can integrate closely with Octopus Deploy? Watch Damian Brady and Brian A. Randell as they show you how to automate deployments from VSTS to Octopus Deploy, and demo the new VSTS Octopus Deploy dashboard widget. Watch now!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Suggestions and Tips for attending your first tech conference

May 17, '17 Comments [13] Posted in Musings | Open Source
Sponsored By
WoC Tech Chat used under CC

This last week Joseph Phillips tweeted that he was going to his first big tech conference and wanted some tips and suggestions. I have a TON of tips, but I know YOU have more, so I retweeted his request and prompted folks to reply. This was well timed as I had just gotten back from OSCON and BUILD, two great conferences.

The resulting thread was fantastic, so I've pulled some of the best recommendations out. As per usual, the Community has some great ideas and you should check them out!

  • @saraford - Whenever you get a biz card write down why you met them or what convo was about. It might seem obvious at time but you wont remember at home
  • @arcdigg - Meet people and speakers. Tech is part of your success, but growing your network matters too. Conf can give you both or not. Up to you!
  • @marypcbuk - if approaching people is hard for you, just ask 'what do you work on?'
  • @ohhoe - don't be afraid to introduce yrself to people! let them know its yr first conference, often people will introduce you to other people too :)
  • @IrishSQL - connect with a few attendees/speakers online prior to event, and bring plenty of business cards. When u get one, write details on back
  • @arcdigg - Backpack and sneakers beat cute laptop bag and heels (ed: dress comfortably)
  • @scribblingon - You might feel left out & think everyone knows everyone else. Don't be afraid to approach people & talk even if seems random sometimes :) If you liked someone's talk, strike a convo & tell them that!!
  • @arcdigg - Plan session attendance in advance, have a backup in case the session is full.
  • @jesslynnrose - Reach out to some other folks who are using the hashtag before you get there, events can be cliquey, say hi and make friends before you go!
  • @thelarkinn - Never feel afraid to say hi to maintainers, and speakers!!!! Especially if you want to help!
  • @everettharper - Pick 3 ppl you want to meet. Prep 1 Q for each. Go early, find person #1 in the 1st hr before crowds. 1/3 done = momentum for rest of day!
  • @jorriss - Meet people. Skip sessions. You'll get more from meeting and talking with people then sitting in the sessions. #hallwaytrack
  • @stabbycutyou - Leave room in your schedule, Meet people, Eavesdrop on hallway convos, Take notes, Present on them at your job
  • @patrickfoley - Don't forget to sleep. Evidence that long-term memories get "written" then
  • @david_t_macknet - Drinking will not help you remember it better or have a better time mingling. Most of us are just as introverted & the awkwardness fades.
  • @carlowahlstedt - Don't feel like you have to go to EVERY session.
  • @davidpine7 - Try your best to NOT be an introvert -- in our industry that can be challenging, but if you put yourself out there...you will not regret it!
  • @frontvu - Don't rely on the conference wifi
  • @shepherddad - Put snacks in your bag or pocket.
  • @sod1102 - Find out if there will be slides (and even better!) video available post conference, then don't worry about missing stuff and relax & enjoy
  • @rnelson0 - Take notes. Live tweet, carry a notebook, jot it all down at 1am before sleeping, whatever method helps you remember what you did.
  • @hoyto - Sit [at] meal tables with random people and introduce yourself.
  • @_s_hari - Ask speaker when *not* to use product/methodology that they're speaking on. If they cannot explain that, then it's just a marketing session
  • @EricFishor - Don't be afraid to discreetly leave or enter an on going session. It's up to you to seek out sessions that interest you.
  • @texmandie - If you get to meet and talk to your heroes, don't freak out - they're normal people who happen to do cool stuff
  • @wilbers_ke - Greatest connections happen in the hallways, coffee queue and places with animated humans. Minimize seated conference halls
  • @CJohnsonO365 - CLEAR YOUR SCHEDULE. Don’t try to get “regular” work done during the conference— you’ll end up missing something important!
  • @g33konaut - Tweet with the conf hashtag to ask if people wanna meet and talk or hangout after the conference, also follow the hashtag tweets to find ppl. Don't sweat missing a talk, meeting people and talking to them is always better than than seeing a talk. Also the talks are often recorded
  • @foxdeploy - Who cares about swag, it's all about connections. Meet the people who've helped you over the years and say thanks.
  • @jfletch - Ask people which after parties they are attending. Great way to find out about smaller/more interesting events and get yourself invited!
  • @marxculture - The Law of Two Feet - if you aren't enjoying a session then leave. Go to at least one thing outside your normal sphere.
  • @joshkodroff - Bring work business cards if you're not looking for a job, personal business cards if you are.
  • @benjimawoo - Go to sessions that cover tehnologies you wouldn't otherwise encounter day to day. Techs you don't use in your day job.

Fantastic stuff. You'll get more out of a conference if you say hello, include the "hallway track" in your planning, stay off your phone and laptop, and check out sessions and tech you don't usually work on.

What are YOUR suggestions? Sound off in the comments.


Sponsor: Did you know VSTS can integrate closely with Octopus Deploy? Watch Damian Brady and Brian A. Randell as they show you how to automate deployments from VSTS to Octopus Deploy, and demo the new VSTS Octopus Deploy dashboard widget. Watch now!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

BUILD 2017 Conference Rollup for .NET Developers

May 15, '17 Comments [8] Posted in DotNetCore
Sponsored By

The BUILD Conference was lovely this last week, as was OSCON. I was fortunate to be at both. You can watch all the interviews and training sessions from BUILD 2017 on Channel 9.

Here's a few sessions that you might be interested in.

Scott Hunter, Kasey Uhlenhuth, and I had a session on .NET Standard 2.0 and how it fit into a world of .NET Core, .NET (Full) Framework, and Mono/Xamarin.

One of the best demos, IMHO, in this talk, was taking an older .NET 4.x WinForms app, updating it to .NET 4.7 and automatically getting HiDPI support. Then we moved it's DataSet-driven XML Database layer into a shared class library that targeted .NET Standard. Then we made a new ASP.NET Core 2.0 application that shared that new .NET Standard 2.0 library with the existing WinForms app. It's a very clear example of the goal of .NET Standard.

.NET Core 2.0 Video

Then, Daniel Roth and I talked about ASP.NET Core 2.0

ASP.NET Core 2.0 Video

Maria Naggaga talked about Support for ASP.NET Core. What's "LTS?" How do you balance purchased software that's supported and open source software that's supported?

Support for ASP.NET and .NET - What's an LTS?

Mads Torgersen and Dustin Campbell teamed up to talk about the Future of C#!

The Future of C#

David Fowler and Damian Edwards introduced ASP.NET Core SignalR!

SignalR for .NET Core

There's also a TON of great 10-15 min short BUILD videos like:

As for announcements, check these out:

And best of all...All .NET Core 2.0 and .NET Standard 2.0 APIs are now on http://docs.microsoft.com at https://docs.microsoft.com/en-us/dotnet

Enjoy!


Sponsor: Test your application against full-sized database copies. SQL Clone allows you to create database copies in seconds using MB of storage. Create clones instantly and test your application as you develop.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.