Thursday, April 13, 2006

Tonight was a success at the Utah .NET User Group.  Unfortunately we were not being able to get a reminder out to the group due to the site being down (more accurately the DNS server was down, but same difference in that it was inaccessible).  We had a pretty small turnout and a quiet crowd today, but it was fun nonetheless.

I had the opportunity to present on developing ASP.NET controls.  We focused on how to create UserControls and WebControls.  We talked about properly deriving from WebControl, rendering content and controls, utilizing embedded resources (a new .NET 2.0 feature which is totally awesome - I'll blog more about it in a future post), creating ITemplate-based controls server-side.  I've posted the code online if you'd like to download it here.

I'm glad for the faithful who showed up and had a great time and for TEKSystems for sponsoring this month's meeting.

Thursday, April 13, 2006 3:51:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback

For all those trying to hit my blog and view an individual post my apologies that it wasn't working.  I had no idea.  The main page was up and working, but it appeared that when you would browse to a single post the site would bomb with a Null reference exception.  I never got the error because I rarely visit my posts.  Today, however, I had the need to go back and review something I had written and that's when I got the error.  No wonder I hadn't received any comments or ratings for several days.  I wonder how long it had been down...?

Thanks for your patience.

Thursday, April 13, 2006 4:31:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Wednesday, April 12, 2006

We have the opportunity, tomorrow night, to attend a Utah .NET User Group Meeting (please forgive the site for it's horrendously slow performance or outage - we've almost got the new site up which should be MUCH better in so many ways).

Tomorrow's presentation will be by yours truly as a continuation of the last presentation in a series for the Component Developer.  This one is focused on ASP.NET Controls whereas the previous presentation was targeting Windows Forms.  It should be a lot of fun.

If you have any particular requests and questions, please post them here and I'll see if I can't dedicate some time in my talk to answer those questions - it will give me a little more lead time too :)

Time: 6:00 PM, Suite 300 (3rd floor)
Place: Neumont University, 10701 South River Front Parkway, South Jordan, Utah

Here's to hoping it's a good one!  They usually are.

Wednesday, April 12, 2006 2:51:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback

I had the opportunity today to attend a presentation on WPF (Windows Presentation Foundation) focusing on interop; interop between Windows Forms (WF) and WPF.  It was pretty cool.  Though we didn't really get deep into XAML (we just touched on the surface), we explored the interactivity between the two platforms.

A few interesting aspects that the speaker, Mike Henderlight, touched on were the goals and the non-goals of his team (UI Frameworks Client Team, previously known as Windows Forms Team) with respect to WPF.

Primarily, their goal is to provide both design- and runtime-support for building application that allow WPF and WF to co-exist seamlessly.  That is, you will be able to leverage your existing codebase and investments already made in WF and host WPF components thereon (and vice versa).  In addition, ActiveX components will be supported.

They will not, however, via XAML provide a 'general-purpose mark-up solution' for developing WF applications.  They are not, for instance, trying to achieve a WF markup of any kind.  Additionally, no “code migration wizard” is in the works.  Therefore, when creating a WPF application, the developer should consciously be designing for that platform - there's no one-to-one relationship between controls.

Mike went on to illustrate a few example applications which he developed in both WinForms as well as WinFX to host the other platform's controls, perform databinding, etc.  All in all it was a fun, educational presentation.  Thanks, Mike!

Wednesday, April 12, 2006 2:43:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Sunday, April 09, 2006

Today marks the 2 year mark for my blog, and what a couple of years it has been!  There have been 350 posts since it's inception (this being the 351st post overall).  While not as active in terms of posting as I would like to have been over the past couple of years, I feel that some goodness has come out of having the blog.  Many people have found some assistance through their coding and .NET travails for which I am grateful.  Earlier this year I was awarded Microsoft MVP award, which in an of itself was an exciting bit of news.  I have grown too.  Not in height, mind you (I'm still a stable 6'6”), and girth (well, we'll discuss that sometime else), but in experience and knowledge.

Through imparting tidbits of information I come across or solutions and strategies for problems, I've been able to document my progress and see how I've adapted to various situations.  I hope that some of my experiences have been for a greater good and benefitted others.

I eagerly look forward each day for opportunites to submit content to this meager site.  In fact, there have been innumerable occurrences in which I started down the road of typing up a post and then decided to renege and deleted the post in progress because I ultimately thought that the ideas I was putting down were not going to be beneficial.  Perhaps they were stupid (I've been known to post some pretty dumb things in the past) or perhaps not.  Either way, this blog has been a blast to maintain and I hope to continue to do so moving forward.

Thanks to all my loyal readers for your support.  Is there anything that I can do or content that I can add that would make this site better and more beneficial?  Any issues that I might be able to help address or topics you'd like me to cover?

Sunday, April 09, 2006 5:52:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Saturday, April 08, 2006

The other day I started to write a new utility application which, among its various tasks, launches applications as specified by the user.  Typically, the user may enter or browse to a folder such as "C:\Program Files\Some Application\DummyApp.exe".  Passing this path to the Process class's Start() method will then launch the application as in the following contrived examples (which are conspicuously devoid of any error handling code - don't try this at home):

using System.Diagnostics;

// in some class somewhere...
private void launchSomeApp() {
   string appPath = "\"C:\\Program Files\\Some Application\\DummyApp.exe\"";
   Process.Start(appPath);
}

However, suppose the user providing the application path in the following format:

string appPath = "\"%ProgramFiles%\\Some Application\\DummyApp.exe\"";

That path is perfectly valid and typing it at the command prompt will execute the application properly (provided it actually exists).  However, it appears that using environment variables within your path provided to the Process.Start() method it will fail to execute.  Using either the previously mentioned code or the following will yield a "The system cannot find the file specified." error message.

private void launchSomeApp() {
   string appPath = "\"%ProgramFiles%\\Some Application\\DummyApp.exe\"";
   ProcessStartInfo startInfo = new ProcessStartInfo();
   startInfo.FileName = appPath;
   Process.Start(startInfo);
}

You might be tempted to go down the path, to experiment with the EnvironmentVariables property of ProcessStartInfo along with UseShellExecute and others.  This will all be in vain.  Effectively, the EnvironmentVariables property creates a copy of the executing application's environment variables when first referenced.  This provides a means by which the program can edit, clear, add, or even remove environment variables for the invoked process.  Note that these variables are available TO the process as environment variable, not the process invoking the new process as such.  Therefore, they have no effect on the command string.

Well, fortunately, it's not too difficult to overcome.  Built-in to the Environment class is a method which takes a string and substitutes environment variables for you.  Now users of this utility application can specify paths however they see fit (using environment variables or not), and the application will continue to work as expected.  Simple.  And saves me from having to write my own 'Environment Variable Expander' method.

private void launchSomeApp() {
   string appPath = "\"%ProgramFiles%\\Some Application\\DummyApp.exe\"";
   ProcessStartInfo startInfo = new ProcessStartInfo();
   startInfo.FileName = Environment.ExpandEnvironmentVariables(appPath);
   Process.Start(startInfo);
}

Saturday, April 08, 2006 6:01:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Wednesday, April 05, 2006

Attention ASP.NET 2.0 Developers:  The Release Candidate 1 (RC1) of the VS 2005 Web Application Projects (WAP) has now been released.  If you're like me and prefer the 'old' 1.x style of ASP.NET applications (with namespaces, more intuitive folder hierarchy structures, a \bin folder, and much more), you'll really enjoy this.  WAP brings that style of website development to VS.NET 2005.  I've been using WAP since early Beta 2 and despite a few beta-related issues have really enjoyed it.  I'm looking forward to some of the new enhancements and fixes!

Read more about it on Scott Guthrie's blog.

Wednesday, April 05, 2006 6:20:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [1]  |  Trackback

My faithful one or two readers out there may have noticed that I've not updated this blog much (if only very sporatically) lately.  This was not for lack of desire, but more accurately for lack of time.  Additionally, for the past week I've really been facing a very difficult decision that pretty much consumed all thought processes and I've not had the energy to devote to adding more content.  I will work harder at that.

My turmoil and deep introspection revolved primarily around whether or not I should leave my current employment (I am full-time engaged and committed to Experlogix) or rejoin the ranks at Microsoft.  Those that know me are aware that I used to be employed by Microsoft in the capacity of Consultant - something I deeply loved and thoroughly enjoyed on so many levels.  I was in MCS for a little over two years and had the wonderful opportunity to get to know some really great people, and learn a TON, and be genuinely influential in my client engagements.  What a wonderful few years.  I have since left Microsoft to pursue other endeavors but always had my heart in Microsoft, thinking full well that I would be back there again one day.

That opportunity presented itself a few weeks ago in the form of a formal invitation to come back.  I would, of course, have to be screened and interviewed as all hires do.  I had a pretty intense day of interviews (though not quite as intense as it was on my first go around) in part because I knew the people interviewing me (some better than others) and had worked with some of them on projects.  Well, it turns out that I got an offer...a very good offer as a Senior Consultant.  One that made me really evaluate my position with Experlogix and my future as well as reflect back on Microsoft and the opportunities there.

I spent four days seriously considering all of the options, literally wracking my brain.  I have a great situation with Experlogix and I work with some wonderful people.  Would I be willing to give that up?  I truly felt that I was presented with two great options, neither of which would be a 'wrong' choice necessarily for me personally.  It came down to contemplating all of the pros and cons and seriously weighing all of the possibilities as well as what I want out of life.

I'll not really beat around the bush here, but I decided to stay and continue on with Experlogix for a variety of reasons, not the least of which is that I really believe in our product and I believe in our future.  I didn't want to give that up and deliver a blow to the company by leaving, as I feel I would sorely be missed.  Technically, no one is irreplaceable, but I felt strongly that my participation going forward coupled with my devotion to them in the past and the committments that I had made outweighed anything anyone could offer.

I really wanted to accept he Microsoft offer, but at the end of the day, I felt that staying with Experlogix was the right decision and one that I will be able to live with very happily and with a clean conscience at this stage in my life.

Wednesday, April 05, 2006 5:08:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [3]  |  Trackback
 Tuesday, April 04, 2006

I'm really sad that I missed this conference.  Every once in a while a conference comes around that provides tons of actual and applicable value to the industry that no one should miss.  This particular conference seems to be (pardon the pun) overflowing with rich content and practical information.  I hope there's a Waterfall 2007...I'd be there in a heartbeat.

These seem to be highlights, sessions I would love to attend:

Kent Beck: “wordUnit: A Document Testing Framework“
Jean Tabaka: “Eliminating Collaboration: Get More Done Alone”
Scott Ambler: “The Glacial Methodology Workshop: A Data-Centric Software Development Process”

Tuesday, April 04, 2006 5:02:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Saturday, March 25, 2006

I was updating some code today in ASP.NET 2.0.  The code had originally been written in ASP.NET 1.1 and I'm in the process of migrating the application 2.0 in piecemeal fashion.  I'm doing it thus, in part, to experiment.  In doing so, I encountered an interesting situation that I thought to pass along to my faithful reader.

First of all, allow me to back up a bit to address a few of the issues that have some bearing on the discussion.  I have a web service that I built for user authentication.  I call it my Devstone Authentication Engine.  This web service has a custom SDK that provides functions that call the services, effectively isolating the dependent application from the nuances of setting up web references and associations.  The calling app simply establishes a reference to the SDK dll and we're good to go.

Alright, well, that SDK dll uses Reflection on the calling assembly to discover information about the system to which the user is authenticating.  I like this approach.  I have a custom Attribute-based type that I apply to the client application in question.  When the client application attempts to use the SDK dll, it reflects back on the caller to determine the desired target.

To be honest, this was all well and good in .NET 1.x.  You could build a Web Application, compile the entire site into a single assembly (MySite.dll) and call it good.

ASIDE

The rules changed with .NET 2.0, however.  The compilation model is substantially more complex; heck, the programming model is (IMHO) a bit more complex because it is much less structured.  (I know I'm not the only one who doesn't really care for the App_Code, no-namespace programming model.  I'll discuss that more in depth another time.)

To address these and many other concerns expressed by developers moving to the 2.0 Framework who were comfortable with the 1.1 programming model Microsoft has created what are called Web Development Projects.  If you're comfortable in the .NET 1.x programming model but want the power and flexibility of the 2.0 Framework, I highly encourage you to download the Beta V2 and experiment with it - it's pretty sweet!

In 2.0, however, when each page/folder/whatever gets compiled into its own dll, the attributes applied in the AssemblyInfo.cs don't get incorporated into each dynamic, on-the-fly assembly.  Therefore, calls to the web service SDK fail because it can't find an instance of the attribute within the calling assembly via Reflection.  If you set a breakpoint and inspect the assembly name you get the name of a dynamically created assembly (e.g. App_Web_y7sgdlhd.dll). 

The trick with 2.0 is simply to move the [assembly: myattribute()] from the AssemblyInfo.cs into the same page as the ASPX page that needs to call the web service. Then, when the runtime compiler grabs the file and compiles it, the [assembly:...] attributes get applied to the dynamic assembly as well.

Saturday, March 25, 2006 2:50:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [3]  |  Trackback
 Thursday, March 23, 2006

Today I'm off to Dallas, Texas for Microsoft's Convergence Conference 2006 with Experlogix.  We've had the annual tradition of attending these conferences showcasing our software in the expo hall and each year it's been a blast!  We are very much looking forward to meeting the various Microsoft Partners, talking to the Microsoft CRM team, and interacting with customers.

If you're going to be in Dallas and/or are going to be at the conference, drop me a line and let's get together!  I look forward to a fun weekend!

Thursday, March 23, 2006 3:40:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback