Rick Glos Life in Portland, Oregon.

How to enable Silverlight debugging in web application if it somehow stops working

4. October 2010 09:03 by Rick Glos in

I’m posting this because I ran in circles for an hour trying to determine why I suddenly could not debug Silverlight code.

I had set a breakpoint, set the web application as the startup project, and yet it was skipping the breakpoint.

10-4-2010 8-48-30 AM

I tend to lean heavily on source control, and in our case, Team Foundation Server for determining, “what has changed”.  This was working in the past and I didn’t see any files checked out with any changes.

Turns out this setting is kept in your user specific project file.  I don’t remember unchecking this option.

Right click on your Web application project, not the Silverlight project and select Properties.  Then select the Web tab.  On the bottom of that page you’ll see the ‘Debuggers’ checkbox group.  Check Silverlight.

10-4-2010 8-40-26 AM

Apparently this setting is stored in your *.user configuration file for the project.  Here’s what was in the file before.

   1: <SilverlightDebugging>False</SilverlightDebugging>

And now after.  (Note this setting is updated when you close the solution – until then those settings are in memory – helpful to know if you check the box, hit save, and look at the file you will see no change as I did.  VS hasn’t persisted the value yet.)

   1: <SilverlightDebugging>True</SilverlightDebugging>

Now the breakpoint will be hit when we debug.

10-4-2010 8-55-51 AM

My guess is that there was some dialog that popped up and I automatically replied ‘Yes’ which unchecked it for me.  Doing me a favor yes?  Anyway, hope this helps.

Portland Food Carts - revisited

26. August 2010 08:00 by Rick Glos in

I previously mentioned how good the food carts in Portland can be about a year ago.

Portland Monthly magazine just did an article on food carts in their September 2010 issue – article.

Bing Maps has added a food cart finder – news.

I guess google maps has something similar – google maps.  You can make the google maps one easier to find in the future using ‘Save to My Maps’ so you can just pull it up from the maps.google.com address.

image

Team Fortress 2 – Band of Brothers

24. August 2010 10:10 by Rick Glos in

I am a year late on finding this video but I found it good.  Laughter on the left – tears on the right.

The bigger question… how old does my yet to be born son need to be before I introduce him to this?  :)  {Medic!}

Show output window during build in Visual Studio 2010

23. August 2010 08:07 by Rick Glos in

I was complaining to my co-worker the other day that my output window in Visual Studio 2010 was not showing during a build.  I usually hit Ctrl+Shift+B, and while I appreciate the minimalist UI, I like to see what it’s doing.  All I would see was the status bar text saying, “build started…” followed by, “build succeeded”, or in same cases, “build failed”.

image

When I was watching my co-worker, the output window popped up showing a log of the progress.  I think this is the default but I don’t recall changing my configuration.  I do normally take the output window and unpin it so it stays out of the way and off my screen while I’m coding.  Perhaps the act of doing this flips the option.  I don’t know.  What I’m after is when compiling, slide the window up from the bottom and show a log of what is compiling.

image

I poked around and found the option to turn this on or off and here it is for future reference.

Tools –> Options –> Projects and Solutions –> General –> Show Output window when build starts

image

How to run windows batch files from Visual Studio 2010 Solution Explorer

11. August 2010 11:35 by Rick Glos in

This is an update to running cmd files from Visual Studio 2005 and Visual Studio 2008 post I did a couple years ago.  You can use this technique to run windows command files with the .bat and .cmd extensions.

Just as previously, we need to create at least one, and optionally two, external tools.

One that terminates the window after executing.

Here’s the values for you to copy+paste and screenshot.

Field Value
TitleRun With Cmd
Command%ComSpec%
Arguments/C $(ItemPath)
Initial Directory$(ItemDir)

screenshot

One that leaves the command window open after executing.  Useful if you didn’t put a ‘pause’ in your command file or if you want to leave the cmd window open for additional commands.

Field Value
TitleRun With Cmd and Remain
Command%ComSpec%
Arguments/K $(ItemPath)
Initial Directory$(ItemDir)

screenshot

Now we should see our new external tools available on the Tools menu.

image

However, we’d like to right-click on the file and run the cmd file via Solution Explorer like so:

image

Customizing this context menu in Visual Studio 2010 is abit different from context menu customization in VS2005/2008.

Click Tools –> Customize… to launch the Customize Dialog.

From that dialog we want to select the ‘Context menu’ radio option and the ‘Project and Solution Context Menus | Item’ from the drop down.  I’m going to put the two commands right under ‘Open With…’.  You can certainly do whatever you wish.  Start this process by clicking ‘Add Command’ button on the same dialog.

So here’s a screenshot with that above paragraph in a picture instead of words:

image

When we click ‘Add Command’, the Add Command Dialog will open.  Select ‘Tools’ from the Catgories list box on the left and find your external command from the command list box on the right.  Your command will be named something like ‘External Command {Number}’ where {Number} is the number in your list from your External Tools dialog.

image

Clear as mud?  I’m going to use this to make sure I add External Command 3 and External Command 4 to the context menu.

image

Now the ‘Project and Solution Context Menus | Item’ context menu should look like this in the Customize Dialog.

image 

Close that dialog and check out your new menu items by right clicking on a file in Solution explorer.  You should see your new external commands.

image

For extra credit, you can go back into the Customize dialog and move your commands around into spot your like and alos create a Group around them.

image

 

The finished product looks like this.

image

Configuring Windows Server 2003 with ASP.NET 4.0 while supporting ASP.NET 2.0

10. August 2010 16:28 by Rick Glos in

Went through some interesting configurations today and wanted to document it.

Our client has a server, Windows Server 2003 SP2, in which we already have many ASP.NET 2.0 applications running, including some serving up Silverlight 3.0.  We needed to migrate one of our applications to ASP.NET 4.0 and Silverlight 4.  It was a little more involved than I would’ve thought.

Here’s the steps:

Install the .NET 4.0 Framework on the server.

This did not require a server reboot.  I have yet to have a reboot required when installing a .NET Framework version.  Perhaps I’ve been lucky so far.  This is important because you don’t want to disrupt folks using the resources on the box.

Create a separate App Pool for the web applications that are going to run under .NET 4.0.

From what I understand, you can’t have different web applications running under the same application pool.  Since this box has production and beta applications on it already, we need to create an app pool.  Nothing fancy.

Create the new virtual directory for the new application and assign it your new app pool

Nothing fancy here.  Use the properties dialog to create the application and assign the app pool.

image

Install the scriptmaps for ASP.NET 4.0 to the new web application.

If you don’t do this step and you try to run the application under 2.0 you will get error:

Unrecognized attribute 'targetFramework'

This is because the web.config is different now and contains a new attribute on the compilation element.

 image

If you try and set the ASP.NET version using the properties panel, you will get a warning that you are going to cause a restart of the entire W3SVC service therebye killing all the work anyone may be in the middle of using existing applications.

 image

Since we don’t want to disrupt currently running applications, we need to do this through the command line.

Open a cmd prompt and navigate to the v4 Framework directory: %WINDIR%\Microsoft.NET\Framework\v4.0.30319.  Once there, we can use the administration utility to change the application.

   1: aspnet_regiis.exe -s W3SVC/1/ROOT/SampleApp1

Here’s an example of the output when doing this against a test application.

image

Enable ASP.NET v4.0.30319 web service extension

If you try to hit the web application prior to this step you will receive ‘The page cannot be found’.

image

Enable the new version ASP.NET by using the Web Service Extensions node in IIS 6 and switching ASP.NET v4.0.30319 from Prohibited to Allowed.

image

Finished

From here you should be done and can now use your application right alongside older ones on the same web server.

Visual Studio 2008 locks in ASPX design view

3. August 2010 12:38 by Rick Glos in

Had a strange problem today that took a couple hours to resolve.

I originally experienced it when I tried to add a new Web Content Form, once I selected the master page, Visual Studio 2008 would lockup.  Anywhere I clicked would return a windows beep.  If I moved other applications over the window, only the tab that contained the new page would not get repainted.

8-3-2010 12-25-28 PM

I also experienced it when opening an ASPX file and clicking the design view tab Visual Studio 2008 would lock or freeze. 

8-3-2010 12-28-34 PM

I could only kill the devenv.exe process. 

A little searching turned up some strange results and I finally stumbled across a couple posts that seemed to be intelligent. (post 1 | post 2).

I regurgitating it here in case those go linkdead.

The gist is that the Office 2010 install somehow fubared some shared components.  Personally, I only experienced pain when I installed Visio 2010 and not the Office 2010 install I did a few months ago.

Run the Office 2007 Setup file located here:

C:\Program Files (x86)\Common Files\microsoft shared\OFFICE12\Office Setup Controller\Setup.exe

Now click ‘Repair’.

MSVSWAC

It ran a few minutes.  Run Visual Studio and fixed.

Choices for just having a baby

31. July 2010 12:26 by Rick Glos in

We, mostly Heidi, decided early on to use a midwife for birth instead of an doctor.  Partly because right before Heidi became pregnant, her insurance changed and she needed to switch doctors, and partly because we had caught a story here and there about using a midwife for birth instead of a traditional doctor.

The term first conjured images of medieval times to my mind.  Then I read up and became less ignorant about the subject.  My understanding is basically you approach birth with the thought that the body will take care of itself whereas with a doctor, you approach it more from the idea that birth needs constant maintenance and intervention.

Using a midwife has been very pleasant so far.  A team of midwifes work out of the hosptial, OHSU (wikipedia).  We don’t see the same one each time, but they are very pleasant and during the visit I’m constantly surprised at how genuinely interested they seem to be in the experience of being pregnant.  Asking Heidi tons of questions and spending quite a bit of time during the appointment with you in contrast to a doctor’s visit where they rush in and rush out.

That’s been my experience so far anyway.

To this point, I’ve imagined in my mind the actual birth.  Heidi would be on the hospital bed, feet in the stirrups, doctor hovering over screaming push.  When I came to think on it, I mentioned to Heidi that this seems silly, didn’t cavewomen like squat or something and let gravity help?

Then we watched this movie, the Business of Being Born, just this last week based on the recommendation of some friends. (Netflix)

The Business of Being Born 

 

And I got to see babies being born this time for real and not in a movie.

Here’s some interesting things I saw:

  • So it looks like midwives prefer you to give birth standing/squatting, sometimes in water.
  • There’s a cocktail of hormones that get released at birth bonding the mother and infant – a biological process.
  • Doctor-based intervention usually starts with shot to induce labor (PIT – something), then a shot to numb the pain (the spinal one), which relaxes the woman so they give more of the first shot to re-induce labor, then back to the  shot to numb the pain and back and forth and on and on into a vicious cycle…  which leads to…
  • 1 in 3 babies, in the U.S. today are caesarian section births.
  • Physician convenience is a leading cause of caesarian section – a large number of babies are born at 4PM (“it’s getting late time to go home”) and 10PM (“it’s getting late, I need to go to bed”).
  • Hooking up to an intravenous, IV, allows easier administration of the shots mentioned above.  In a typical hospital pregnancy you are hooked up first thing thereby making it less of an obstacle when later proposed.

It’s worth a watch even from a historical perspective just to see how births in the US have evolved over the past 100 years.

Update (2010.08.18): Just heard from the midwife today at Heidi's appointment that The American College of Obstetricians and Gynecologists published an article back on 2010.07.21 that states:

The cesarean delivery rate in the US increased dramatically over the past four decades, from 5% in 1970 to over 31% in 2007. 

So from 1 in 20 to 1 in 3 over 40 years.  Link to the article.

Codex Alera Series

29. July 2010 15:52 by Rick Glos in

Just finished the 6th and final book in the Codex Alera series written by Jim Butcher.  My old man recommended them to me and they were fantastic.  My personal favorite was book 3.  If you are a fan of fantasy novels, war movies and especially of ancient roman history, then you’ll love these.

I really enjoyed the strategy and tactics and life of being in a Legion.  The magic is not too over the top.  It would be cool if they made these into a series of movies.

The Codex Alera Series on Amazon.

Codex Alera on Wikipedia.

Drive and motivation

14. July 2010 07:51 by Rick Glos in

I was going to just send this in an email to my wife but I thought perhaps some of you may not have seen it.

Very interesting eh?