July 2003 - Posts

nDoc 1.2 is out

Someone probably caught this before me, but if anyone else missed it nDoc 1.2 (final) was released on the 27th.

Go grab it!

Posted by rlaneve | with no comments
Filed under: ,

Custom Projects / Project Items

I'm always looking for ways to save a bit of time or monotony when it comes to writing code in the office. The majority of our projects are typical corporate apps (read: boring as h*ll), so any little trick that can save me a few minutes and get me on to more interesting tasks quicker is welcome. With that in mind, I began looking at code templates, customizing project items, etc, etc... some time ago. Initially, I was looking for a way to add a custom project item which would add a strongly-typed collection to the current project. I was working on a project that had quite a few collection classes, and re-writing the same code over and over was groing tiring. Sure, it's not complex code, but there had to be a better way. I'm not much for code generators - I'm extremely picky about the end-result of such systems - and at the time (over a year ago) I wasn't aware of any add-ins that could help me in my quest. With a little help from an article by Chris Sells, I was able to get my custom item added to the “Add New Item” dialogue in VS.NET, complete with an HTML-based GUI allowing me to specify the contained class name, the collection class name, whether I wanted the collection to be read-only and a couple of other options. A few key-strokes and a couple of check-box selections later and my strongly-typed collection was added to my project. All in all, I was pleased. Heck, it even had our corporate logo at the top of the GUI.

This evening, I've spent a few hours exploring another type of customization: custom projects. I wanted the ability to click “New Project”, select “Windows Form (AVI)” from the list and have a project generated with a few extra files, a few extra default references and a few settings different than the standard “Windows Form” project. I considered using my previously gained knowledge of the VS.NET projects/items system to just alter the standard “Windows Form” project, but I don't really like doing such things. I did it with the ST Collection wizard I described above and had to “re-do” it when VS.NET 2003 came out (and even lost the customization once when I hosed VS.NET 2002 and had to re-install, forgetting to save my customizations first). So, I started digging. Turns out, it's not that hard.

Adding a sub-key to HKLM\SOFTWARE\Microsoft\VisualStudio\7.1\NewProjectTemplates\TemplateDirs\{FAE04EC1-301F-11D3-BF4B-00C04F79EFBC} got me a new “Project Types” entry shown when “New Project” is selected in VS.NET. I pointed the key's “TemplatesDir” value to a folder of my choosing where I could store my project wizards so I don't have to worry about losing them. I copied the existing “CSharpEXE.vsz“ file and the “CSharpEXEWiz“ folder into my custom folder and then tweaked the vsz file to point to the location of my “CSharpEXEWiz“ folder. This one required the path to be relative to VS.NET's original path, but the error displayed when it didn't work initially was sufficient to figure out what was going on. Getting custom project items listed was pretty much the same process. First, a new sub-key was added to HKLM\SOFTWARE\Microsoft\VisualStudio\7.1\Projects\{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\AddItemTemplates\TemplateDirs\{FAE04EC1-301F-11D3-BF4B-00C04F79EFBC}, with it's name matching the previously added sub-key (”/2” for both in my case). Again, I set the “TemplatesDir” value to another folder of my choosing. Next, I copied the contents of the existing “CSharpProjectItems” folder within the VS.NET folder hierarchy into my custom folder, along with the “CSharpAddClassWiz“ folder. Again, I tweaked a vsz file - this time the “CSharpAddClassWiz.vsz” file - to point to my customized “CSharpAddClassWiz” folder. That's about it!

So now, we can go into VS.NET and, after clicking “New Project”, we will see an “AVI Projects” folder with a “Windows Forms” option (only one for now - probably do a  custom “Class Library” option tomorrow). Starting from that project instead of the default gets us a customized app.config file, a customized AssemblyInfo.cs file, additional “using“ statements and additional references already added. After that, when clicking “Project | Add New Item...” we're greeted by an “AVI Project Items” folder with our customized options available (such as “Class”, which has our standard “using” statements already added, our standard “regions” defined, etc, etc...). I've left out a few of the details on how this is all done, but anyone who's interested is welcome to ask for help. And anyone who's done some customizations like this, let me know about your own experiences.

Posted by rlaneve | 1 comment(s)

.Text - Wow!

Well done Scott! Clean, stylish, great features - a real winner of an upgrade. Keep up the great work.
Posted by rlaneve | with no comments
Filed under:

Vault: A bit slow?

I hate to be the only one with a negative post regarding SourceGear's Vault, but here goes...

About a year ago I first came across the Vault product from SourceGear. I had been looking at their SourceOffsite product, and their site had information regarding their upcoming VSS replacement product. We were using VSS at the time, and desperately needed something that worked better over remote connections. Even with cable/dsl modems, VSS just wasn't cutting it. Unfortunately, Vault wasn't quite ready when we made a decision and we wound up going with QSC's Team Coherence (which, by they way, is certainly a good system and has met most of our needs, not to mention QSC's excellent customer support). Like many posting on their blogs recently, I decided to take another look at Vault. Maybe it's just me, but I don't see how I could deal with it on a regular basis.

After installing the system entirely on my dev workstation - a beefy desktop that already had IIS and SQL Server setup and working - I proceeded to add a small project into Vault as a test. This project was made up of no more than 20 files, all of which were less than 5KB in size. The process was slow. Don't get me wrong, it wasn't unbearable or anything. However, it was without a doubt slower than any other source control system I had ever used. Checking out a single file followed by an immediate check-in also felt slow. I assume this is attributed to the design: the GUI passes the file off to a web-service (which, in my opinion, is always a relatively sluggish technology) running in IIS, which then passes it off to the SQL database. I felt fairly confident that performance would not degrade in a remote scenario, though I did not test this. However, am I really willing to deal with a system that feels "sluggish" during 85% of the time I use it (in the office) just to have decent performance the other 15% of the time (remote)? I don't think so.

So...I'll stick with Team Coherence, which was designed to work over TCP/IP and thus performs very well in remote scenarios (and, btw, costs less), hope they add the features I'm missing soon enough, and resign myself to not using the "latest-and-greatest" built on the platform I build my own systems upon, using the same tools I use myself. I wanted to like it - I really, really did.

Posted by rlaneve | 2 comment(s)

Revisioning DB-related Objects: Is it just us?

Why do we have such a difficult time keeping our database object code under source control and in-sync with what's in production? We've gone through several "policy & procedure" phases already, and not one of them has stuck. They're either too involved, or provide too little benefit to warrant spending any time dealing with. Granted, I'm willing to bet it's just us - we're just being lazy; not granting the db object code the proper "weight"; not treating it as we do standard source code files (C# and the like). Maybe it's because we use completely different tools to manage one type versus the other. We use VS.NET for the "standard" code, and it integrates tightly with our source control system. However, we use a combination of Enterprise Manager and Query Analyzer to work with SQL Server, and it - in no way - integrates with our source control system. True, we could use VS.NET for most of the db-related changes and we've actually tried to on a couple of occassions. But, it just doesn't "feel" right. Are we crazy? Are we just too used to EM and QA? Is everyone else switching to VS.NET for db-related changes?

Please, feel free to comment on your methods of handling your db objects with regard to source control.

Posted by rlaneve | 9 comment(s)
More Posts