Scott Hanselman

Extending the Visual Studio 11 Web Browser Chooser and Browse With Menu to include Developer Profiles

March 22, 2012 Comment on this post [18] Posted in ASP.NET | ASP.NET MVC
Sponsored By

I talked about some new features that have snuck made their way into the free version of Visual Studio for Web. One of the more useful ones is the Browser Chooser that allows you to quickly launch debug sessions with different browsers from within VS. I've actually been pushing on this for about 18 months, and even blogged about it in August of 2010 in "how to change the default browser in Visual Studio programmatically with PowerShell and possibly poke yourself in the eye."

In Visual Studio 11 Beta you get a nice dropdown with all the browsers (plus the new Page Inspector).

Browser Switcher built into the toolbar

However, I got a good comment from blog reader Abhijit who said:

The browser is a welcome addition (though past versions of VS do something similar). I'd like to make one suggestion though.
I use multiple Firefox and Google Chrome profiles. One for regular browsing and another for web development/debugging.
For ex: To launch a profile named 'dev' in Firefox, you'd use
firefox -p dev --no-remote in the shortcut/command line
This ensures that I don't mess up my history/profile/cookies etc with my development activities. However, the feature you've described launches the browser with no command line parameters.
So, is there a way I can add/update/customize the parameters used to launch the different browsers? And if not, is too late to suggest this as a feature request for VS11?

This is a not only a great tip, but a very useful bug/feature request. The tip is to use different profiles for when developing so you aren't accidentally combining your history and cookies for development with your personal stuff.

The feature is interesting because he wants to know how to customize the Browser Chooser. Digging into it, it turns out that it's totally possible but totally not discoverable. That means there's an opportunity to make this feature WAY WAY more useful.

First, here's the way to change it today on the Beta. Then I'll suggest a possible change to the feature to make it easier.

That list is initially auto-populated with the browsers we find on your system. You can add to the list with the "Browse With..." menu that you get when you right click on an .ASPX file in Visual Studio. Ah! But there's where the trouble starts. You can currently only see that menu when you right click on an ASPX page. This is great for Web Forms folks, but if you don't have an .ASPX file in your project then you're out of luck.

So, for now, add an ASPX file (you can delete it later) and right click:

Browse With is only visible when right-clicking on an ASPX file

That brings you to the list of browsers in the Browse With dialog:

All your browsers listed in the Browse With dialog

At this point you can add your dev profile browser. (It would be nice if you could edit also, but you can't today.) Here I'm adding Firefox with a "dev" profile. Note that I'm naming it differently from existing browsers.

Adding a Firefox Dev Profile with "firefox.exe -p dev"

Here's my updated Browse With using the new Firefox dev profile. You could do with this Chrome also if you like.

Browse With showing my new Firefox Dev Profile

Now my browser chooser menu in the toolbar is updated with the my new browser. You can put whatever you like in that menu.

Menu in VS dropped down showing my new Firefox Dev Profile

Ok that's today with the Visual Studio 11 Beta. Here's a Paint.NET proposal of what I'd like to see. It'd be nice for the "Browse With..." to appear inline in the drop down menu. Having in the Right Click menu is too confusing.

MOCKUP - Browse With Proposal with added menu - photoshop

This is just a Paint.NET but you get the idea. Thoughts?

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Features NO ONE NOTICED in Visual Studio 11 Express Beta for Web

March 20, 2012 Comment on this post [57] Posted in ASP.NET | ASP.NET MVC
Sponsored By

There's a bunch of new stuff in Visual Studio 11 Express for Web that I suspect not everyone noticed. Remember that Express is our free version of Visual Studio. Sometimes I hear folks complain that Express isn't advanced enough, even though its free.

Unit Testing is Built-into Visual Studio Express

For example, no one noticed that Unit Testing is in Express. You can add a Unit Test to an existing Web Solution. I'll add a Unit Test Project, the right click on References and add a reference to System.Web.Mvc to my ASP.NET MVC Application.

Note the new Add Reference dialog? It's got a search box, it's multi-threaded, and I can add multiple references by checkbox. That's new stuff, friends. Subtle, but it is one of those "death by a thousand tiny cuts" things that the team is trying to fix.

Reference Manager

I can setup a bunch of tests for my ASP.NET MVC application and run them by right clicking "Run Tests."

Unit Test Explorer in Express

Browser Chooser/Launcher in the Toolbar

When you hit F5 or Ctrl-F5 to check out or debug your website you often want to try it in different browsers. You can easily switch between browsers now, directly:

Browser Switcher built into the toolbar

Image Thumbnails on Hover in the Solution Explorer

If you hover over an image in the Solution Explorer you'll see a preview thumbnail of that image.

Hover preview

CSS Color Picker built-in

Not only does the new CSS editor support lots of snippets like @media as well as outlining and vendor-specific prefixes, it also has a lovely color picture that is smart about your color scheme. Hint: select a color in a CSS file and press Ctrl-J.

CSS Color Picker

Quick Launch

You know how you're always going Tools | Options | Text Editor | Languages | JavaScript | References, blah blah blah? Now just press Ctrl-Q and type "references" (or whatever), and go right to it. Don't remember how to get there, just go there.

Quick Launch

Smarter JavaScript references

If you do make it into the JavaScript references dialog, check out the relative references.js file. You can put in your global-scoped JS files with documentation and get nice JavaScript intellisense WITH documentation...

JavaScript References

...that looks like this. That's lovely jQuery documentation, as you type.

Great JavaScript Intellisense

Page Inspector

Sometimes when you get partial views inside master pages with editor templates and other nested things in a large application it can be hard to figure out the answer to something simple like "what line of code made THAT line of HTML?" There's a new feature built into Visual Studio Express for Web called "Page Inspector."

It's hard to explain, so here's an animation. You hover over an item in the browser and it shows you what line of code make that HTML. You can also do live CSS editing.

Round Tripping

You know how you never want to install a new version of Visual Studio because you're afraid it will upgrade your existing project files and mess up the whole team? Round Tripping works now between Visual Studio 2010 SP1 and Visual Studio 11. Here's the same .NET 4 application opened in the VS11Beta and in VS2010SP1. Oh, and by the way, don't sweat the color thing, I'm confident it will turn out OK.

VS2010 and Dev11 living together and no one is freaking out

Note the dropdown in VS11 Beta. I can develop any .NET app from .NET 2 (!) and up with the one IDE. I'm using the beta as my main IDE currently.

IIS Express

IIS Express is now the default website host inside of the older "ASP.NET Development Server." That means you can test on a real IIS without being Admin. It runs when you run your app, then it goes away. Things that works in IIS Express should work the same way in IIS because it's the same core web server. As my friend Damian showed me, I can even test under SSL with just a doubleclick:

SSL Enabled = True

The Big Secret Thing No One Noticed

I'm surprised no one has figured this one out yet, but I'll post on it a little more as I start to share more of the "One ASP.NET" plan. Check out Tools | Extensions. See those template packages? ASP.NET templates (those are the File | New things) are actually extensions...VSIXs, in fact. We can update them as we like now. ASP.NET can do interesting and innovative things (and NuGet plays a part in this) without waiting for a new version of Visual Studio. Starting to see why that'd be useful?

ASP.NET Templates are extensions now

That's just the stuff I can think of off the top of my head. Point is, better free tools and more open source continues to be the goal with our team. There's lots more details and videos up at http://www.asp.net/vnext. You can get Visual Studio 11 Express for Web here. Let me know if you find any good bugs and I'll get them straight to the team, or better yet, put feedback on our UserVoice site.

Related Links


Sponsor: My thanks to DevExpress for sponsoring this week's feed. There is no better time to discover DevExpress. Visual Studio 11 beta is here and DevExpress tools are ready! Experience next generation tools, today.

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Getting a new iPhone or iPad? Don't forget to enter your password 7 times!

March 17, 2012 Comment on this post [19] Posted in Apple
Sponsored By

I like it when companies have a single login. I've got a single Windows Live ID, a single Apple ID and a single Google login. For the most part, that along with my hanselman.com OpenID unlocks 90% of the Internet for me. What I don't like is entering these single IDs more than once on the same device. I was restoring an iPad from its backup just now and since passwords aren't stored in backups, I needed to re-enter mine. I entered my work and home email passwords, which makes sense. Then, rather than entering my Apple ID once in friendly Settings applet called "Enter your Apple ID only once here and I'll handle the rest," or even better, being prompted to enter my Apple ID when I started the device for the first time, again just once, instead I proceeded to have to enter the same Apple ID and password at least seven times.

Let's review, shall we? First, in the Store that manages your ID for applications and automatic downloads.*

Store

Next in Video for Home Sharing...

Video

But also Music for Home Sharing...

Music

Then Game Center, which still looks totally ridiculous and out of place.

Game Center

Don't forget iMessage and also click Receive At to make sure all your emails are listed. But, you can't use your phone number here, so good luck getting iMessages to sync across devices.

iMessage

Also add FaceTime which is not iMessage. No one ever FaceTimes you but, they might, so, be ready.

FaceTime

Don't forget iCloud. Remember also that Find My iPad in here is NOT the same Find My Whatever from MobileMe, and that's maybe not the same ID and password.

iCloud

I love the hardware, the design and the devices, but man, Single Sign On anyone? Did I miss any?

* Ya, I know, two iOS posts in a row. Sue me. Or, better yet, just Mark as Read and we'll talk tomorrow, OK?

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

iPhone tethering personal hotspot shows up a as a new network each time (plus the smart quote is silly)

March 17, 2012 Comment on this post [25] Posted in Musings
Sponsored By

I often use my iPhone as a Personal Hotspot. I'm not sure what's changed in iOS5 but one problem still exists and the other has gotten worse. First, the 802.11 wireless specification doesn't say anything about the character encoding of the SSID (Service Set Identifier - the think that names your access point). Most APs and Operating Systems assume that the string will be straight ASCII and code page 1252. However, Apple iOS devices default to yourname's iPhone where the quote ' is a smart quote like this ’, so Scott’s iPhone. Just as I mentioned in my post on "Why the #AskObama Tweet was Garbled on Screen: Know your UTF-8, Unicode, ASCII and ANSI Decoding Mr. President" even smart folks can mess this up. Since the iPhone is assuming that the encoding is UTF-8 while the rest of folks are assuming ASCII, we end up with "Scott’s iPhone."

Scott's iPhone is trying to use Smart Quotes, and failing

It's harmless, but it's irritating. I've filed a feature request with Windows (it's not a bug per se, but rather what appears to be an ambiguous spec that makes everyone look bad, IMHO).

If if bugs you too, you can Right Click on the network icon near your click and "open Network and Sharing Center" then click on the ICON that represents your network. That will get you this dialog (that you've likely never seen before because clicking on the icon isn't intuitive).

Set Network Properties Dialog

In that dialog you can change the name and the icon of the connection. Fancy.

image

If you really really want to fix it, then change the name of your phone to include a ' rather than a ’ by going to Settings | About | Name.

Changing a quote to a smart quote - before Changing a quote to a smart quote - after

However, since the iOS 5.1 update last month every time I tether my iPhone I get a new Wireless Network. I'm currently on Scott's iPhone 12 and it keeps going up. I'm not sure what changed in this update but it's clearly changed because everyone is seeing this behavior.

I like my things tidy, so I wanted to merge or delete all these superfluous networks. Remember that dialog above that we got to my clicking on the icon in Network and Sharing Center? Well, at the bottom it has another button that you've never seen before. I know I hadn't.

Merge or delete network locations

Click on Merge and you will be shocked to see the last six billion networks that you've connected to. You're very wirelessly promiscuous, aren't you?

Merge or Delete Network Locations List

From here you can select and merge together all your duplicate networks, as well as delete ones you don't want to have Windows remember.

Hope this helps! I hope that this is fixed in both iOS, the specification AND in Windows. Specification ambiguity hurts everyone.

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

On Pie Chart Diversity at Technical Conferences

March 16, 2012 Comment on this post [17] Posted in Musings
Sponsored By
A large panel of 12 apparently white men at SXSW - Photo via Jay Smooth from http://jsmooth995.lightbox.com/

This last week at the SXSW (South by Southwest) conference I appeared on a panel that discussed "What can technology conferences do about diversity?" (the audio is up at that link also)

The picture at right is NOT that panel.

I speak at or attend between 12 and 20 conferences a year. Too often panels and speakers at conferences consist only of white males between the ages of 25 and 35. This year at SXSW we hosted a frank conversation attempting to answer some questions like "what is diversity (hint, it's not just color)", "how can we make technology conferences more inclusive," and "why should we value diversity at all?"

Our panel consisted of

It was expertly moderated by Latoya Peterson, Racialicious.com. Our panel was also mentioned in an article at Salon.com, although perhaps not for the reasons we would have liked.

A number of interesting and compelling points were made during this panel.

Pie Chart Diversity in Cartoons - How did I not see this before?Anjuan brought up the issue of the "pipeline" of potential technology workers and conferences attendees. We need to continue to make sure that everyone has the opportunity to access technology and express interest in technology. This starts with making sure schools put adequate focus on STEM (Science, Technology, Engineering, and Math) programs.

Anjuan also spoke about the pressure for minorities to be stewards for their respective groups. As a white male if I'm late for a meeting that reflects poorly on me, but if Anjuan is the only black male in a meeting and is late he feels that may reflect poorly not only on him, but any prospective future hires. While it's not the same, I relate somewhat as a Type 1 diabetic on a pump. I am aware that if I am unable to travel, am sick often, or am in some way unable to do my job effectively that may reflect poorly (and has in the past in my experience) on other diabetics. This could then make the company reticent to hire folks that follow in my footsteps.

When I travel overseas and meet new people I am an American representative, and it's on me to be a good one. When I travel in the rural areas of Zimbabwe I want to leave a good impression of white Americans. We are all stewards of our respective groups, and PoC (People of Color) certainly feel that pressure more than others.

Benneton Ad - Fair Use

I offered my perspective as the only white panelist. I feel that many people say "I don't see color," but that's like saying "I don't see you. I don't see your experience." We are the sum of our experiences, our abilities and disabilities, our languages, our color, our place of birth and a thousand other characteristics. While color is an easy categorization, so is height, weight, gender, number of extremities and a bunch of other physical characteristics.

We need to resist the temptation to move from all white panels and apply "pie-chart diversity" to our groups. Pie Chart Diversity is my term for when you have one Black man, an Asian girl, a blonde white person and a brunette, and perhaps a Latino in a arbitrary group. You see this pattern in sitcoms and cartoons time and time again. It might make for a nice Benetton ad but it doesn't make for a good tech conference.

Don't assemble colorful panels, assemble diverse panels.

Value lies in diverse perspectives, not aesthetically pleasing color swatches. An all white panel can  be a diverse panel if it includes a variety of ages, genders, languages, education levels, countries of origin and more. Don't ask yourself questions like "Why is this panel only white men" but rather ask yourself "where are qualified women and people of color for this panel?"

My point to the audience was that awareness is the key. If you are assembling a panel or conference it's OK if you are a white person to ask yourself "do we have a diverse and representative group of perspectives in this talk?" If you are participating in a talk, it's OK to ask the organizers or suggest friends who might bring an interesting perspective.

Corvida brought up the importance of tapping your own network. If she is the only PoC at a conference, perhaps she needs to reach out to her own network and let them know that the conference even exists! Lots of people have never heard of CodeMash, SXSW, or OSCON. Spread the word and encourage folks to submit. There's also BarCamps and CodeCamps as a way of starting small.

Our Diversity Panel at SXSW - Photo by Josette Rigsby

Thanks to Adria for organizing the Panel, to Latoya for excellent moderation, and to Anjuan and Corvida for their unique perspectives! To those that attended, I hope you enjoyed it as much as we did. There should be video and audio of the event soon. I'll update this post when it's available.

Recommended Links

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

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