thefrozencoder

Programming and Technology blog

When refactoring goes bad

So I ran into this little nugget this morning while working on a C# WinForms project in VS 2008 (might be an issue in VS 2005 as well).

Compiler Error: The item "*.resources" was specified more than once in the "Resources" parameter.  Duplicate items are not supported by the "Resources" parameter.

Seems that when I copied an existing form and renamed the copy to something else (using the properties window) the refractor tool decided that the source form name needed to be changed as well.  Apparently this is a common issue as I did a search for the problem online.  Normally when you do a rename in a code file you get the option to preview the changes and apply what you want to.  If you do this in the properties window or rename a class file in the solution explorer it seems to just make the change without a preview and globally.

I think that I need more control with this feature so you can turn this off in the IDE under Tools (for VS2008):

  • Options
    • Windows Forms Designer
      • General:
        • Set “EnableRefactoringOnRename” to false.

Doing this still allows you to do your refactoring (via the context menu) but now you have more control over what gets renamed.  And as an added bonus it's also a performace tweek to the IDE.

IE8 available as a VPC Image

The new IE8 beta was released yesterday and is available as a Virtual PC hard drive from Microsoft. You can download the following hard drive images from this location.

  • XP SP2 w/IE6
  • XP SP2 w/IE7
  • XP SP2 w/IE8
  • Vista w/IE7

You can also check out the IE Blog for more information on what kind of changes will be implemented. The big news is CSS 2.1 compliance, get the VPC image and start testing your sites.

Hang on boys and girls it’s going to be an interesting ride...

VS 2008 IDE - Not as smart as you think you are

I have been playing around with VS 2008 over the holidays and have found some of the new features pretty impressive and very helpful for the average Joe-blow developer.

Now in the past the IDE has made it painfully clear and made it impossible to create solutions and or projects with invalid characters in them. So most weary developers probably never thought about it much.

Now (sans 2005) you can actually open any folder on your hard drive as if it was a Web Site (thanks to File System based projects) but the IDE becomes somewhat forgetful in that it will let you pick folder(s) with invalid characters in it and not say anything about it.

The behavior that ensues is one or more of the following:

  • The master page content placeholder errors out saying “This control can only be used in a master page”.
  • The themes don’t seem to work properly in Design and Split view.
  • The content pages that use the master page will not display their contents in the Design and Split view at all
  • Typing text content into the Split or Design view will place the content outside of the content placeholder (causing other issues).

The best part of all of this is if you view the website in a browser, it all works fine.