Saturday, March 26, 2005

A JAVA iron lung

I was installing MSMoney 2003 this evening and happened to scan thru the EULA when I came across this section that I find particularly funny:

9. NOTE ON JAVA TECHNOLOGY. The SOFTWARE PRODUCT may contain support for programs written in JAVA. JAVA TECHNOLOGY IS NOT FAULT TOLERANT AND IS NOT DESIGNED, MANUFACTURED, OR INTENDED FOR USE OR RESALE AS ON-LINE CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING FAIL-SAFE PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF JAVA TECHNOLOGY COULD LEAD DIRECTLY TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE. Sun Microsystems, Inc. has required the inclusion of this disclaimer.

Friday, March 18, 2005

Eric Sink's Source Control HOWTO

Eric Sink (founder of SourceGear, maker of Vault) has been writting and is finishing a splendid Source Control How To. He makes some very good comments regarding how must programmers/developers learn what they need to program but are never taught the tools that developers use in real-world software environments (project management, bug tracking and , most importantly, source code version managment).

Thursday, March 03, 2005

Overriding web.config app settings with user.config

Some time ago, I was in a situation where I wanted to set local application settings for a web application I was developing to some alternatives without messing with the project's copy of the web.config file. So I'd change my local copy by making it writable (normally the file was read-only because it is under source control). Every time I'd get latest version for the project it would either overwrite the file (if I forgot to leave the local copy) or I'd have to merge any changes manually.

Then I came up with this clever idea to have a little change script which would tickle the XML nodes of the web config file so I could just run that every time I got latest version. But it still was a pain because I had to remember to perform this action or it was more difficult to maintain.

Well, I just learned that .NET has a built in solution (that wasn't very well publicized apparently). Apparently, you can place the attribute [file="user.config"] in the web.config file and it will point to that file for application setting overrides. So you could then create that file in the application directory to hold your personal overrides for the default app settings. The file should look like this:

<appSettings>
<add key="key" value="value" />
</appSettings>

Note that 'appSettings' is the root node. The user.config file does not have to exist. .NET will just ignore a missing file and use the default values in web.config.

If you do create this file make sure you do not put it into the project (and, thus, source control) so as to avoid overwriting individual's settings.

I found this in the MSDN article: Team Development with Visual Studio NET and Visual SourceSafe - Chapter 4: Managing Dependencies

There are lots of other details in there that are helpful to know if you are building software in a team environment.