Welcome!



I'm a software developer. Currently, I spend most of my time writing .NET code (Windows Applications, Web Applications, Windows Services, and now Games for XBox 360). Some of those also require a good deal of SQL, HTML, & JavaScript. I've been programming in various languages and platforms since 1982. This blog is where I've started posting a few of my programming experiences and tips to problems that at one time or another, caused me problems. I hope some of these tips can be useful to you.


Please visit my online store: www.MichaelsAttic.com.


Sunday, June 07, 2009

Dish Network gift cards

Occasionally I’ll have a gift card or something that I can’t use myself, but that I’ll get a discount on my own service if someone else uses it.  I’ve got 2 one-time-use gift cards from Dish Network.  The images are below.  To use either of them, follow the directions I’ve posted just below them.  If you don’t mind, let me know once you’ve used one (and which one) so I can take it off this blog.

GiftCard1 GiftCard2

DishNetwork Gift Card (copied from the text on the back of the cards):

This special Gift Card entitles you to DISH Network Satellite TV for the whole house
(up to 4 rooms) with Digital Advantage including:

• FREE Activation w/ Gift Card (a $99 value)*
• $80 CREDIT on your first bill*
• FREE HBO* and Starz for 3 months (up to a $66 value)*
• FREE HD DVR Equipment Upgrade

Visit your local participating Retailer or call 1-800-920-GIFT (4438)

*Requires 24-month commitment.
Early concellation fee applies.
Expires 1/31/09.  No cash value.
Includes Standard Professional Installation.
Gift Card may be valid for other promotions.

Monday, March 02, 2009

Deploying a Click Once app to multiple environments

Problem:

You can't move a "Click-Once" deployed application from one environment (or server) to another.

Details of problem:

If you work in a normal IT shop, you probably have multiple, duplicated environments set up for your code. For example a typical set of environments would be for:

1. Development

· Used by the developers while developing their code.

2. Staging/QA/Testing

· The developer usually places (or requests System Admins to place) their release candidates here for users to test and validate.

3. Production

· Once the users have validated the release candidate in the staging environment, the system administrators are asked to move it to production or the "Live" environment.

Each of the 3 environments usually have duplicated database servers and web servers, and potentially duplicated network shares and any other resources needed by an application.

If your work environment has good security procedures put in place, your developers probably don't have access to make changes to the staging environment and they almost certainly don't have access to making changes to the production environment. This is a win-win for everyone involved: It makes those in charge of IT security happy and it gives the developers plausible deniability when something goes wrong in an environment that they don't have access to.

Most web applications are deployed, usually by the developer, to the development environment. Once the developer is happy with the code there, they will ask the system administrators to move that code to staging. The key here is that it's the SAME binaries that the developer put in the development environment. The system administrator will likely make changes to the web.config file to change the database connection string(s) to point to the staging database(s) instead of the development one(s) and any other config changes needed to make the staging code use the staging resources and not the development resources. This connection string, for security reasons, is usually not provided to the developer. Later, after users test on staging, the system administrator will then move that same code to production, making the appropriate changes to the config files.

This process of moving the same binaries from environment to environment is critical to ensuring that what gets moved from one environment to the next is the actual code that was tested in the prior environment. Hence the problem...

To deploy a Click-Once application, you have to provide, at build time, from within Visual Studio, the URL from where the end users will be launching the application. YOU CANNOT CHANGE THIS AFTER DEPLOYMENT!!! This means, the deployment model described above, that is in common use, cannot work with a Click-Once deployed app. Once you build and publish from Visual Studio, the "launch from URL" is in the deployed files and the deployed files are CRC'd as part of the Click-Once deployment. When a user runs the application, one of the first things that happen is that the .NET Click-Once technology on the end user's machine kicks in and validates that all the files are in the original condition they were in when deployed from Visual Studio by validating the CRC. If it detects that a config file (or any file) has been altered, it throws a security exception and will refuse to run the application.

The "Solution":

I put the word "solution" in quotes to imply that this is not really a solution. It is a work around that does not resolve the problem of needing to deploy a single binary image from environment to environment. Only Microsoft can fix that problem. Instead, this is a description of how you have to deploy to multiple environments and the deployment changes your system administrators will have no choice but to adopt. This is not a preference, but a technical requirement. There is no alternative with Visual Studio 2008. I have been told, BTW, that this will be fixed in Visual Studio 2010.

Here's what you do:

After you've deployed to your development environment, take a snapshot of your code in whatever method you prefer; whether that's making a copy of the entire solution to another sub-folder, or checking it into your source control repository and labeling it, or whatever other method you can concoct. You must do this because later, when you deploy to other environments, a significant amount of time may have passed and you may have continued on with developing newer features and your code will not be the same. You'll need the older snapshot to rebuild to the staging environment, then again to the production environment.

Later, after your own testing in development, when you're ready to deploy a release candidate, you'll need to rebuild from that snapshot codebase, but making only the appropriate changes to make it build for the new environment (the "launch from URL" and the config file changes). Then again, some time later, after the users have tested and validated the staging code, you'll need to rebuild again for the production environment, using that same snapshot, making the appropriate "launch from URL" and config file changes.

Alternate Solution:

Note: Most system administrators would not want to do this alternate solution, but it is a more secure strategy and removes the blame for differences in environments off your shoulders.

Pre-requisites:

· The system administrator who will be performing the move needs:

o The same version of Visual Studio you used to create it.

o All of the 3rd party and custom add-ons (like Telerik, LLBLGen, Oracle, DB2, or other database Providers and drivers, etc...) installed and configured.

o Access to your source control system or a copy of the snapshot of your source code.

o Knowledge of how to build and deploy Click-Once applications using Visual Studio.

o A compilable, error free, snapshot of your code.

1. When you ask the system administrator to move your code from dev to staging, you instead provide them with your snapshot of the source code, whether it's a labeled version in your source code repository or a copy in a folder somewhere.

2. The sysadmin then configures, builds, and deploys your code to the staging environment.

3. Later, when the users have validated your staging deployment, you then ask the system administrator to redeploy that snapshot to production, where the admin will make the necessary config changes and build and deploy to production.

This actually requires less work for the developer, is more secure, and gives a little more insurance to the customer that what they tested is actually what's being deployed to production. At the very least, it removes the blame off the developer's shoulders if something is changed between environments.

Friday, January 30, 2009

Quicken 2009 Bugs

This is just an online, public bug report about bugs in Quicken 2009. I’m hoping that publishing them will quicken (pardon the pun) Intuit in fixing them.

  • When setting up a new credit card account to download transactions, after it’s successfully connected, the “Account Setup” dialog box has some display problems and looks like it’s hiding some information:

image

  • Renaming Rules: This is quite an annoying bug. I personally do not want Quicken to rename my payees, yet there seems to be NO WAY to prevent Quicken from doing so. I participated in 3 online tech support chats and 2 call-back phone support incidents in the last week. NONE of their suggestions worked AND they refuse to accept that this is a bug. Here’s the problem: When you download transactions using PC Banking, then go and accept your transactions, Quicken will suggest renaming rules… actually, it will DICTATE renaming rules. You cannot tell it “No”. Furthermore, the dialog box that pops up informing you of the new dictatorial renaming rules being forced on you, has a check box that says something like “don’t inform me of renaming rules again”. There are 2 problems with this. 1. I believe that checking it only causes to Quicken to not inform you of new renaming rules, but it’ll still make new renaming rules. You only have 2 buttons “Apply” and “Cancel”. If you click “Apply”, it’ll apply the rule(s) that it’s showing you. I think that’s the only way to enforce the checkbox for “don’t tell me anymore”. If you click “cancel”, you’re canceling the dialog box and therefore canceling your check box “don’t tell me anymore” which means it’ll continue to tell you. Also, canceling the dialog box does not prevent it from enforcing the rule.

I’ve spent about 4 hours with tech support over the last week trying to undo this. There’s a dialog box buried in the app where you can tell it don’t create new rules. It was already configured to NOT do those rules, yet it does them anyway. This is clearly a bug and Intuit needs to step up to the plate and admit it and fix it. I’ve been reporting this bug since Quicken 2007. I skipped Quicken 2008, so I can neither confirm nor deny that the bug is in Quicken 2008, but I’d assume that it’s there as well.

Saturday, January 24, 2009

Intel DG33FB Motherboard stalls for 2:45 minutes when booting - SOLUTION!

Usually I've got programming posts here, but occasionally I'll rant or post a solution to a problem that's just computer related and not programming related. This is one such post.

PROBLEM:
I've been experiencing a painfully slow boot process even though I've got a pretty powerful system at the time of this writing (2008-01-24). I've got an Intel DG33FB motherboard with a processor with 4 cores (an Intel Core2 Quad CPU Q6600 running at 2.4Ghz) and 4GB of RAM, plus other, non-boot time relevant hardware added. The problem is the motherboard would stall for 2 minutes and 45 seconds BEFORE attempting to boot from a drive.

To add insult to injury, not only does the motherboard stall for 2 minutes and 45 seconds BEFORE it even attempts to boot from any drive (this means you can't blame Windows), then after Windows starts booting, it then stalls for ANOTHER 2:45!!! I had presumed that it too was waiting on some sort of hardware response from the motherboard since the timings were awfully suspicions. So, that means I'm waiting for 5:30 for ABSOLUTELY NOTHING! This doesn't even count the actual Windows boot up time.

So, I did what anyone else would do. I Google'd for a solution. I found many blogs and posts from other users experiencing the same problem. Few found a solution. Several had contacted Intel and Intel didn't know what the problem was. So, I went to the Intel site and searched for a solution to the problem anyway. I did find that the latest BIOS update (1/5/2009) addressed a "slow bootup" problem, so I downloaded and installed it. No luck. Other blog posts were saying that they fixed the problem by down-grading their BIOS to an older version. For some reason, Intel found and fixed this problem, then intentionally removed the fix from subsequent BIOS updates. I wasn't real keen on downgrading my BIOS. Sometimes there are bug fixes for some serious stuff... even more serious than a painfully slow boot up.

I decided I'd try ONE LAST thing before I went the route of downgrading my BIOS. I shut down the PC and unplugged EVERYTHING. And by "everything", I mean all my internal hard drives (3 of'em), my DVD drives, all my USB devices (including keyboard and mouse), my FireWire devices, and my network cable. The only things left were my video cable and audio cables (all analog output, so virtually no chance that they were causing problems). I turned on the computer and low and behold, it only waited about 19 seconds at the same spot it was stalling at before. So, I've determined it was an external peripheral somehow causing a problem. So, I plugged all the USB cables back in, turned it on and got the stall again. Narrowed it down to USB devices. So, I unplugged them all, rebooted for a sanity check and it only stalled 19 seconds. I then plugged each USB cable back in one at a time, booting after each one. I narrowed it down to my USB 2.0 hub (or one of the devices connected to it). So, I then left the hub plugged in but unplugged everything from it and rebooted... quick start. OK, now I plugged each USB device back into the hub, 1 at a time and rebooting after each one until the problem returned.

SOLUTION!
Turns out the thing that slowed it down was a USB cable... JUST a USB cable THAT WASN'T PLUGGED INTO ANYTHING!!! Actually, it was before I started the test, but just the cable itself seemed to cause the problem. It was a cable that I normally have plugged into my external USB Seagate 500GB FreeAgent Pro drive. I thought, what the heck, let's plug it back in and reboot, and the problem was now gone. Strange! So I plugged everything back in, rebooted and the problem is now gone!!! Even the secondary delay during the Windows boot.

So, problem gone, but I'm still a little amiss that the computer's hardware configuration is now back in the exact same configuration it was when I had the problem. But I'm good to go.

So, if you're one of the unlucky DG33FB owners experiencing this problem, unplug everything and plug them back in 1 at a time, rebooting between plug ins until you find the culprit.

Hope this helps!

Thursday, October 02, 2008

Type 'System.Web.UI.WebControls.Parameter' does not have a public property named 'DbType'.

I recently got this error after deploying a .NET 2.0 web site from my dev machine to a development web server. It ran fine on my machine, but continuously generated the error:

Type 'System.Web.UI.WebControls.Parameter' does not have a public property named 'DbType'.

on the dev server. I validated that both my dev machine and the web server had the exact same version of the .NET framework AND that the web site on the dev server was configured for the 2.0 framework.

My dev machine is running Windows XP Pro 64bit and the dev server is Windows Server 2003 Standard Edition 32bit. The app was developed with Visual Studio 2005.

As a sanity check, I started my VM with Windows Server 2003 32bit with Visual Studio 2005. I checked in the app from my XP 64bit host to VSS, then retrieved it from VSS in my VM. Compiling and running in the VM worked just fine but deploying it to dev still had the error. I created a new typed dataset, dragged the same table to it and copied the queries from the offending datatable in the original typed dataset. I then changed the code to reference the new dataset. Compiled, ran locally, and it worked (no surprise), then deployed to dev, and it worked! Huh? It still had the DBType in the dataset files... which is where the dev server was pointing me to for the error before. This makes no sense. I then checked that code into VSS from my VM and got the latest onto my XP 64bit host. Compiled locally, ran, and it worked, then deployed to dev and it worked. So, I went back to my original typed dataset and pulled the designer up side by side by the new dataset and examined the fields, the queries, and the parameters... all the same! I then deleted some extra datatables in my dataset that weren't being used (and had referential links to the offending table), excluded the new dataset from the project (rather than deleting it), then changed the code back to use the original dataset. Now everything works everywhere!

So, I'm not entirely sure what the cause was, but I think removing the linked datatables from the dataset helped solve the problem. Of course, this doesn't explain why the old version worked differently between my dev machine and the dev server.

Anyway, there you have it. If you run into this problem, try deleting links from your datatables and/or recreate a new typed dataset, one piece at a time, compiling, and deploying one step at a time.

Monday, August 25, 2008

Excel 2007 for prior users

As we all found out the hard way, Microsoft completely redesigned the user interface in Office 2007. For some reason, they felt it necessary to do away with the tried and true and standard and universally understood user interface elements such as menu bars. In their place, are what they now call "ribbon bars". They don't even give you the option of turning on the old menu bars. I've been using Office 2007 for a few months now and I'm still struggling. I'm not seeing any benefit to this new UI at all. Don't misunderstand... I'm all for constant improvement and have been accused, on multiple occasions of pushing the envelope too far... heck, constant improvement is nearly a religion of mine, but Microsoft has gone not just a few steps further outside the envelope than I have, but they've ripped it to shreds. At the very least, they should have provided a way for us that already knew our way around the software a way to turn it back on.

And, before you say that the old keystrokes work, they do NOT. One of many examples that don't work: Alt+T would open the Tools menu. There IS NO tools menu now!!! Ugh! Anyway, where was I?

Ah yes! I did find a nice piece of work that someone put together for us that would actually like to get some work done (albeit, very slowly now). This document is organized by the old menu bar interface and shows you where each old menu command's capabilities can be found on the new unicorn and raindbows, phisher-price user interface.

http://transition.gmu.edu/crosswalk/Excel%202007%20Crosswalk.pdf

Hope this helps releive some of your frustrations.

Thursday, August 14, 2008

Visual Studio 2008 SP1 - First Looks

I downloaded and installed Visual Studio 2008 SP1 on Tuesday, 2008-08-12.

If you want to download it, you can get it here (this will download a very small EXE, which will then download the rest during install):
  • Small SP1 EXE
  • http://www.microsoft.com/downloads/details.aspx?FamilyID=fbee1648-7106-44a7-9649-6d9f6d58056e&DisplayLang=en
If you want the ISO, get it here:
  • VS2K8 SP1 ISO
  • http://www.microsoft.com/downloads/info.aspx?na=47&p=3&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=fbee1648-7106-44a7-9649-6d9f6d58056e&u=details.aspx%3ffamilyid%3d27673C47-B3B5-4C67-BD99-84E525B5CE61%26displaylang%3den

If you don't want to burn the ISO, you can mount it as a virtual drive. If you have VMWare, you can mount an ISO so that the VM sees the ISO as an actual CD/DVD. If you want to install it on your host, you can share the virtual disc from within your VM and share it on the network, then access it over the virtual network from your host (works great). Of course, this is using a sledge hammer to swat a fly, so I wouldn't recommend this unless you already have VMWare. But if you DON'T have VMWare, you should get it (not just for the ISO mounting support, of course).

If you'd prefer to not go the VMWare route (or if you don't have VMWare), here's a list of ISO mounting drivers:

OK, so these are my first impressions of VS2K8 SP1:

  • It takes waaaaaaaaaaaay too long to install (2-3 hours or so on a 2.4Ghz Dual Core PC w/ 7GB RAM and Windows XP 64bit).
    • I don't know if it was slow in downloading while installing or if the install was just slow, but I recommend downloading the ISO and mounting that to install from it (or if you have an MSDN sub, just wait for the DVDs to arrive in the mail and install from there).
  • I didn't have any problems installing (other than the really slow install time). Everything works.
  • Compiles now take about 20-30 seconds LONGER!!! (correction 2008-08-27: It takes 40 seconds longer!!! It just sits there, doing nothing for 40 seconds.)
    • This is VERY frustrating! Most people don't realize this, but this is actually a game changer! Making a quick change, then running to test, then going back and doing another quick nudge, then run, is no longer a viable possibility since it takes so freaking long to wait on the compiler. I now need to spend more time batching up changes. This is going to seriously impact some parts of my development. Back when I was programming in Delphi, it was always super fast. Compiling was almost instantaneous. When I had to use a much slower compiler at work, the people there who hadn't experienced such fast compiling couldn't understand what it was they were missing, as I suspect many readers here will not realize what a difference quick compiling makes in your development efforts... and I know that Microsoft doesn't. <shrug>
  • Stepping through code gives you the option of NOT stepping into getter and setter methods on properties.
    • This is a HUGE help! Since I use properties a LOT, stepping through code is a major pain when calling a method that takes several parameters, and each one is a property that I'm passing in... I used to be forced into each and every freaking property getter. Now, I just get sent straight into the method I'm calling.

So, that's all I've seen so far. The MUCH slower compiling is a huge disappointment, but possibly the newly added benefit of skipping over property getters and setters might offset the extra wasted time. Time will tell.