Now that the holidays are over it is time to get back to business. The Philly Application Lifecycle Management group has 2 great meetings scheduled.

The first is Thursday evening, Jan 22. Come hear Nik Molnar talk about tracking web performance.

The second meeting is next month on Thursday Feb. 19. For that meeting, Jess Chadwick talks about Getting the most out of NuGet.

We are really lucky to have these great speakers coming to our group. I’ve attended talks presented by both of these guys and I can assure you they will be good!

For more information about the group, please head over to Meetup.com:

 

Here are some additional details on the meetings.

Tracking Real World Web Performance

Study upon study confirms that web performance has a direct correlation to revenue, operating costs, and search engine ranking. With this in mind, we all want our applications to be faster but how do we know what bottlenecks to focus on?

Join Nik Molnar, co-founder of the open source debugging and diagnostics tool Glimpse, to learn how to leverage free and open source tools to capture your application’s live performance data, understand what the metrics mean and focus on the ones you should really care about.

This session will cover how to use free services to act as a simple lab for synthetic performance testing and how to get Real User Metrics (RUM) from the very last mile via the instrumentation API’s built into browsers. Nik will also demonstrate techniques to automate the performance feedback loop so you can ensure to always treat “fast as a feature”.

This session is suitable for any stakeholder who cares about performance. It is classified as 200 level.

 

Getting the Most out of NuGet

NuGet is far more than just a UI that makes it easy to incorporate open source projects into your applications. At the core of NuGet lies a platform that any team or organization can leverage to easily and collaboratively share assemblies, content, and even development tools… all within the comfort of your company’s LAN.

In this session we’ll go beyond the public package repository and take a look at the NuGet platform in depth to see how easy it is to create custom NuGet packages and host them in a private repository. We’ll also explore some of the other powerful things that NuGet enables you to do such as easily sharing tools and even scripting Visual Studio.

Jess Chadwick is a software developer and technologist with over fifteen years of development experience ranging from embedded devices in start-ups to enterprise-scale web farms at Fortune 500s. He is an ASPInsider and a magazine, book, and online course author, including O’Reilly’s Programming ASP.NET MVC 4 and several courses on Lynda.com. Jess is actively involved in the development community, regularly speaking at user groups and conferences as well as leading the NJDOTNET Central New Jersey .NET user group.

I recently found out the hard way that the underscore character “_” can be problematic within URLs, particularly with Internet Explorer. Here is why…

(FYI, my testing was done with IE 9)

First of all, the underscore character is a perfectly acceptable character in a URL. Web browsers can deal with it fine in most circumstances. However, IE seems to dislike the underscore when it is in a domain or subdomain name, for instance www.my_site.com or test_site.mysite.com. Will it work? Under general circumstances it might. The problem shows up when you need a cookie for the site, which most sites do, especially if you are using cookies as part of your authentication scheme. IE can’t create cookies when the domain or subdomain name has an underscore.

This doesn’t seem to be a problem for Firefox (I’ve tried it) and Chrome (so I have heard).

A note about SEO

Also, it is worth mentioning that the underscore is not a good choice in a URL if you are interested in SEO. That’s because some search engines like Google don’t consider the underscore a word separator. To Google, it reads a URL like “mysite.com/Page_About_Something_Cool” as mysite.com/pageaboutsomethingcool” which won’t help your rankings much. Bing is fine with the underscore but of course simply using a dash “-“ instead will keep both search engines happy.

I’ll close with a few examples

www.somesite.com/page-with-content good choice for a variety of browsers and search engines
mysubdomain.somesite.com/page-with-content good choice for a variety of browsers and search engines
www.some_site.com trouble for IE with cookies
sub_domain.somesite.com trouble for IE with cookies
www.somesite.com/page_with_content valid but bad for SEO with Google
Posted in Web.

In trying to set this up, I kept finding articles and blog posts that had instructions that didn’t work. In the end, setting this up was pretty easy.

First off, I am running IIS 7.5 on Windows Server 2008 R2. If you have a different set up, this might not work for you.

First, the problem – a pretty common one:

We’ve got our Application Pools set to recycle once a day. However, each time the app pool recycles the first user to hit the site has to wait while everything warms up again. That wait can be 30 seconds or so which is a pretty long time. So I want my application to be ready all the time, even after an Application Pool reset.

Side note… I don’t recommend using the default settings for app pool recycling. If you do, the pool will recycle every 1740 minutes. However, that time could end up being in the middle of a busy day. That would be bad. Instead, I set mine to recycle at around 3 AM when no one is using my site. Of course, you may have different needs.

The Solution

Setup

IIS 7.5 has a feature called Application Initialization. I’ve seen many blog posts about it. Some say you can use the GUI to configure it. Some say you configure it via a .config file. Most of them imply that the feature is there and ready to be used. For me it was not installed by default and there was no GUI. I’m not sure why. Are my servers (prepared by a different team) configured to not have this feature? I don’t know.

In any case, installing this feature is easy. Just go here and install the Application Initialization Module for IIS 7.5. It is pretty quick but will require a reboot.

Once you do, open IIS and click on the server node and in the main window under Management, click on Configuration Editor:

image

Inside the editor, set the section (via the dropdown at the top) to “system.webServer/applicationInitialization”. If you can do that, the installation was successful! Prior to installing, that node wasn’t there! Interestingly, there are some settings here that imply you can change them via the UI. For instance, I tried setting “doAppInitAfterRestart” to True. Not only did that not help, it caused errors with IIS. So why is it there? I have no idea. My advice… don’t touch those settings.

image

Configuration

IIS is all set but now you need to tell it which app pools and websites you want it to start. Simply go to:

C:\Windows\System32\inetsrv\config

and open the applicationHost.config file. You may want to back the file up before you make changes.

You’ll need to add two things.

1. The App Pool:

Find the applicationPools node. Within it it you will find each app pool listed. Here is an example:

<add name=”YOURAPPNAMEHERE” autoStart=”true” managedRuntimeVersion=”v4.0″ startMode=”AlwaysRunning”>
<processModel identityType=”ApplicationPoolIdentity” loadUserProfile=”true” />
<recycling logEventOnRecycle=”Time, Requests, Schedule, Memory, IsapiUnhealthy, OnDemand, ConfigChange, PrivateMemory” />
</add>

Simply add the highlighted text startMode=”AlwaysRunning”. You will note that it probably already says autoStart=”true” but yet it didn’t autostart. Another misleading part of this, huh? Oh well.

2. The Web Site

Go to the sites node and find your site which will look something like this:

<site name=”YOURSITENAMEHERE” id=”4″ serverAutoStart=”true”>
<application path=”/” applicationPool=”YOURAPPPOOL” preloadEnabled=”true”>
<virtualDirectory path=”/” physicalPath=”C:\inetpub\wwwroot\YOURSITENAME” />
</application>
</site>

Once again, add the highlighted text.

Validation

How do we know it works? That is easy…

  1. Open up the task manager and go to the processes tab.
  2. Sort by Image Name and find the process w3wp.exe. There may be multiple instances. The Username should be the name of the apppool.
  3. If you try to End the Process, you will find that it restarts itself. Seems like it won’t go away ever. Uh oh, how do you stop it then?
  4. To stop the process you must stop the application pool.
  5. Of course, if you restart the app pool you will find that the w3wp process comes back. But wasn’t that what you wanted in the first place?

Problem solved. Enjoy.

When developing web sites, we should all be thinking “touch friendly”.

Now that I have a Surface RT tablet, I realize how bad so many websites are for touch devices like a tablet. Lucky for me my Surface has a keyboard with a track pad built into the cover. Because on numerous occasions I find myself stuck on a website and I need to switch to “keyboard” mode and use the track pad/pointer to be able to use some drop down menu type of input.  Obviously this didn’t matter for many years an there are a lot of old sites living across the internet. Over the years, I was just I was just as guilty of this bad programming technique as the next developer, we just didn’t need to worry about touch. But those days are over and I’m ready to make a change.

By the way, I’m not going to get into a rant about how bad most websites are to use on smaller mobile devices like phones! This is a similar issue but there is a difference.

As more and more people are using tablets as their primary device for the web, we developers need to get with the program and ensure that we give our guests a first class experience.

Here are a few simple tips to follow:

  • Don’t rely on hovering. Touch users don’t have a mouse pointer so they’ll be stuck.
  • Make targets large. If you expect a user to click something, think about the size of the average user’s finger.
  • Keep pages simple. It’s much easier for touch users to use your site if you keep things simple and uncluttered.

So fellow developers, please join with me in this New Year’s resolution by taking this pledge:

I, state your name, promise to start making websites and applications that don’t suck for touch devices. I promise to care about my users and build sites and applications that they can use easily.

Happy New Year! Good luck with this and all your other resolutions.

So I’m working with Silverlight these days.  It’s an excellent technology but it’s got a fairly steep learning curve.  For the past several years I’ve been working predominantly with ASP.Net.  As a matter of fact, I’ve really gotten pretty good at it!  In addition to all of the in’s and out’s of ASP.Net, including the page lifecycle, custom controls, etc, I had gotten really comfortable with CSS and I’ve even stopped saying “I hate JavaScript” and started liking it.  Of course, with JQuery, it is really pretty good to work with.  But I digress.


Anyway, all of that stuff I have learned is out the window now.  Silverlight is completely different.  The easy part is that all of my C# code goes right to the client, as well as running on the server.  So much for JavaScript.  But there is no HTML, no ASP.Net controls.  None of it (at least in the apps I am writing).  This is not an ASP.Net application with a little Silverlight mixed in.  The entire UI for this business application is Silverlight.  The only html/asp.net is the page that hosts it.  So all of the UI is written in XAML.  XAML is cool and very powerful but takes getting used to and when you start with it, you are starting from scratch.  It’s not like writing a web app or a windows forms app at all.  But don’t get me wrong, I like it.


Anyway, the purpose for this first Silverlight post…


So I’m working along and things are going good.  My app is coming along and working as well as it should in the very rough state it is in.  After making a bunch of changes I fire up the debugger and run my Silverlight application in Internet Explorer.  “Hmmm, that’s weird, it shouldn’t do that” I think to myself.  I checked the code, and sure enough, it should not do “that”.  So I run it again. Same result.  My code is running without the recent changes I made.  Ok, I try a bunch of stuff, not necessarily in this order: Build my Solution, “Rebuild” my solution, “Clean” my solution, put obvious changes in my UI and re run it, restart Internet Explorer, Ctl-F5 to clear IE, try Firefox, close/reopen my solution, close/reopen VS2008, reboot my machine.  I probably tried a few more things but no matter what I did, the application continued to show the UI before my changes.  At some point in all of this, it became clear that my XAP file was not getting updated in my web project.  I tried deleting it, figuring that would signal Visual Studio to replace it when it builds again.  No luck.  I manually placed a current XAP file (from the Silverlight app) into my web project.  Now when I run my application is perfectly up to date!  So I am positive on the problem but unsure how to fix it. I figured that in my Property Pages of my Silverlight Application I’d find something telling me where/when/what to do with the XAP file.  But I couldn’t find it.  Next I searched the Property Pages of my Web Application.  Presto, there it is!  From a web application, select the “Silverlight Application” tab.  When I did the list of projects was empty!  I have no idea how it got to be that way.  But I clicked “Add” and the rest was self explanatory.  I picked my Silverlight project and selected where I wanted the XAP file to go. 


 


image


Technorati Tags: , ,