Archive for January, 2006

Visual Studio 2005 RTM (Release To Manufacturing) sits on my desktop. So does the 2.0 version of the .NET Framework. And ASP.NET 2.0 is humming away on my http://localhost. Last, but not least, the Patterns & Practices studs released the finished version of the Component UI Application Block. I have all the tools at my disposal, finally, to begin work on our internal applications. All is right with the world, or so it seems…

Then I discover there’s a December CTP (Community Technical Preview) available for Indigo, now named Windows Communication Foundation (WCF). I’ve been following Indigo from a very peripheral view, and hoping to use it in our next generation of business applications. The previous solution I had set on was .NET Remoting, since we have 100% control over the server and client code, and don’t have to worry about providing public services to be consumed by outside sources using other technologies. Still, I wasn’t sold on that being the ideal solution for all our needs.

The idea that Indigo/WCF was going to combine all of these methods and technologies under one roof appeals to me greatly. It also conjured up lines from the Lord of the Rings…

One Ring to rule them all, One Ring to find them, One Ring to bring them all and
in the darkness bind them.

I saw the December CTP release of WinFX as a real opportunity to dive headfirst into Inigo/WCF and utlize the latest technology for our services protocols. I could scrap all of my old plans to use .NET Remoting, and combinations of Web Services and Enterprise Library, and instead utilize one namespace for all my needs. Pick the best tool for the job and move on. Sounds great, right?

There’s just one problem. After installing the WinFX Runtime, building my Service Contract, and hosting the thing in IIS 6.0, I get the following error message:

system.ServiceModel error

Normally, this is where Google saves the day. And sure enough I found what appeared to be a solution on Brenton’s blog. Unfortunately, even after running xws_reg and getting the proper configuration on my machine.config file, I still get the same error message.

Arg.

So, if anyone knows how to solve this problem, please advise :) My fingers are aching to code up some samples with WCF.

Update

Turns out that system.serviceModel is case-sensitive. I had it as ServiceModel. That didn’t immediately fix the problem though. A repair was necessary. I re-ran the WinFX install and selected Repair. After that it worked. So my recommendation is, if you can’t get it to work, try and run a Repair on the install.

We just recently converted a small, internal web application from ASP.NET 1.1 to ASP.NET 2.0. We didn’t convert it because we wanted to; we did it because I’ve recently switched to the RTM release of VS.NET 2005. A bug was found in the application and needed to be repaired, and I had already nuked VS.NET 2003 off my machine. Oooops! No going back now.

So, I decided we might as well convert the app to ASP.NET 2.0 and move forward. The conversion process was fairly easy and stress-free, and the app ran great on my http://localhost server. The whole thing was rolling right along, up until we transferred files to the web server and the darn thing puked.

The error was what shocked me. I’ve done ASP.NET development since Beta 1.0. and never have I seen an error such as this. ASP.NET was telling me that I didn’t have a reference to a class that I wrote!

Huh? But I compiled the darn thing. The application’s .dll is on the server. What’s going on here?

Turns out that ASP.NET has a few new compilation and deployment methods, and by default it builds your application in such a way that you need to copy the source files to the web directory.

Yes, you read that correctly: the source files, uncompiled. My C# codebehind files (now called codeFile) had to be transferred to the server uncompiled, in plain old text, in order for the app to run, because ASP.NET wanted to compile things on-demand.

Like that’s safe.

I don’t know about anyone else, but the thought of my source code sitting on the server in uncompiled form makes me shiver like a sissy-boy at Rikers. I don’t care how good IIS thinks it is a not serving those pages, hackers are incredibly creative. What would it take, exactly for someone to get access to my code, change it, and upload it back to the server? Do I want to find out?

I don’t think so.

Fortunately, as paranoia was setting in, my natural instinct to scour the internet for solutions kicked in and I found this bit about ASP.NET’s compilation choices. Turns out there’s more than one way to skin this cat.

Normal (ASP.NET 1.x model)

Code behind files are compiled into assembly and stored in the /bin directory. ASPX files are compiled on demand.

Deployment Pre-Compilation

This is the new feature of ASP.NET 2.0 allows for full compilation of your project prior to deployment. In the full compilation, all code-behind files, aspx pages, HTML, graphic resources and other back-end cide are compiled into one or more executable assemblies. This compilation method provides greatest performance and security but disallows ability to modify the web site post-deployment. This compilation is suitable for highly secure web sites. This will not be suitable for a site which changes frequently.

Full runtime Compilation

ASP.NET 2.0 provides a new mechanism to compile the entire application at runtime. You can put your uncompiled code-behind files and any other associated code in the new \app-code directory and let ASP.NET 2.0 create and maintain references to the assembly that will be generated from these files at runtime. This option provides flexibility in terms of changing the web site content .

Pre-Compilation. Oooooh. I’m giddy! Perfect, exactly what I was looking for. And the good news is, with VS.NET 2005 you don’t have to resort to any command-line typing to make it work (Yeah, my old Linux self is calling me names, saying I’m “weak”, but whatever – GUI’s are king, so shut up and sit down). Simply Build -> Publish Web Site, and bingo: all done. VS.NET deletes all the old files in the web directory and replaces them with the new precompiled ones. No plain text source code, just precompiled binaries. Faster. Safer.

I feel better already.

If there’s one disadvantage to living in the sticks/outback/wild-America, it’s internet access. For some people this isn’t really a problem, but for me – Mr. Everquest, he of the many hours playing online games – this is disasterous.

It has become particularly problematic in the past weeks. My avatar in EQ2 has reached a high enough level to start “raiding” with my guildmates and friends. You can think of raids as the ultimate teamwork experience. Most of the time I spend online playing Everquest 2 is with a very small group of people, usually 2-6 players, or by myself. We journey together working on quests, slinking our way through dungeons, slaying ugly monsters and marveling at the neat loot.

Raids are a different deal though. They are big events, targetted toward (typically) 24 individuals, all working as a team, trying to defeat super-nasty creatures (think about the Balrog in Peter Jackson’s The Lord of the Rings and you’ve got some idea of what we’re trying to defeat).

I loved raiding in the original Everquest. It’s the ultimate team effort in online gaming. The creatures you set out to do battle against typically are very unique, and have all sorts of different strengths and weaknesses. Defeating these “boss” monsters requires a lot of planning, strategy, tactics, and precise execution of a plan. It can also be a very difficult job to try and lead 24 (or more) people, many of whom have no military experience, or even team-sports experience, and get the job done with the precision necessary. When you win, with these odds, there’s a real sense of satisfaction.

The problem is, if your internet connection sucks (like mine does) then even participating in these events can be an exercise in pure frustration; not just for me, but for the entire raid.

This week I did some of my first raiding in Everquest 2 that required 24 players (the max allowed in an Everquest 2 raid). The network lag was so bad that on several occasions I would press a button to make my character perform some melee attack, only to watch with sheer disappointment as my character failed to execute that maneuver for over two full minutes. The delays were unacceptable, and it made me a liability on the raid. It also was just plain unfun.

In an effort to try and alleviate the latency problem involved with playing on a 56K modem that only connects (even on its best days) at 26.6, I decided to do a little investigating on the internet to see what broadband options were available to me.

That’s when I found this site: DSLBroker.com. Enter your phone number and a state, and they’ll tell you what options are available to you, and link you to the proper company for purchasing choices. Sounds great! Let’s fire it up!

Results returned: There is one option, Satellite Internet by Earthlink.

No other options. No DSL. No Cable Modem. No wireless. And to top it off, satellite internet isn’t good for gaming, specifically games I play. Check out the FAQ from Earthlink:

Any signal you send from your computer via satellite has to travel over 44,000 miles to space and back again in order to deliver your information, and because of this, Satellite products have a degree of latency. Latency is the time it takes for a signal from your computer to reach its destination and then for the response to flow through the satellite back to your computer. Therefore, certain time-sensitive applications are not recommended for use with EarthLink Satellite, powered by DIRECWAY:

  • Real-time online games that emphasize reaction time such as Quake, CounterStrike, Diablo, and EverQuest.

They even name Everquest specifically. Ok, so I’m playing the second generation of Everquest, EQ2, but it’s even worse than it’s predicessor. I remember raiding in Everquest with a 28.8 modem and being fine with 100 other players in the area. But not in EQ2. Twenty-four players and a few monsters and my network latency gets so bad I can click a button and watch an episode of CSI before anything happens.

It’s disappointing. Utterly disappointing.

I wonder if we’re ever going to see acceptable high-speed broadband access out here, in the Land of the Lost…