Visual Studio 2010 Crashing on Uncompiled MVC 4 Projects

I have come across an issue where in MVC 4 pilot project, while working in views, the IDE would crash fairly frequently. I am using Visual Studio 2010 with SP1 and we are using GitHub for our source control.  Luckily I came across this article:

http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253806

In the Known Issues and Breaking Changes section, it lists this gem:

After installing ASP.NET MVC 4 Beta, the CSHTML/VBHTML editor in Visual Studio 2010 Service Pack 1 CSHTML/VBHTML editor may pause for a long time after typing snippet or JavaScript inside cshtml or vbhtml files. This occurs only in ASP.NET MVC 4 applications which have just been created and have not yet been compiled.

The workaround is to compile the project to get the assemblies in the bin folder. Note, if you clean the project which removes the assemblies from the bin folder, the editor problem will come back.

This will be corrected in the next release.

This was fairly similar to my case, but not entirely correct.  We are using NuGet package restore on our projects, and our .gitignore file is set up to exclude binaries.  So, even if you do compile the project, we’re not checking the bins into source control.  The IDE was crashing as though the project had never been build.

Thankfully the workaround still applies, and building the project after merging from upstream still did the trick.

Sharing With Friends - Opening up IIS Express To Other Team Members

I’m developing an app with an Android-ian friend. When co-developing some of the features, we’ve found it critical to be able to easily access the development stream of the services, which I’m building with Asp.Net’s WebAPI. Here’s an easy way to configure your IIS Express instance to allow outside traffic.

Playing Inside the Sandbox

The out-of-box experience for IIS Express is to have all web traffic closed to clients not residing on localhost. This is a great security practice, but not great when you’re_ trying_ to share a site or service.  Configuration of IIS Express is also non-evident; the little UI you do have exposes no way for you to actually modify the section of config that allows access.

To enable access outside your box, you need to create a virtual directory for your app and edit the applicationhost.config file located My Documents\IIS Express\config.

In Visual Studio, double-click on your project properties and open up the Web tab. Scroll down to the section where you can select the server and make sure it’s on IIS Express. Finally, click on the Create Virtual Directory button. This creates an entry in the config file.

image

Now, open up that config file (again, it’s in My Documents\IIS Express\config) and find your newly created site.  Update the config section so that it looks something the the following by adding a second binding.

<site name="MySiteOfAwesomeness" id="13">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="C:\dev\MySiteOfAwesomeness\MySiteOfAwesomeness" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation="*:4111:localhost" />
        <binding protocol="http" bindingInformation="*:4111:192.168.100.101" />
    </bindings>
</site>

Note that instead of localhost you can use your computer name or your IP address. 

Finally, you’re going to need to open up that port through whatever firewall you have.  For me, I used Windows Firewall with Advanced Security (much better than the Marginal Security version) and added a rule to allow traffic on my project’s port.

Hope this helps someone, and, hey, be nice to your Android friends, they might be somebody’s brother.

Clearing out the Stresses - Inbox 0, Me 1

I made huge inroads into de-cluttering my digital desktop today. 

image

That’s right, baby. Nothing in the inbox! I went from 2985 messages down to 0. Outlook loves me, so does my phone client. And I know exactly what I have left to deal with.

Staying on Top of What To Do

I have tried for the last 5+ months since coming on board at LogiSense to use my Inbox as a staging area for the things that I have to do. The trouble is that as things can’t be immediately responded to, they start to build up. Miss a couple work days and look out, that beast grows quickly.

While watching Scott Hanselman present in the clip from WebStock12 on how to filter out the noise, it was like a slap in the face when I realized how much weight this actually was.  I have almost 3,000 things I need to deal with. It was a recurring, screaming thing in my head. I would make great gains, be –60 on the day or even better, but then be absent for two days and fall 100’s of messages further behind. 

I kept thinking I can never get back on top of this. And while I wouldn’t really call it beating myself up, I knew it was weighing on me. 

To get going, I started by creating a couple rules per Scott’s recommendation. I’m going to share the gist of this so that others can get ideas of how to sort their own and create the appropriate filters to clean out their inboxes.

The first rule to create was to filter out any email that wasn’t sent to me. I had one exception: if the email was addressed to a group that I am apart of (for example, coworkers@myoffice.com) then leave it in my inbox.  Next, I created a filter where I was only a CC on the message and directed those to an Inbox – CC folder.  We have some automation accounts that send us notifications (failed builds, for example) so I created rules for those as well.  And finally, again per Scott’s suggestion, I created a rule that said anything from one of my bosses went into a golden folder for immediate undivided attention (my company recently started following me on Twitter, so it’s probably best I say something like that).

Claiming Back my Inbox

The last step was to run the rules against my inbox. I dropped to about 600 messages almost instantly. The scrollbar actually had context again, it actually meant something!

I then decided that anything that was older than 3 weeks was instantly on the chopping block. I moved all these “old” messages into an Inboxchive folder, then quickly ran a couple of searches over that folder for important messages or messages that relate to specific customers I’m working with. I threw those back into my inbox and marked everything else as read.

With 120 messages left I was easily able to sort things into the appropriate bins, flag them for follow-up if required, and respond to the ones I had yet to respond to.  It took about 45 minutes to do all this.

I feel like the self-perpetuated pressure of an inbox that has grown by about 125 messages per week is finally gone. Tonight, I am going to sleep better. I actually feel lighter.

Hope this helps and/or encourages someone out there there to clear a little clutter.

The Future of the Web on .NET Rocks!

imageI recently spoke at Prairie Dev Con West in Calgary, where I was pleased to be asked to join a panel on the very popular internet audio talk show developers know as .NET Rocks!  Hosts Carl Franklin and Richard Campbell put together a panel to revisit a conversation they have every couple of years on “The Future of the Web”.

The audio is now online, so have a hear!

Joined by my friend Bil Simser, fellow Canadian Andrew Nurse from the Asp.Net team at Microsoft and James Kovacs of JetBrains, it was a great group with diverse experience that allowed us to dive into all kinds of topics.  Starting with defining the current state of the web, we talked about current challenges, what the internet has become, and what the next few years holds for us as developers.

Be sure to check out the audio here and be sure to subscribe to the show!

Prairie Dev Con - Calgary Edition

image

Look at all those hard-working developers!

Thanks to everyone who came out to my intro to MVC yesterday, and to the Dojo today.  I had a great time in the 2.5 hour Dojo session building the app with everyone who was able to attend.  We got to explore MVC, scaffolding, Models, Entity Framework + Code First, Controllers, Actions, jQuery, a bit of routing, partial views, packages in NuGet, HtmlHelpers and touched quickly on ActionFilters and even a bit of Areas.  Whew!

Lessons Learned

A big thanks goes out to the 30+ devs that came to the Dojo today…I certainly didn’t anticipate the number of participants. With the myriad of OSes, Visual Studio editions and service pack levels, SQL Server configs and more, it was great to be able to work as a group through the things that came up and make the most of things, regardless of how well your tooling worked out.  For those who were unable to code through the exercises, I hope you took enough away from today to try some of these things on your own.

Here’s some of my observations:

  • I promise that if I am going to use someone else’s jQuery plugin I won’t go months without reviewing the syntax and configuration options!
  • I am moving this talk to MVC4 as we’ve now got a go-live licence. I will make this the requirement for the Dojo session and also will recommend VS2010 Ultimate, even the trial version, so that we’re all working off the same kit.
  • For those that aren’t able to get the software before the session (it is posted in the abstract!) I will make sure I download the full tools (and not just the downloader…#FAIL).
  • I will make sure we have the connection strings handy for a couple alternate SQL Server configs.
  • I will try to get a second projector in play – this will allow me to help work through issues that others might be having while still leaving the exercises up on the screen for those who wish to continue along.

Again, thanks to all who helped to work through the things that came up…great teamwork!

Next Steps

Don’t stop now! Here’s some things you can do to hone your skills and practice some of what we covered today:

  • Grab a copy of Visual Studio 2010 (the Ultimate trial if you don’t have it already)
  • Download a copy of the MovieFu project from GitHub
  • Get in touch! Easiest is to reach me on Twitter
  • Start writing code! I know that you got more out of the Dojo than you did out of the intro (if you attended that) because you wrote code.  You don’t need me there to do that! Cut a few projects and try to solve some simple scenarios, explore EF, areas or whatever interests you.

Good luck, and happy coding!

Okay Developers, Time to Level Up: Visual Studio 11 and Windows 8

The bits are now in the wild.  I’ve got Win8 on the download and VS11 installed already on my Win7 boot.  I’ll be wiping the Win8 partition and installing the Customer Preview of Win8 later today.

image

#

Bringing The Awesome

I’ll getting pumped for PrDC Calgary and I’m looking forward to rebuilding my MVC and NuGet talks on Windows 8 and Visual Studio 2011 for that conference. Only a couple weeks to go!  Remember, if you’re hoping to come to the Dojo session for MVC, please bring along your laptop.  I’ll be demoing some of the MVC4 bits, so please update your machines before you come (I’ll have a few USB keys with the install if you don’t have, but please make sure you have VS installed…even the free version).

Getting Up To Speed

Go grab all the bits for yourself: