April 2005 - Posts

More CodeCampOz stuff
Sunday, April 24, 2005 10:40 AM

I particularly enjoyed the presentations from Joel Pobar and Dominic Cooney yesterday. Joel talked about all the "chunky bits" in the CLR and Dominic talked about managed performance. Dominic mentioned some interesting techniques to achieve some better managed memory performance (and therefore better overall performance). I found a couple of useful techniques he mentioned and shown some below.

When defining an enum, if you only have a few items, then derive it from a smaller type to save space. By default, an enum is derived from an Int. So for eg.

public enum MyEnum : byte
{
   something,
   anotherthing,
   onemore,
   andthelast
}

Its only a small saving for one object, but if they are used a lot, it can add up over time.

Also, if you want to find out if you are excessively "boxing" objects in an assembly, go into ildasm and load up your assembly, have a look at the IL and use notepad to search for the word "box". If there is lots of them, then you might want to check your code to try and minimise the boxing. Easiest way is to load up your assembly in ILDASM, and use the 'File --> Dump' menu option to output the IL to a file. Load it up in notepad and search for " BOX" (note the space before the word so you dont get search hits from things like "ListBox" etc. Its easy to see where your boxing is occurring and you can determine and its interesting learning experience too.

 

CodeCampOz is underway!
Saturday, April 23, 2005 12:25 PM

I am currently sitting in the presentation room here at CodeCampOz in Wagga Wagga, NSW, Australia. This is the first code camp in Australia and it has enjoyed a fantastic turnout. Approx 300 people, and we have already seen some great speakers such as Mitch Denny on the Base class library, Greg Low on SQL Server, and Adam Cogan showing some ASP.NET features such as Databinding, Caching and numerous other enhancements.

I hope to actually get some photos posted (I have to take some first ...), but for now am looking forward to further presentations from Andrew Coates of Microsoft on Click Once, Darren Neimke from readify on ASP.NET 2.0 Web parts, Dominic Cooney, Joel Pobar and basically a chock full day of content enough to make to most ardent geeks happy.

Andrew Coates is now in full swing, so better pay attention, back to the presntations....

Steps in starting up with Subversion - moving away from Sourcesafe
Tuesday, April 19, 2005 6:12 PM

As you may be aware, in my last post, I talked briefly about Subversion and Continuous Integration via CruiseControl.NET. This post is simply to list the steps I used in getting up to speed with Subversion and CruiseControl. It took a little time to research, read and get up to speed with all the new mechanisms and terms, so I thought I'd present it here, in one central location, for those who are thinking of doing the same.

So, first up, getting Subversion up and going.

1. Grab a copy of Subversion from here

2. Unzip the contents to a new folder somewhere on your system, basically wherever you want this to live.

3. Set a path to the 'bin' directory in this package, for your entire system. You can do this in windows via right clicking on the "My Computer" icon on your desktop. Select "Properties", select the "Advanced" tab, and click the "Environment Variables" button.

4. In the 'System Variables' windows, locate the 'Path' item, and add the path to the end of the string, separated with a semi-colon. So you would be adding something like ";c:\svn-win32_1_1_4\bin" to the path environment string.

Thats about it for Subversion itself. To test this, simply go to a command prompt and type one of the commands like "svn help" and you should see a help listing for that command.

To make Subversion nice and user friendly though, you'll want to install the TortoiseSVN Windows shell enhancement. It supports most of the command line Subversion command set from the Windows Explorer interface, but before you do this, there are a couple of things to know about.

The main distribution of TortoiseSVN uses a hidden directory named ".svn" in each directory to store specific repository information. Visual Studio 2002/2003 web projects do not like this directory and complain when loading up a web project. A message box is displayed to the effect "Unable to Refresh project directory" or some such message. Clicking OK continues on and successfully loads the project anyway, however it is an annoyance. Possibly solutions to this are:-

1. Before you load up the web project, clear/delete the VSWebCache directory thats usually stored in the "Documents and Settings\{user}" directory. This prevents the error message from being displayed, but re-appears the next time you load the project, unless you again clear/delete this directory.

2. You can not use web projects all together, and develop web apps using the standard class library development project (ie. ASP.NET apps without web projects) as described here.

3. You can download an alternate version of the TortoiseSVN shell enhancement that uses a directory name of "_svn" to store its repository information. This version comes with the caveat that it is NOT supported and is was simply created to alleviate this problem. Further development will continue from the main distribution, which uses the ".svn" directory name. Both versions of TortoiseSVN can be downloaded from here. Fortunately its actually pretty easy to switch between these 2 versions so its the option I have used. I originally started using the ".svn" version, ran into problems with VS.NET, uninstalled TortoiseSVN, renamed my ".svn" directories to "_svn" (using a script to traverse all my directories), and installed the "_svn" version of TortoiseSVN. It now works fine.

Migration from SourceSafe.

A lot of my projects were using SourceSafe so I had to migrate a majority of them away from Sourcesafe and any associated VS.NET integration, and into Subversion. I will detail that in my next post, but I basically used the "Unbind" feature from VS.NET in the "File --> Source Control --> Change Source Control" menu option to disassociate Sourcesafe from my project and used the explorer shell integration to import the data into the Subversion repository. Again, I will concentrate on that more in my next post.

Hope its been helpfull to someone. Until next time...

by Glav | with no comments
Steps in starting up with Subversion - moving away from Sourcesafe
Tuesday, April 19, 2005 6:11 PM

As you may be aware, in my last post, I talked briefly about Subversion and Continuous Integration via CruiseControl.NET. This post is simply to list the steps I used in getting up to speed with Subversion and CruiseControl. It took a little time to research, read and get up to speed with all the new mechanisms and terms, so I thought I'd present it here, in one central location, for those who are thinking of doing the same.

So, first up, getting Subversion up and going.

1. Grab a copy of Subversion from here

2. Unzip the contents to a new folder somewhere on your system, basically wherever you want this to live.

3. Set a path to the 'bin' directory in this package, for your entire system. You can do this in windows via right clicking on the "My Computer" icon on your desktop. Select "Properties", select the "Advanced" tab, and click the "Environment Variables" button.

4. In the 'System Variables' windows, locate the 'Path' item, and add the path to the end of the string, separated with a semi-colon. So you would be adding something like ";c:\svn-win32_1_1_4\bin" to the path environment string.

Thats about it for Subversion itself. To test this, simply go to a command prompt and type one of the commands like "svn help" and you should see a help listing for that command.

To make Subversion nice and user friendly though, you'll want to install the TortoiseSVN Windows shell enhancement. It supports most of the command line Subversion command set from the Windows Explorer interface, but before you do this, there are a couple of things to know about.

The main distribution of TortoiseSVN uses a hidden directory named ".svn" in each directory to store specific repository information. Visual Studio 2002/2003 web projects do not like this directory and complain when loading up a web project. A message box is displayed to the effect "Unable to Refresh project directory" or some such message. Clicking OK continues on and successfully loads the project anyway, however it is an annoyance. Possibly solutions to this are:-

1. Before you load up the web project, clear/delete the VSWebCache directory thats usually stored in the "Documents and Settings\{user}" directory. This prevents the error message from being displayed, but re-appears the next time you load the project, unless you again clear/delete this directory.

2. You can not use web projects all together, and develop web apps using the standard class library development project (ie. ASP.NET apps without web projects) as described here.

3. You can download an alternate version of the TortoiseSVN shell enhancement that uses a directory name of "_svn" to store its repository information. This version comes with the caveat that it is NOT supported and is was simply created to alleviate this problem. Further development will continue from the main distribution, which uses the ".svn" directory name. Both versions of TortoiseSVN can be downloaded from here. Fortunately its actually pretty easy to switch between these 2 versions so its the option I have used. I originally started using the ".svn" version, ran into problems with VS.NET, uninstalled TortoiseSVN, renamed my ".svn" directories to "_svn" (using a script to traverse all my directories), and installed the "_svn" version of TortoiseSVN. It now works fine.

Migration from SourceSafe.

A lot of my projects were using SourceSafe so I had to migrate a majority of them away from Sourcesafe and any associated VS.NET integration, and into Subversion. I will detail that in my next post, but I basically used the "Unbind" feature from VS.NET in the "File --> Source Control --> Change Source Control" menu option to disassociate Sourcesafe from my project and used the explorer shell integration to import the data into the Subversion repository. Again, I will concentrate on that more in my next post.

Hope its been helpfull to someone. Until next time...

Source control and Continuous Integration
Tuesday, April 12, 2005 7:50 PM

I have finally got around to installing SubVersion source control system and also installing CruiseControl.NET for continuous integration. I definitely like SubVersion but being a long time VSS user, it does take a little time to get the hang of. What I will say is that without the graphical tools that are TortoiseSVN (for windows explorer/shell integration) and AnkhSVN (VS.NET integration), then I would have ditched it very early. I am a lazy beast, and without the GUI add-ons, I don't think I would have had the time and patience to learn all the commands that go with administering it.

At any rate, it looks very cool, and CruiseControl.NET is a great product, if continuous integration is your thing. I know some people have thought it not a good idea, as it means development conditions ad/or practices have gone bad, but in large orgs, and even in small teams, things can easily go bad, so its great to know that such a tool is available, and whats more, its free. Kudos to ThoughtWorks for releasing it.

As a side note, Garret Smith did an excellent presetation at the Sydney Deep .Net user group on CruiseControl.NET. Thanks Garret.

WebParts and ASP.NET 2.0 Beta2
Wednesday, April 6, 2005 12:07 AM

As some of you already know, Microsoft shipped a control called the WebPartPageMenu in Beta1 that allowed you to select the design mode of WebParts on a web part enabled page (eg. Edit mode, Design Mode, Catalog mode etc.). This control has been dropped for Beta2 and although it was a limited control, I still found it quite useful, especially when experimenting with WeParts.

With this in mind, I have created the WebPartPageModeSelector server control that has been created using the Beta2 product (well as close as for now) and does essentially the same thing as the recently demised WePartPageMenu. It displays either a dropdown list or a list of radio buttons, depending on what zones/features you have on your page, and sets the display mode by setting properties of the webPartManager control that is present on the page. It also supports AutoPostBack (in which case no "Apply" button is displayed), allowes easy changing of the display style from DropList to RadioButtons, altering of the "Apply" button text and a couple of other things.

Its free, comes with full source code, and works fine on the latest Beta2 builds. Thought some others might find it handy too.

If you are after any specific features, I'd be happy to put them in, just send the suggestions my way.

Note: There is other stuff on the download page here for the curious.

More Posts

This Blog

Syndication