Friday, March 04, 2005

Team Development with ASP.NET Multiple Projects

I thought I'd share my little setup with the world. I have been googling my ass off trying to find out the best way to do what I need done, but I haven't had much luck.

Basically here was my problem:
  • Multiple Developers accessing the solution -- need multiple projects (this was before source control -- yuck).
  • Different components in VB.NET / C# (can't combine languages until 2.0)
    • the previous code used single file aspx pages...(double yuck)
    • need to maintain common directory structure as on live server
Now I read a solution somewhere that just said to keep adding projects underneath your web projects root directory, and remove the "application" in iis, remove global.asax & web.config and you're good to go. But wait, when you compile it leaves the .dll in the local \bin folder. I tried to set the output directory to the root bin folder, but Visual Studio didn't keep the changes. In fact, when I clicked apply it just reverted to "\bin" instead of " ..\..\bin"
I recieve a (stupid) suggestion from a website to add each project as a reference in the main project -- well this caused all 10 projects to be built each time I compiled... yuck.

Finally, after a few problems of not being able to debug certain dll's, I started at the solution again. Jason Olson recommended I try editing the project file directly with notepad. DAMNIT why didn't I think of this in the first place?!?! It worked like a charm! I'm not sure why Visual Studio compained about the output folder in the first place. In any case, I have been so used to just building all of the projects each time I wanted to compile, that it feels like the build speed is lightning fast!
Saturday, February 26, 2005

annoyances while combining VB.NET and C#

I ran across this annoyance today, probably a bug in Visual Studio. I have a custom collection that encapsulates an arraylist, and it basically has 5 different overloads for the Add() method.

well this is written in VB.NET, while 1 of the instances of this class is in C#. When I added a new overload to the collection, I named it add() instead of Add() (VB.NET takes the first declared name as the correct case usage for variables and methods, so my other methods were changed as well, but the compiler doesn't actually show this change unless you visit the line again -- and hit a carriage return).

My C# project complained no method named Add() existed. Hrm, so I use intellisense to find out that the method is now called add() -- weird. So I change it to add() to get it to compile, then go fix it.

Well the compiler this time complained that there didn't exist an add() method. Ok, now I'm a little upset. This is just stupid. The compiler is obviously confused. I go back in to the VB.NET project, fix the case to read Add(), and I get ANOTHER compile error. This time saying that there was no Add() method. Arg!

Viewing the object in intellisense must've slapped VS back into shape because it showed the correct method: Add(). Rewriting the line verbatim solved the problem and compiled just fine.

Ahh, that's why they say, "Where do you want to go today?" (one of my old professors used to say that....)
Monday, February 21, 2005

I swear I'm the last to know everything....

I must be really out of the loop. Even searching on google before I never ran into this until yesterday: NUnitASP. What a cool extension. I must've been searching on the wrong terms because it's been out for over a year. Anyway it lets you grab pages and test things with full HtppContext so you can really test the front end behavior and be confident in your pages.

Anyway, if there exists such a soul that has not heard/used ASP.NET unit testing before I suggest checking out NUnitASP. There's a pretty easy-to-follow tutorial at http://www.theserverside.net/articles/showarticle.tss?id=TestingASP

Now to write tests for my 100+ pages... /quiver

(on a side note I'm still looking for some practicle examples of testing my class library code with NUnit... I'm missing the bigger picture I think, but how can I easily test a class library that almost primarily deals with database interaction?? )
Tuesday, February 15, 2005

Empires: Dawn of the Modern World

Empires: Dawn of the Moder World

I am ADDICTED to this game! I played the original Empire Earth for a really long time, and this is a pretty good sequel.

One really cool thing is that Empire Earth 2 is coming out pretty soon, and it looks like another good addition to the series. The original EE will probably be offered free from Sierra once it hits stores, so keep an eye out for that.

Playing these types of games makes me think of how good of an example they are for good object oriented design and opportunity for lots of design patterns. I really think a game like this is over my head at the moment, but it's nice to have something to strive for.

Most resell shops will have this game for about $10-$15, so pick it up... it's good.
Saturday, February 12, 2005

ASP.NET Enterprise Environment

I have been reading a lot about agile practices lately, sopping up as much information I can get my hands on. I'm hooked. I knew immediately that these practices would benefit me at work. The problem is that these are geared towards general development. Web development is slightly different, and it poses some problems with source control, unit testing, and other things...

For source control I setup Subversion on our test server, then installed Apache to serve up the repository over http. It uses WebDAV and Apache permissions to identify the user. As many people know, the subversion admin directory (.svn) doesn't play well with Visual Studio .NET Web projects. I think it has something to do with FrontPage server extensions, but whatever. Anyway, there is a modified version of TortoiseSVN availalable that can convert this to a more friendly (_svn) directory. Beware of using this though... other tools will not work if you use this method. For Visual Studio integration I am using AnkhSVN (which you can configure to use _svn directories). This works very well, however it's still not idea. Here's why:
I frequently run into commit conflicts on my .dlls, .suo, and .pdb files. This really doesn't matter since the .dll's will be recompiled, but it gets quite annoying. I'm really looking on a better way to manage my directory structure to easily omit these files from the source control. (I'm thinking that NAnt may help me setup a different structure, but I haven't messed around with it yet)

For unit tests, it's quite difficult to implement in a web environment (at least it appears to be). One thing I quickly realized is that most of our logic was residing directly in the page. Obviously, this is not desirable so I started work on a robust class library (which is coming along quite nicely now). But how do I write unit tests for code that inserts data into a database? Should I insert, then check to see if the data was inserted? I can easily see this doubling my work. Almost ALL of my code is database interaction.

I have also started configuring CruiseControl.NET to do some continuous integration on my repository. This is waiting on a few other factors, but is the next step in improving my development environment at work.

I know I'm on the right track, but I am not finding enough good resources specific to ASP.NET development with architecture, directory structures. I'd love any advice on how to improve in these areas, maybe some book recommendations.... Thanks!

Categories

When is Blogger going to supporting Post Categories? It's one of the neater features of .Text and Drupal (2 other other blogging platforms that I have used.)

It would serve as a tool for people to ignore my non-technical posts if they were so inclined. (Wait, who in the hell would wanna do that?!?!)

File this under: Blogging!
Friday, January 14, 2005

Pass-Phrases are the new thing

Well, this link is hardly new, but it's link-worthy nonetheless. This is a very interesting article on password security.

Robert Hensing's Blog on Passwords
Sunday, January 09, 2005

It's that time again - System wipe

Like many computer power (read: nit-picky) users, I find the need to reformat my machine just about twice a year. This time around I have been lazy and it has been 9 months since my last reformat. This is mainly because I have been utterly dependent upon it as a server.

I have been developing applications in PHP that were being shown to different clients, and it seemed each time I was about to finish a project, another one came right along.

I also started a couple ASP.NET projects and was becoming very dependent upon my computer (well, a little more than usual).

To top it all off my computer serves media content to my xbox, whicch I also didn't want to interrupt.

I finally realized that I was NEVER going to get a break from being dependent upon my computer, so tonight I will reformat. After this install I plan to "ghost" my hard drives and make a set of restore cd's. I have heard this is a great tool for many people, but my computer is rarely in a position where I want a "snapshot" to always return to. This will be my opportunity to do that.

To make my restore state the most useful in the long run, I have written down all the software I want to have on it. Good god! No wonder my system is so damn slow! I hand-wrote an entire page of software titles that I will be installing.

I might as well list it out and explain why I like each piece of software... maybe someone will find it useful. Or maybe you can post a comment making fun of me. In any case, this is my blog NOT YOURS!

.....sorry, got a little carried away. Where were we? Ahh, yes.. the software list, complete with comments.

My OS is WinXP Pro, for reasons that are probably obvious. Pretty much the only things I do are play games, develop in .NET and mess with DirectX... enough said.

Security

(these days it is a must to install these programs first! Think how dangerous it could be to visit 1 site without anti-virus / anti-spy with a stock version of IE.... /shudder)
  • McAfee Enterprise 7 - far better than Norton imho...
  • SpyBot - It's free and catches more than Ad-aware
  • Ad-aware - well, Spybot isn't perfect.... any suggestions on replacing these 2 with one all mighty Anti-Spy solution?
System


  • DirectX 9.0c SDK - For my ventures in game programming with the awe-inspiring Managed DirectX
  • .NET 1.1 - For my managed development
  • PHP - cuz a little side money from Rent-a-coder never hurts.
  • IIS - for asp.net and php
Databases


I use 2 because I have to develop for different target database servers.
  • SQL Server 2000 (for asp.net stuff)
  • MySQL (for php)
Development


  • Microsoft Visual Studio .NET 2003
  • Dreamweaver MX 2004
  • EditPlus (though dreamweaver has better builtin ftp support)
  • SQLYog (free!) (wonderful tool for MySQL
  • Enterprise Manager / Query Analyzer
  • Subversion (best source control I've seen)

Visual


  • StyleXP (lots of clean visual styles out there) (i just recently learned that stylexp only hacks the microsoft dll to provide unsigned styles. The same thing can be accomplished with a manual hack. WindowsBlinds has their own dll for skinning, so I'm testing that out. I also got a copy of RoyalXP (the 2005 MCE style -- nice!)
  • Customize.org (for wallpapers)
Media


  • Windows Media Player 10 (though it's pissing me off to no end)
  • Winamp 5
Burning


  • Nero
  • Alcohol 120%
  • Daemon-Tools (for mounting images)
  • CloneDVD
I'd like comments. I'm always on the lookout for more good software to bloat my machine!