What Was I Thinking?

Follies & Foils of .NET Development
posts - 95 , comments - 352 , trackbacks - 0

September 2010 Entries

Using ThreadPoolHelper Syntax
Code Snippet ThreadPoolHelper.QueueUserW... arg2, arg3, (localArg1, localArg2, localArg3) => { /* code block */ }); ......

Posted On Tuesday, September 28, 2010 11:06 AM | Comments (1) | Filed Under [ Visual Studio ]

Evaluating Environment.SpecialFolders.Programs

I’m posting this because I never seem to be able to recall this value when I need it.  Under Windows 7:


Environment.SpecialFolders.Programs resolves to: C:\Users\[username]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs

Posted On Monday, September 27, 2010 4:45 PM | Comments (1) |

QuickTip: Specifying user credentials when installing a service.
I recently attempted to install a windows service I had created. I created an installer and deployed the msi to the target machine. When I ran the setup I was prompted for the username and password credentials for the identity to run the service. I had a local account created. The account was permissioned correctly and had been granted the rights to logon as a service. After supply the credentials, the I received the following error: Error 1001. The account name is invalid or does not exist, or the ......

Posted On Saturday, September 25, 2010 6:43 PM | Comments (0) | Filed Under [ Visual Studio General Geekiness ]

Solved: “The name 'GridView1' does not exist in the current context” after renaming the page / namespace
After I renamed the page and namespace for my aspx page, I started getting a compilation error: “The name 'GridView1' does not exist in the current context”. This was odd since the aspx codebehind and inherits attributes were in sync with the aspx.cs and aspx.designer.cs files. So what was wrong? During my rename operation, Visual Studio (or possibly ReSharper) excluded the designer file from my project. I hadn’t noticed because I usually work with the “Show All Files” option enabled in my solution ......

Posted On Sunday, September 19, 2010 6:17 PM | Comments (3) | Filed Under [ Visual Studio ]

Solved: YouTube Videos Lock Up (Adobe Flash Player Crashes)
This has nothing to do with .Net development, but I’m sure others are running into this problem, so I thought I’d write a quick post about it. After updating my Windows PC to Adobe Flash Player 10.1, whenever I attempt to view YouTube videos (either through IE or Chrome), I get a green background and no video, some audio, and then my browser locks up. Turns out to be an issue with Adobe’s hardware acceleration feature (new to version 10). To disable hardware acceleration, you need to modify a setting ......

Posted On Saturday, September 18, 2010 10:37 AM | Comments (24) | Filed Under [ General Geekiness ]

Solved: Unit/Integration Testing of a WCF Service
I've got a solution to running and debugging unit tests for WCF hosted services that utilize the CMServiceHost. Whether your generate your serivce proxy via WSDL (Add Service Reference) or Shared Contract (ClientFactory), the solution is similar. This email will detail how to invoke a WCF Service Host for testing in both scenarios. Testing a service client generated via "Add Service Reference" I'll illustrate the solution using the following sample unit test. Let's assume you've created a service ......

Posted On Thursday, September 16, 2010 8:06 AM | Comments (0) | Filed Under [ Visual Studio WCF ]

HOW TO: Add Copied Projects Back Into TFS
Here’s a recent post I made to the MSDN Forums and the reply which quickly fixed my problem. I’m posting it here, because I didn’t find it anywhere else on the web. I'm in the process of migrating projects from one solution to another. I've created the new solution, and copied the project files from their current disk location (a subdir of the old solution's folder) to their new disk location (a subdir under the new solution's folder). I then tried to add the application to TFS. The application was ......

Posted On Thursday, September 16, 2010 7:51 AM | Comments (1) | Filed Under [ Visual Studio ]

Supporting Request Timeout with a WebClient
I recently needed to adjust the timeout value of the HTTP Request being generated by WebClient. My attempt to perform a POST of a large file over HTTP was causing the WebClient to timeout. I thought adjusting the timeout value for the web client would fix this problem. One problem, the WebClient doesn’t support a Timeout value. I did some snooping via Reflector and discovered 2 important facts about the WebClient. Fact #1, The WebClient isn’t sealed. This means we can inherit from it. Fact #2: The ......

Posted On Tuesday, September 14, 2010 12:52 PM | Comments (8) | Filed Under [ Visual Studio WCF ]

Powered by: