<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Peter Johnson's Blog</title><link>http://weblogs.asp.net/pjohnson/default.aspx</link><description>ASP.NET and other technologies</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Migrating from VS 2005 to VS 2008</title><link>http://weblogs.asp.net/pjohnson/archive/2009/12/02/migrating-from-vs-2005-to-vs-2008.aspx</link><pubDate>Wed, 02 Dec 2009 17:03:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7268781</guid><dc:creator>pjohnson</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/pjohnson/rsscomments.aspx?PostID=7268781</wfw:commentRss><comments>http://weblogs.asp.net/pjohnson/archive/2009/12/02/migrating-from-vs-2005-to-vs-2008.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;I&amp;nbsp;recently helped migrate a ton of code from Visual Studio 2005 to 2008, and .NET 2.0 to 3.5. Most of it went very smoothly; it touches every .sln, .csproj, and .Designer.cs file, and puts a bunch of junk in Web.Configs, but rarely encountered errors. One thing I didn't expect was that even for a project running in VS 2008 but targeting .NET Framework 2.0, it will still use the v3.5 C# compiler. As such, it does behave a bit differently than the 2.0 compiler, even when targeting the 2.0 Framework.&lt;/P&gt;
&lt;P mce_keep="true"&gt;One piece of code used an internal custom EventArgs class, that was consumed via a public delegate. This code compiled fine using the 2.0 C# compiler,&amp;nbsp;but the 3.5 compiler&amp;nbsp;threw this error:&lt;/P&gt;
&lt;HR&gt;
&lt;FONT face="Courier New" size=2&gt;error CS0059: Inconsistent accessibility: parameter type 'MyApp.Namespace.MyEventArgs' is less accessible than delegate 'MyApp.Namespace.MyEventHandler'&lt;BR&gt;&lt;/FONT&gt;
&lt;HR&gt;

&lt;P mce_keep="true"&gt;It's a goofy situation, the error makes perfect sense, and it was easy to correct (I made both internal), but I expected VS 2008 would use the compiler to match whatever the target .NET Framework version was. I wouldn't have expected any compilation errors it didn't have before conversion, not until I changed the targeted Framework version.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Another funny error happened around code analysis. Code analysis ran fine in VS 2005, but in VS 2008, it threw this error (compilation error, not a code analysis warning):&lt;/P&gt;
&lt;HR&gt;
&lt;FONT face="Courier New" size=2&gt;Running Code Analysis...&lt;BR&gt;C:\Program Files\Microsoft Visual Studio 9.0\Team Tools\Static Analysis Tools\FxCop\FxCopCmd.exe /outputCulture:1033 /out:"bin\Debug\MyApp.Namespace.MyProject.dll.CodeAnalysisLog.xml" /file:"bin\Debug\MyApp.Namespace.MyProject.dll" /directory:"C:\MyStuff\MyApp.Namespace.MyProject\bin\Debug" /directory:"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727" /directory:"..\..\..\Lib" /rule:"C:\Program Files\Microsoft Visual Studio 9.0\Team Tools\Static Analysis Tools\FxCop\Rules" &lt;STRONG&gt;/ruleid:-Microsoft.Design#CA1012 /ruleid:-Microsoft.Design#CA2210 ...&lt;/STRONG&gt; /searchgac /ignoreinvalidtargets /forceoutput /successfile /ignoregeneratedcode /saveMessagesToReport:Active /targetframeworkversion:v2.0 /timeout:120 MSBUILD : error : Invalid settings passed to CodeAnalysis task. See output window for details.&lt;BR&gt;Code Analysis Complete -- 1 error(s), 0 warning(s)&lt;BR&gt;Done building project "MyApp.Namespace.MyProject.csproj" -- FAILED.&lt;BR&gt;&lt;/FONT&gt;
&lt;HR&gt;

&lt;P mce_keep="true"&gt;I especially like the "See output window for details," which 1. screams of a Visual Studio hack as it is, and 2. doesn't actually give me any more details in this particular case, though Google tells me that other people do get more information in the output window.&lt;/P&gt;
&lt;P mce_keep="true"&gt;I noticed Debug and Release modes both had code analysis enabled (I think switching Framework versions&amp;nbsp;swapped them on me and I accidentally enabled it in Release mode), and Release mode wasn't erroring out but Debug was. I looked at the difference in the&amp;nbsp;csproj file, and in the FxCopCmd.exe calls, and the key seemed to be the /ruleid parameters (bolded), of which there were a ton in Debug but not Release. Presumably this is because I disabled some of the rules in the project properties, so I tried enabling them all. The&amp;nbsp;number&amp;nbsp;of /ruleid params went down, but it still gave the same error. The Code Analysis tab in project properties looked the same between Debug and Release.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Finally I unloaded the project, edited the csproj file (I'm glad I found out how to do this within VS, instead of exiting VS and editing it in Notepad), and removed this line, which was present in the Debug PropertyGroup element&amp;nbsp;but not the Release one:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;lt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;CodeAnalysisRules&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;-Microsoft.Design#CA1012;-Microsoft.Design#CA2210...&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;lt;/&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;CodeAnalysisRules&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Code analysis then ran successfully. I imagine this solution isn't ideal for everyone, if you want to enable/disable particular rules, and it's not ideal for us long-term, but it did allow us to keep code analysis enabled without the build failing.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7268781" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/pjohnson/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/Team+System/default.aspx">Team System</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/Code+Analysis/default.aspx">Code Analysis</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/TFS/default.aspx">TFS</category></item><item><title>Windows 7 rocks!</title><link>http://weblogs.asp.net/pjohnson/archive/2009/12/01/windows-7-rocks.aspx</link><pubDate>Wed, 02 Dec 2009 00:19:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7268283</guid><dc:creator>pjohnson</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/pjohnson/rsscomments.aspx?PostID=7268283</wfw:commentRss><comments>http://weblogs.asp.net/pjohnson/archive/2009/12/01/windows-7-rocks.aspx#comments</comments><description>&lt;P&gt;I bought my current PC almost three years ago. I've had my own PC for 15 years or so, and, aside from my first desktop and a laptop I only use when traveling, that was the only time I've bought a whole PC, rather than buying parts and assembling my own (a Frankenputer as former coworkers affectionately referred to them). Like many of my colleagues who work in Microsoft technologies, I looked into buying a Dell, and they had a fine deal, and more importantly, they had finally started selling AMD processors, which I can proudly say without qualification is the &lt;U&gt;only&lt;/U&gt; CPU in &lt;U&gt;any&lt;/U&gt; computer I've owned. I configured one with a dual core, 64-bit processor, and all sorts of new technologies I'd never heard of but were (and appear to still be) the latest and the greatest. ("What's SATA? We use PCI for video again?" I asked myself.)&lt;/P&gt;
&lt;P&gt;Windows Vista had RTM'd and was weeks from retail availability, and my PC included a deal to upgrade once Microsoft let Dell send upgrade discs. My PC had a rather small (160 GB, I think) hard drive, which I intended to replace with a 500 GB or so once Vista came out, installing it there fresh instead of trying to upgrade Windows--Windows upgrades have never worked so well for me, whereas fresh installs are fine. Then I heard all the complaining about Vista, and decided to hold off. I ran low on space before Vista SP1 came out, so got that second hard drive anyway and kept my photos there. From then on, Windows XP Professional worked "well enough" so I stuck with it.&lt;/P&gt;
&lt;P&gt;Things got bad a couple months before Windows 7 came out. First, Norton AntiVirus misbehaved. To be fair, the program was about 6-7 years old; I kept it around because it seemed to work well enough, I got it free as a student, and virus definition upgrades were free. Then I noticed the dates on the definitions went from a few days ago, to the middle of 1999. It still changed every week, and still found upgrades, so I'm guessing it was just a bug in how it displayed the definitions date, but still made me nervous, as did the prospect of uninstalling old and installing new virus scanners.&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;Roxio was the next to act up. After Microsoft paved the way with Windows Update, suddenly every software manufacturer was convinced their product was just as important to check at least every week for updates, and the updates, just as urgent. Eventually I got Apple to quit bugging me to install Bonjour and Safari, but I couldn't get Roxio (or, perhaps more accurately, InstallShield Update Manager which came with Roxio) to quit prompting me to check for updates on the 0 products I had told it to check. I googled and finally found a tool I could use to uninstall that piece of it, without uninstalling Roxio, on InstallShield's support site.&lt;/P&gt;
&lt;P&gt;&lt;I&gt;That&lt;/I&gt; was a mistake. It stopped prompting me, but added about 3 minutes from when Windows comes up after I start my PC, until my computer was usable, and in the meantime, Norton was disabled, Windows Firewall was disabled, and programs wouldn't start. Add to this a nagging problem where my SD/CompactFlash card reader thinks it's USB 1.x intermittently, and the ugly way Windows Search was grafted onto Windows XP, and the fact that XP (and earlier versions of Windows--not sure about 7 yet) just slows down after a couple years, and I knew it was time to upgrade once Windows 7 came out.&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;The more I learned about Windows 7 (and, to be fair, much of it was new in Vista and largely unchanged in 7, but I'd barely ever used Vista), the more I liked it. The way search worked much faster, more efficiently, and was integrated into everything, even the Start Menu (no more reorganizing each program's 20 or so icons so I could find the ones I actually wanted! no more sorting alphabetically every time I install a new program!)...&amp;nbsp;An &lt;A class="" title="AddictiveTips: Windows 7 Explorer: What's New?" href="http://www.addictivetips.com/windows-tips/windows-7-explorer-whats-new/" mce_href="http://www.addictivetips.com/windows-tips/windows-7-explorer-whats-new/"&gt;overhauled Windows Explorer&lt;/A&gt; including a new&amp;nbsp;&lt;A class="" title="AddictiveTips: What Is Windows 7 Libraries And How To Use It" href="http://www.addictivetips.com/windows-tips/what-is-windows-7-libraries-and-how-to-use-it/" mce_href="http://www.addictivetips.com/windows-tips/what-is-windows-7-libraries-and-how-to-use-it/"&gt;Libraries feature&lt;/A&gt; (not in Vista) that didn't force you to keep everything in your profile for Windows to like it... and finally getting to install 4 GB of memory and take advantage of my 64-bit processor!&lt;/P&gt;
&lt;P&gt;After Microsoft decided one day the long-activated Windows XP installation on my laptop was no longer valid, with no explanation why, I wasn't going to chance them deciding the same thing on my main PC, so I broke down and got the full version of Windows 7. I opted for Home Premium after finding little difference between Home Premium and Professional that I cared about, since Home Premium should be able to run IIS, and if it can't, Visual Studio 2008's web server should be enough for what I need on this PC. I installed it not quite a month ago, replacing NAV and Ad-Aware with the new free and highly-rated &lt;A title="Virus, Spyware &amp;amp; Malware Protection | Microsoft Security Essentials" href="http://www.microsoft.com/Security_Essentials/" mce_href="http://www.microsoft.com/Security_Essentials/"&gt;Microsoft Security Essentials&lt;/A&gt;, and Roxio with--well, either what's built into Windows 7 or my favorite CD ripper &lt;A href="http://www.poikosoft.com/" mce_href="http://www.poikosoft.com/"&gt;Easy CD-DA Extractor&lt;/A&gt;, and it's great. I can work the way I want to, customize things as much as I need (you're close, iPhone, but not quite there), and boy is Aero pretty. I'm a sucker for eye candy (I &lt;I&gt;do&lt;/I&gt; have an iPhone).&lt;/P&gt;
&lt;P&gt;The search works great. I was leery about using Windows Search (installed against your will by Office 2007) or Google Desktop Search (must be unchecked in order to not install with every Adobe program and tons of others) add-ons for Windows XP; that sort of thing just seems like too core a functionality to get some freebie add-on to handle. Windows XP's built-in search might suck, but it usually found what I wanted, and didn't take &lt;I&gt;too&lt;/I&gt; long. Sure enough, Windows 7 search works instantly, and if you copy over a ton of files it hasn't indexed, as I did when I wiped my hard drive to install 7 then copied back from my backup, it might not find everything right away, but it will after it spends a few minutes indexing them. And, as advertised, it doesn't slow me down while I'm using the PC; I haven't heard my hard drive crank once while I've been writing this long post. By default, it only indexes in your Libraries, and MS suggests anything you want indexed, you put in a Library. That put me off at first--what if I need to search for a system file or something?--but really, the vast majority of stuff I search for slots fine in either the Documents, Music, or Pictures Libraries. Moving from XP to 7 takes some adjustment, but I gave it a chance, and I'm quite happy with it. And if I do ever need to do a search for a certain DLL, it's easy enough to add folders to the list of what's indexed. I don't even have to dig into Administrative Tools and various Control Panel applets and System Tools folders, wondering where Microsoft has hidden that options screen in &lt;I&gt;this&lt;/I&gt; version, thanks to the Start Menu search feature. I just click the Windows key, type "index", and it's the first option:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://weblogs.asp.net/blogs/pjohnson/StartMenuSearch.png"&gt;&lt;IMG src="http://weblogs.asp.net/blogs/pjohnson/StartMenuSearch.png" border=0&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just like searching on the web, the content is what matters; its physical location is now much less important. You just type in a word or two and it figures out what you want, no matter where it is.&lt;/P&gt;
&lt;P&gt;Another great and long-overdue improvement is the Windows Explorer dialogs for long-running file operations--deleting, copying, moving. It gives you more of the path, and best of all, an accurate estimate of how long it will take, and the rate at which it's copying files! No more operations where it takes 45 seconds for the first part and 23987105 minutes for the last part.&lt;/P&gt;
&lt;P&gt;The most annoying thing I've found so far is based on principle, and not any difference I've observed. Occasionally, programs crash. Two that I use often, Mozilla Firefox and &lt;A title="IrfanView image viewer" href="http://www.irfanview.com/" mce_href="http://www.irfanview.com/"&gt;IrfanView&lt;/A&gt;, have each crashed once. (Amusingly, both when they tried to start up the Apple QuickTime plug-in; I have a few things to say about my iTunes migration experience, but that'll have to wait for another post.) But once is all it takes in Windows 7, before Program Compatibility Assistant (PCA) kicks in and applies some sort of mysterious sanctions to the offender.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://weblogs.asp.net/blogs/pjohnson/FirefoxPCA.png"&gt;&lt;IMG src="http://weblogs.asp.net/blogs/pjohnson/FirefoxPCA.png" border=0&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Obviously I was curious about what those "settings" it applied were, and how to grant amnesty for first-time offenses. That link has &lt;A title="Program Compatibility Assistant: frequently asked questions" href="http://windows.microsoft.com/en-US/windows7/Program-Compatibility-Assistant-frequently-asked-questions" mce_href="http://windows.microsoft.com/en-US/windows7/Program-Compatibility-Assistant-frequently-asked-questions"&gt;a help article with those exact questions&lt;/A&gt;. And the answer? "It depends," and "go to TechNet and teach yourself about group policy," respectively. (In their words, "Adjustments to program compatibility features can be made by using Group Policy. For advanced information on how to use Group Policy, go to the &lt;A title="TechNet home, and you're on your own!" href="http://go.microsoft.com/fwlink/?LinkId=66683" mce_href="http://go.microsoft.com/fwlink/?LinkId=66683"&gt;Microsoft website for IT professionals&lt;/A&gt;.") Seriously? A little more googling and I found out that you can dig into it, or &lt;A title="Turn Off Program Compatibility Assistant - MAXIMUMpcguides" href="http://maximumpcguides.com/windows-7/turn-off-program-compatibility-assistant/" mce_href="http://maximumpcguides.com/windows-7/turn-off-program-compatibility-assistant/"&gt;disable PCA altogether, using Group Policy Editor&lt;/A&gt;, which... doesn't come with Home Premium. So it sounds like my only choice is manually editing the registry. I can't even find out what PCA changed about how those programs run; a few articles allude to ominous performance degradations in order to ensure stability. Windows 7 addresses so many things that bugged me about XP and earlier versions; it's a shame they dropped the ball on this one. To be fair, it seems that this is how Vista functioned, and Windows 7 didn't make it worse, but didn't improve it, either.&lt;/P&gt;
&lt;P&gt;But, to summarize, I'm thrilled with Windows 7, and with 64-bit computing, though I'm a little surprised more programs aren't 64-bit (Firefox and Flash Player, I'm looking at you). Oh well--we had the same problem switching from 16-bit to 32-bit, but I'm glad enough software and hardware is there, that I can upgrade and work just fine until the rest of it makes it.&lt;BR&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7268283" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/pjohnson/archive/tags/Vista/default.aspx">Vista</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/Windows+7/default.aspx">Windows 7</category></item><item><title>TFS deleted files still show up in Source Control Explorer</title><link>http://weblogs.asp.net/pjohnson/archive/2009/12/01/tfs-deleted-files-still-show-up-in-source-control-explorer.aspx</link><pubDate>Wed, 02 Dec 2009 00:02:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7268274</guid><dc:creator>pjohnson</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/pjohnson/rsscomments.aspx?PostID=7268274</wfw:commentRss><comments>http://weblogs.asp.net/pjohnson/archive/2009/12/01/tfs-deleted-files-still-show-up-in-source-control-explorer.aspx#comments</comments><description>&lt;p&gt;One problem I've had in Team Foundation Server since Visual Studio 2005 and still in VS 2008 is when items are deleted by someone else, they still show up in Source Control Explorer, with a gray folder with a red X icon, even with "Show deleted items in the Source Control Explorer" unchecked in VS's Options dialog. Sometimes getting latest of the parent clears things up, but other times it doesn't, even with Get Specific Version with both Overwrite boxes checked to force a get. In this case, the only option I've found is to delete my workspace and recreate it, which means checking in &lt;i&gt;everything&lt;/i&gt; beforehand, and getting latest of my working branches afterwards. It's a pain, but as &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/tfsversioncontrol/thread/3168c733-7c16-499b-adaf-07d0b212a972" title="Visual Studio Team System Forums - Get latest (even with force) won't remove deleted files from my source control explorer" mce_href="http://social.msdn.microsoft.com/Forums/en-US/tfsversioncontrol/thread/3168c733-7c16-499b-adaf-07d0b212a972"&gt;specified here and approved by a Microsoft employee&lt;/a&gt;, that may be your only option until it's fixed--fingers crossed for VS 2010. (We won't get into the other things for which my fingers have been crossed since I first used TFS in 2005, things that VSS did just fine, such as rollback, check in changes and keep checked out, and search.)&lt;/p&gt;&lt;p&gt;Anyone have any better solutions? Deleting and recreating your workspace seems a bit drastic.&lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7268274" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/pjohnson/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/Team+System/default.aspx">Team System</category></item><item><title> VS 2008 and .NET 3.5 Beta 2 released, with Go Live</title><link>http://weblogs.asp.net/pjohnson/archive/2007/07/26/vs-2008-and-net-3-5-beta-2-released-with-go-live.aspx</link><pubDate>Thu, 26 Jul 2007 21:18:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:3288029</guid><dc:creator>pjohnson</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/pjohnson/rsscomments.aspx?PostID=3288029</wfw:commentRss><comments>http://weblogs.asp.net/pjohnson/archive/2007/07/26/vs-2008-and-net-3-5-beta-2-released-with-go-live.aspx#comments</comments><description>&lt;p&gt;It's official! In one of the first of a few dozen posts you'll read about it, Scott Guthrie announces &lt;a href="http://weblogs.asp.net/scottgu/archive/2007/07/26/vs-2008-and-net-3-5-beta-2-released.aspx" mce_href="http://weblogs.asp.net/scottgu/archive/2007/07/26/vs-2008-and-net-3-5-beta-2-released.aspx"&gt;Visual Studio 2008 and the .NET Framework 3.5 Beta 2 have been released&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=3288029" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/pjohnson/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Microsoft Sandcastle</title><link>http://weblogs.asp.net/pjohnson/archive/2007/07/03/microsoft-sandcastle.aspx</link><pubDate>Tue, 03 Jul 2007 16:27:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:3007498</guid><dc:creator>pjohnson</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/pjohnson/rsscomments.aspx?PostID=3007498</wfw:commentRss><comments>http://weblogs.asp.net/pjohnson/archive/2007/07/03/microsoft-sandcastle.aspx#comments</comments><description>&lt;p&gt;In working with my company's offshore developers, I was tasked with providing them documentation on a set of class libraries we use in our applications. In the .NET 1.0/1.1 time frame, we used &lt;a href="http://ndoc.sourceforge.net/" mce_href="http://ndoc.sourceforge.net/"&gt;NDoc&lt;/a&gt;, which, sadly, &lt;a href="http://weblogs.asp.net/bhouse/archive/2006/07/26/NDoc-2.0-_2D00_-R.I.P.aspx" title="Brenton House: NDoc 2.0 - R.I.P" mce_href="http://weblogs.asp.net/bhouse/archive/2006/07/26/NDoc-2.0-_2D00_-R.I.P.aspx"&gt;passed away last year&lt;/a&gt;, to turn the XML comments output by the C# compiler into CHM help files. After a bit of googling and a &lt;a href="http://www.doxygen.org/" title="Doxygen" mce_href="http://www.doxygen.org/"&gt;false start&lt;/a&gt;, I discovered Sandcastle, which Microsoft &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=517576&amp;amp;SiteID=1" title="MSDN Forums: Documentation Compiler - Sandcastle" mce_href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=517576&amp;amp;SiteID=1"&gt;uses to build the .NET Framework documentation itself&lt;/a&gt;. I also discovered from the &lt;a href="http://blogs.msdn.com/sandcastle/" mce_href="http://blogs.msdn.com/sandcastle/"&gt;Sandcastle blog&lt;/a&gt; that it takes &lt;a href="http://blogs.msdn.com/sandcastle/archive/2006/07/29/682398.aspx" title="Sandcastle Blog: Creating a Chm build using Sandcastle" mce_href="http://blogs.msdn.com/sandcastle/archive/2006/07/29/682398.aspx"&gt;a whole mess of manual steps to use&lt;/a&gt;, which appeared daunting at first glance, and, being a programmer, I was looking for an easier (lazier) way.&lt;/p&gt;&lt;p&gt;From the &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=E82EA71D-DA89-42EE-A715-696E3A4873B2&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?familyid=E82EA71D-DA89-42EE-A715-696E3A4873B2&amp;amp;displaylang=en"&gt;official Sandcastle download page&lt;/a&gt;, I found the &lt;a href="http://www.sandcastledocs.com/Wiki%20Pages/Home.aspx" mce_href="http://www.sandcastledocs.com/Wiki%20Pages/Home.aspx"&gt;Sandcastle Wiki&lt;/a&gt;, and from there, an NDoc-like, Visual Studio-like GUI for it creatively titled &lt;a href="http://www.codeplex.com/SHFB" mce_href="http://www.codeplex.com/SHFB"&gt;Sandcastle Help File Builder&lt;/a&gt;. Setting up a SHFB project and getting the documentation to compile, and then to look/behave almost exactly like I envisioned, was simple at this point.&lt;/p&gt;&lt;p&gt;Overall, I'm pretty impressed how easy it was to discover this and find resources to use it--a lot easier than it used to be to fill a component/tool need that Microsoft claims to address (some of the data access pieces in the Visual InterDev 6.0 time frame come to mind). Really, the hardest part was getting the Google terms right!&lt;/p&gt;&lt;p&gt;Again, you can &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=E82EA71D-DA89-42EE-A715-696E3A4873B2&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?familyid=E82EA71D-DA89-42EE-A715-696E3A4873B2&amp;amp;displaylang=en"&gt;download Sandcastle here&lt;/a&gt;. The latest version is the June 2007 CTP (Community Technology Preview, which you probably already know means it's pre-release), released a couple weeks ago.&lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=3007498" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/pjohnson/archive/tags/General+Software+Development/default.aspx">General Software Development</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/Sandcastle/default.aspx">Sandcastle</category></item><item><title>HTTP modules - subdirectories and private variables</title><link>http://weblogs.asp.net/pjohnson/archive/2007/03/02/http-modules-subdirectories-and-private-variables.aspx</link><pubDate>Fri, 02 Mar 2007 21:29:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:1871475</guid><dc:creator>pjohnson</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/pjohnson/rsscomments.aspx?PostID=1871475</wfw:commentRss><comments>http://weblogs.asp.net/pjohnson/archive/2007/03/02/http-modules-subdirectories-and-private-variables.aspx#comments</comments><description>&lt;p&gt;I recently finished (for now--there&amp;#39;s always more to do) one of the more complex HTTP modules I&amp;#39;ve worked on. I have an application first written in the ASP.NET 1.0 beta 2 time frame that&amp;#39;s since been upgraded to 1.0, 1.1, and now 2.0. It had a lot of custom authentication and error handling code in global.asax, and for general architecture and server management purposes, I wanted to move this code into separate HTTP modules. I ran into a couple gotchas I wanted to document.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Lesson 1: You can&amp;#39;t disable an HTTP module for a subdirectory.&lt;/strong&gt; I wanted to remove the HTTP module for one subdirectory using the &amp;lt;location&amp;gt; configuration element, and while it let me put it in my web.config fine and never threw an error a la &amp;quot;It is an error to use a section registered as allowDefinition=&amp;#39;MachineToApplication&amp;#39; beyond application level.&amp;nbsp; This error can be caused by a virtual directory not being configured as an application in IIS.&amp;quot;, when I ran it, it went into the module&amp;#39;s code as if that config section wasn&amp;#39;t there.&lt;/p&gt;&lt;p&gt;&lt;a href="http://weblogs.asp.net/scottgu/" title="ScottGu&amp;#39;s Blog"&gt;Scott Guthrie&lt;/a&gt; explained to me why: &amp;quot;HttpModules are application specific. When an application starts up, a number of HttpApplication&amp;#39;s get configured (one for each logical thread that will execute in the application), and HttpModules are created and assigned to them. That is why you need to configure them at the application root (or higher) level in config. This enables much better pooling of resources.&amp;quot; He pointed out that other HTTP modules in ASP.NET handle this with custom configuration sections, which is more work than I was looking at doing for this release.&lt;/p&gt;&lt;p&gt;An exception to this rule is if that subdirectory itself is configured
as an IIS application, but in many cases (including mine), this is more
trouble than it&amp;#39;s worth, limiting what user controls it can see,
requiring its own bin directory... and if you&amp;#39;re going to do all that,
it&amp;#39;s probably going to need its own web.config file anyway. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Lesson 2: You shouldn&amp;#39;t use private member variables in an HTTP module.&lt;/strong&gt; I&amp;#39;ve been an ASP.NET programmer long enough that I thought I could figure out whether member variables were safe or not. I could argue for it either way, and I wasn&amp;#39;t feeling ambitious enough to wade through all that code in Reflector. I finally found &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.httpapplication.aspx" title="HttpApplication Class (System.Web)"&gt;official documentation for the HttpApplication&lt;/a&gt; class that said, &amp;quot;One instance of the HttpApplication class is used to process many requests in its lifetime; however, it can process only one request at a time. Thus, member variables can be used to store per-request data.&amp;quot; So it made sense that if an HTTP module is wired to a particular HttpApplication instance, the same rule would apply, and member variables would be safe in HTTP modules as well.&lt;/p&gt;&lt;p&gt;Again,&amp;nbsp; Scott helped me out by advising me against member variables: &amp;quot;If you have an async operation occur during the request, I believe ASP.NET might switch the HttpModule to another thread to execute. That is my worry with storing local variables. It might work in your dev environment, but generate different results under high-load on a server.&amp;quot; And no one needs any more &amp;quot;works great in dev and QA but not production&amp;quot; sorts of issues. He advised storing such things in HttpContext.Items instead, but in my case, the data was so cheap to calculate and consumed rarely enough that I decided to just have a method to calculate it every time. Interestingly, by switching from global.asax (where member variables were fine) to an HTTP module, I took a step back in this department, but overall it was the right move and the way I would have written the app from the beginning had I been more familiar and experienced with ASP.NET.&lt;br /&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=1871475" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/pjohnson/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>ASPInsiders Summit 2006 - C# 3.0 and LINQ</title><link>http://weblogs.asp.net/pjohnson/archive/2007/01/16/aspinsiders-summit-2006-c-3-0-and-linq.aspx</link><pubDate>Tue, 16 Jan 2007 21:19:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:1419216</guid><dc:creator>pjohnson</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/pjohnson/rsscomments.aspx?PostID=1419216</wfw:commentRss><comments>http://weblogs.asp.net/pjohnson/archive/2007/01/16/aspinsiders-summit-2006-c-3-0-and-linq.aspx#comments</comments><description>&lt;p&gt;C# 3.0 (not to be confused with the confusingly-named &lt;a href="http://www.netfx3.com/"&gt;.NET Framework 3.0&lt;/a&gt;, which includes C# 2.0, not C# 3.0) was the most exciting thing discussed at the ASPInsiders Summit. When I first learned a bit about &lt;a href="http://msdn2.microsoft.com/en-us/netframework/aa904594.aspx" title="Microsoft: The LINQ Project"&gt;LINQ&lt;/a&gt; at the 2005 summit, I didn&amp;#39;t really get what was so great about taking some mangled SQL syntax and duct-taping it onto the language. Given a few hours for &lt;a href="http://en.wikipedia.org/wiki/Anders_Hejlsberg" title="Wikipedia: Anders Hejlsberg"&gt;Anders Hejlsberg&lt;/a&gt;, the lead architect of C#, to explain LINQ, how it came to be, how it works behind the scenes, and why it&amp;#39;s a Good Thing, I changed my mind. He and Scott Guthrie sold me on LINQ (at least, as much as I could be until it&amp;#39;s released and I can play with it first-hand).&lt;br /&gt; &lt;/p&gt;&lt;p&gt;Most of the big changes in C# 3.0 were driven by LINQ, which is why I&amp;#39;m talking about them in conjunction. But this doesn&amp;#39;t mean they&amp;#39;re LINQ-specific; I can think of a ton of cases independent of LINQ where this stuff will be useful. It reminds me of when &amp;quot;XML web services&amp;quot; was repeated in every lecture, article, blog post, knowledge base article, and whitepaper from Microsoft that talked about the .NET Framework when it first came out, as if that was the main thing anyone would use the framework for. Though I&amp;#39;ve done a ton of .NET programming, I think &lt;em&gt;maybe&lt;/em&gt; 1% of has had &lt;em&gt;anything&lt;/em&gt; to do with web services. Thankfully, only few seem to have been fooled by that and adoption took off anyway.&lt;/p&gt;&lt;p&gt;But back to C# 3.0&amp;#39;s new features. These are explained in more depth and with more examples on the &lt;a href="http://msdn2.microsoft.com/en-us/netframework/aa904594.aspx"&gt;LINQ Project site&lt;/a&gt;, so check out the overview there for more information--no need for me to duplicate all that.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Local variable type inference&lt;/strong&gt; (or, &amp;quot;No, it&amp;#39;s OK, the var keyword isn&amp;#39;t evil anymore&amp;quot;). Former ASP programmers like me instinctively shudder when we see the keyword &amp;quot;var&amp;quot;, and recoil a bit when we hear it&amp;#39;s being introduced to C#. But this has nothing to do with late binding or strong typing--this is just something to allow programmers to be just a little lazier. The basic idea is if you have a long type like &lt;span style="font-size: 8pt; font-family: 'Courier New'"&gt;Dictionary&amp;lt;int, MyCoolButLongType&amp;gt;&lt;/span&gt; you&amp;#39;re newing up on the right, you don&amp;#39;t have to type all that on the left since the compiler already knows what type it is.&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New'"&gt;int i = 5;&lt;br /&gt;
Dictionary&amp;lt;int, Order&amp;gt; orders = new Dictionary&amp;lt;int, Order&amp;gt;();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New'"&gt;&lt;/span&gt;is 100% equivalent to:&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; font-family: Verdana"&gt;&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New'"&gt;var i = 5;&lt;br /&gt;
var orders = new Dictionary&amp;lt;int, Order&amp;gt;();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The variable &lt;span style="font-size: 8pt; font-family: 'Courier New'"&gt;orders&lt;/span&gt; still has the same type of &lt;span style="font-size: 8pt; font-family: 'Courier New'"&gt;Dictionary&amp;lt;int, Order&amp;gt;&lt;/span&gt; it does in the first example. It&amp;#39;ll still behave the same as it did, you&amp;#39;ll still get the same Visual Studio IntelliSense you did, and the IL will be the same. Var is &lt;em&gt;not&lt;/em&gt; variant here--it&amp;#39;s &amp;quot;I&amp;#39;m lazy so let the compiler figure it out.&amp;quot;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Extension methods.&lt;/strong&gt; This allows you to &amp;quot;add&amp;quot; your own methods to types you can&amp;#39;t otherwise change yourself, e.g. in the .NET Framework or third-party libraries. So if you&amp;#39;ve always wanted a string.FooBar() method, just write it as an extension method, include its namespace, and you&amp;#39;ve got your string.FooBar() method. Everyone&amp;#39;s got a pet peeve this can address--some method they wish the framework provided, a string or numeric operation. Now it&amp;#39;s yours, whatever you want, however you want it to work.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Lambda expressions.&lt;/strong&gt; This is another feature for laziness/concision, making it easier to write a function inline than you could with C# 2.0&amp;#39;s anonymous methods.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New'"&gt;List&amp;lt;Customer&amp;gt; customers =
GetCustomerList();&lt;br /&gt;
List&amp;lt;Customer&amp;gt; locals = customers.FindAll(c =&amp;gt; c.State == &amp;quot;KY&amp;quot;);&lt;/span&gt; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;reads as &amp;quot;Find all c such that c.State equals Kentucky&amp;quot;. The compiler infers that the return type of this lambda expression is boolean, due to the comparison operator ==.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Object initializers.&lt;/strong&gt; This is one of the (few) good things about VBA (Visual Basic for Applications), the version of VB included with the Microsoft Office products and a platform on which I unfortunately found myself doing a lot programming several years ago. Using the new keyword to create an instance of an object, you can now specify initial values for public properties and fields.&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New'"&gt;Person value = new Person { Name = &amp;quot;Chris Smith&amp;quot;, Age = 31 };&lt;/span&gt;&lt;/p&gt;&lt;p&gt;creates a new Person instance, setting its Person.Name and Person.Age properties.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Query expressions.&lt;/strong&gt; This is what LINQ looks like on the surface. An example statement using a query expression on the right side:&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New'"&gt;var customerQuery = &lt;/span&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New'"&gt;&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New'"&gt;from c in customers&lt;br /&gt;
where c.State == &amp;quot;WA&amp;quot;&lt;br /&gt;
select new {c.Name, c.Phone};&lt;/span&gt;&lt;/p&gt;&lt;p&gt;where customers is a custom collection, like &lt;span style="font-size: 8pt; font-family: 'Courier New'"&gt;List&amp;lt;Customer&amp;gt;&lt;/span&gt;. One of the biggest questions I had is why in the world they took the SQL SELECT..FROM..WHERE syntax we all know and &amp;quot;love&amp;quot; and jumbled it up. Fortunately, Anders addressed this, saying Microsoft considered implementing LINQ syntax it in the same order as SQL, but really, SQL doesn&amp;#39;t make sense. When you execute a SQL query, it starts with FROM and WHERE (table/index scans), then goes to SELECT, just like these query expressions in C#. C# doing it this way both helps get IntelliSense and is more forward-looking (what makes sense if we were designing this from scratch, and giving ourselves the option to expand it later) than backward-looking (how&amp;#39;s it been done before; what are people used to). It looks weird the first time to those of us used to seeing SQL, but it makes sense after you get past that hump.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Expression trees.&lt;/strong&gt; The .NET Framework (and C#) will have expression trees and expression parsing built in. So for example, you can give it a string, and it will build a tree of Expression objects behind the scenes to represent it. Anyone who&amp;#39;s written their own search or query syntax can imagine how powerful this could be.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;So look again at the above query expression. The C# compiler rewrites it as:&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New'"&gt;var customerQuery = &lt;/span&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New'"&gt;customers.Where(c =&amp;gt; c.State == &amp;ldquo;WA&amp;rdquo;).Select(c
=&amp;gt; new {c.Name, c.Phone});&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Now you can see how all this begins to tie together: A query expression gets expanded into a more verbose and less readable statement using extension methods (&lt;span style="font-size: 8pt; font-family: 'Courier New'"&gt;List&amp;lt;Customer&amp;gt;&lt;/span&gt; doesn&amp;#39;t have a native Where method) and lambda expressions. The lambda expressions get parsed into expression trees and return &lt;strong&gt;anonymous types&lt;/strong&gt; (the return value of the Select lambda expression). We reference the results of the query expression with a local variable using type inference (we can&amp;#39;t determine the return type of the query expression, and with type inference it doesn&amp;#39;t matter--nevertheless it&amp;#39;s still strongly typed). It&amp;#39;s the &lt;a href="http://www.imdb.com/title/tt0110357/" title="IMDb: Lion King (1994)"&gt;circle of life&lt;/a&gt;!&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Hopefully I&amp;#39;m explaining this clear enough that some of you can understand why at this point I was getting very impressed. Keep in mind all this compiler magic doesn&amp;#39;t come at any efficiency/performance hit at runtime.&lt;/p&gt;&lt;p&gt;In case this syntax isn&amp;#39;t enough to sell you on LINQ, here are a few more objective reasons. With just ADO.NET today, you have queries as quoted strings, parameters loosely bound, and results loosely typed, and the compiler can&amp;#39;t help check code; LINQ helps in that classes describe data, the query is natural part of the language instead of a string, and the compiler provides IntelliSense and compile-time checking--it&amp;#39;s entirely strongly typed in C# and VB. Another reason is that LINQ can be used to query against objects, DataSets, SQL data sources, XML out of the box using an extensible provider-driven model like those you find in .NET 2.0 today. And it has paging built-in, not specific to SQL Server.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Again, check out the &lt;a href="http://msdn.microsoft.com/library/en-us/dndotnet/html/linqprojectovw.asp" title="MSDN: LINQ Project Overview"&gt;LINQ Project Overview&lt;/a&gt; if you want more information, including a more detailed look at the
features I mentioned and a few I skipped over.&lt;br /&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=1419216" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/pjohnson/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/ASPInsiders2006/default.aspx">ASPInsiders2006</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/Events/default.aspx">Events</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/ASPInsiders/default.aspx">ASPInsiders</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/LINQ/default.aspx">LINQ</category></item><item><title>ASPInsiders Summit 2006 - IIS 7</title><link>http://weblogs.asp.net/pjohnson/archive/2006/12/29/aspinsiders-summit-2006-iis-7.aspx</link><pubDate>Fri, 29 Dec 2006 18:15:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:1328297</guid><dc:creator>pjohnson</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/pjohnson/rsscomments.aspx?PostID=1328297</wfw:commentRss><comments>http://weblogs.asp.net/pjohnson/archive/2006/12/29/aspinsiders-summit-2006-iis-7.aspx#comments</comments><description>&lt;p&gt;Earlier this month was the &lt;a href="http://aspinsiders.com/"&gt;ASPInsiders&lt;/a&gt; Summit at Microsoft. As finishing the QA cycle for, deploying, and supporting a project at work has kept me busy, followed immediately by the holidays, I haven&amp;#39;t had much chance to blog about it until now. This is partly a good thing, since it means others more punctual than me have &lt;a href="http://aspadvice.com/blogs/ssmith/archive/2006/12/05/ASPInsiders-Public-Notes-_2D00_-Scott-Guthrie.aspx" title="Steve Smith&amp;#39;s notes from Scott Guthrie&amp;#39;s talk"&gt;blogged about it first&lt;/a&gt; and &lt;a href="http://aspadvice.com/blogs/ssmith/archive/2006/12/06/C_2300_-3.0-Feature-Notes.aspx" title="Steve Smith&amp;#39;s notes from Anders Hejlsberg&amp;#39;s C# 3.0 talk"&gt;saved me some trouble&lt;/a&gt;. Thanks, Steve!&lt;br /&gt;&lt;br /&gt;As usual, they talked a bit about stuff that&amp;#39;s recently been released, such as Visual Studio 2005 Team Edition for Database Professionals and the now-released action-packed VS 2005 SP1, where &lt;a href="http://weblogs.asp.net/pjohnson/archive/2006/05/09/445847.aspx" title="Peter Johnson&amp;#39;s Blog: Web Application Projects for Visual Studio 2005 released"&gt;Web Application Projects&lt;/a&gt; becomes a first-class citizen in the Visual Studio world as they should have been since day one.&lt;/p&gt;&lt;p&gt;One of the cooler things from the first day, beginning in Scott Guthrie&amp;#39;s opening talk and continuing into its own sessions, was &lt;a href="http://www.iis.net/default.aspx?tabid=7" title="IIS.net: Internet Information Services 7.0"&gt;IIS 7&lt;/a&gt;. I&amp;#39;m more focused on writing C# code for the web and SQL Server database maintenance than IIS administration lately, but I&amp;#39;ve been responsible for varying degrees of it since IIS 4. I remember when Gartner published their &lt;a href="http://www.gartner.com/DisplayDocument?doc_cd=101034" title="Gartner: Nimda Worm Shows You Can&amp;#39;t Always Patch Fast Enough"&gt;scathing recommendation that companies ditch IIS&lt;/a&gt; until it&amp;#39;s rewritten, which as I understand happened soon after with version 6. Still, Scott said &lt;a href="http://www.iis.net/default.aspx?tabid=7&amp;amp;subtabid=71" title="IIS.net: Core Web Server Architecture"&gt;IIS 7&lt;/a&gt; is the biggest release of IIS in years (though he may have meant the three and a half years since IIS 6 came out!).&lt;br /&gt;&lt;/p&gt;&lt;p&gt;There&amp;#39;s a new system.webServer configuration file section for IIS settings, like the system.web settings used for ASP.NET applications today. This puts another nail in the coffin of the horrible, brittle binary metabase from IIS 5 and earlier, moving things like directory browsing and default document settings into a config file, allowing you to set it on the machine level and override it during xcopy deployment per application if you want. And you can make changes programmatically.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;IIS 7 also takes another step towards a more modular design, going from about 6 components today to about 42. So you can take things like ISAPI filters, CGI, ASP, ASP.NET, and Windows authentication and enable/disable them as needed for your particular server. Making up for lost time on the security front, this allows administrators to greatly reduce IIS&amp;#39;s attack surface. Plus, if you don&amp;#39;t like the way IIS does something, you can &lt;a href="http://www.iis.net/default.aspx?tabid=2&amp;amp;subtabid=25&amp;amp;i=942" title="IIS.net: Developing a Module using .NET"&gt;write your own module in ASP.NET&lt;/a&gt; and override it. Scott&amp;#39;s example showed the directory list module replaced by one he&amp;#39;d written, that instead of giving you a boring file listing, gives you a thumbnail-based image gallery instead. Cool!&lt;br /&gt;&lt;/p&gt;&lt;p&gt;(As a budding photographer, I was impressed by the pictures he used to demonstrate this--close-ups of lions he&amp;#39;d taken with a &lt;a href="http://www.kenrockwell.com/nikon/40028afsII.htm"&gt;monster 400mm lens&lt;/a&gt; during a recent vacation to South Africa.)&lt;/p&gt;&lt;p&gt;ASP.NET gets one step closer to (if not reaching entirely) full-class citizenship. As &lt;a href="http://www.iis.net/default.aspx?tabid=2&amp;amp;subtabid=25&amp;amp;i=928" title="IIS.net: ASP.NET Integration with IIS7"&gt;Mike Volodarsky explains&lt;/a&gt;, whereas requests before had to go through the IIS framework before reaching the ASP.NET framework, the two duplicate layers are now integrated into one. An example of why the old way sucked is how many folks had applications set up to be anonymous in IIS, so it would pass through authentication to ASP.NET which would then authenticate the request. An example of why the new way is cool is that since all the authentication happens at the same level--Basic, Anonymous, Windows, and ASP.NET&amp;#39;s Forms Authentication, to name a few--you can now have ASP and PHP apps, as well as static files like JPG and CSS, authenticating via ASP.NET Forms Authentication. Cool. We&amp;#39;ve got some sites that still have a lot of ASP pages to migrate over, so this could help out a lot.&lt;/p&gt;&lt;p&gt;Oh, and they&amp;#39;re getting rid of ISAPI too. As I said, you can write modules in .NET, or &lt;a href="http://www.iis.net/default.aspx?tabid=2&amp;amp;subtabid=25&amp;amp;i=938" title="IIS.net: How to Build a Native Code IIS7 Module Using C++"&gt;in C++ using a new, better API&lt;/a&gt;. I&amp;#39;m not a Windows C++ programmer, so you&amp;#39;re on your own with that one.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;This is all built into Windows Vista as I understand it (having not had much opportunity to dig into Vista yet myself); the upcoming &amp;quot;Longhorn&amp;quot; release of Windows Server will have even more, which unfortunately is under NDA at the moment. As a &lt;a href="http://blogs.technet.com/windowsserver/archive/2006/12/13/pre-register-for-beta-3.aspx" title="Windows Server Division WebLog: Pre-Register for Beta 3!"&gt;feature-complete, publicly-available Beta 3&lt;/a&gt; is expected in the first half of 2007, you&amp;#39;ll hear about it soon enough.&lt;br /&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=1328297" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/pjohnson/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/ASPInsiders2006/default.aspx">ASPInsiders2006</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/Events/default.aspx">Events</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/ASPInsiders/default.aspx">ASPInsiders</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/IIS/default.aspx">IIS</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/Vista/default.aspx">Vista</category></item><item><title>Windows service setup projects - Unable to build custom action error</title><link>http://weblogs.asp.net/pjohnson/archive/2006/08/14/Windows-service-setup-projects-_2D00_-Unable-to-build-custom-action-error.aspx</link><pubDate>Mon, 14 Aug 2006 18:22:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:469475</guid><dc:creator>pjohnson</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/pjohnson/rsscomments.aspx?PostID=469475</wfw:commentRss><comments>http://weblogs.asp.net/pjohnson/archive/2006/08/14/Windows-service-setup-projects-_2D00_-Unable-to-build-custom-action-error.aspx#comments</comments><description>
&lt;p&gt;I ran into another under-documented snag upgrading my solution to
Visual Studio 2005. It has a Windows service used for behind-the-scenes
maintenance sorts of tasks that run on a regular basis, and a
corresponding setup project. Now, it&amp;#39;s also got setup projects for
command-line apps and web apps, and all of those upgraded fairly
well--it got confused on the output, so I had to delete and re-add the
appropriate Primary Output to each project, but after that, all the
setup projects built fine, except the Windows service one.&lt;/p&gt;

&lt;p&gt;It gave this error in the Output window when I tried to build it.&lt;/p&gt;

&lt;hr /&gt;
&lt;font face="Courier New" size="2"&gt;
Building file &amp;#39;C:\whatever\MyProjectSetup.msi&amp;#39;...&lt;br /&gt;
ERROR: Unable to build custom action named &amp;#39;Primary output from
MyProject (Release .NET)&amp;#39; because it references an object that has been
removed from the project.&lt;br /&gt;
Build process cancelled&lt;br /&gt;
&lt;/font&gt;
&lt;hr /&gt;

&lt;p&gt;In the Error List, when I double-clicked on this error, it took me to
the Custom Actions window for this project. As documented in &lt;a href="http://support.microsoft.com/kb/816169/" title="Microsoft: How to create a setup project for a Windows Service application"&gt;this Microsoft Knowledge Base article&lt;/a&gt;,
the project had the Primary Output listed as a custom action for all
four custom action types--Install, Commit, Rollback, and Uninstall. The
Uninstall one is the only one highlighted, though, with a red wavy
underline. This told me nothing more about the error.&lt;/p&gt;

&lt;p&gt;Sometimes in cases like this, when I open the project file in Notepad,
it can make it clear what&amp;#39;s wrong. For instance, when a Crystal Reports report
loses its corresponding .cs file, I can reassociate them by manually
editing the project file and reopening the project. But .vdproj files
are different beasts--&lt;span style="font-style: italic"&gt;much&lt;/span&gt; uglier and harder to manage in Notepad.&lt;/p&gt;

&lt;p&gt;That KB article said it was set up correctly, and yet it wasn&amp;#39;t
building. So I tried deleting all four custom actions, and re-adding
them per the &lt;a href="http://support.microsoft.com/kb/816169/" title="Microsoft: How to create a setup project for a Windows Service application"&gt;directions in the article&lt;/a&gt;, and it built,
installed, started and ran, and uninstalled just fine. (For what it&amp;#39;s worth, Microsoft &lt;span style="font-style: italic"&gt;did&lt;/span&gt; document this process in &lt;a href="http://msdn2.microsoft.com/en-us/library/yhteff89.aspx" title="Microsoft: Unable to build custom action named &amp;#39;&amp;lt;name&amp;gt;&amp;#39; because it references an object that has been removed from the project"&gt;an MSDN Library article&lt;/a&gt;.)&lt;/p&gt;

&lt;p&gt;One difference I see is that all my project outputs in all my
setup projects, including these custom actions, now read &amp;quot;(Release Any
CPU)&amp;quot; instead of &amp;quot;(Release .NET)&amp;quot;. I&amp;#39;m not sure what difference that
makes, nor why I should care (and have to correct it manually), but as
far as I can see, it&amp;#39;s working fine now. We&amp;#39;ll see if I get any nasty
surprises when I give it to QA for testing.
&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=469475" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/pjohnson/archive/tags/General+Software+Development/default.aspx">General Software Development</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/Windows+Services/default.aspx">Windows Services</category></item><item><title>Ambiguous match found</title><link>http://weblogs.asp.net/pjohnson/archive/2006/08/11/Ambiguous-match-found.aspx</link><pubDate>Fri, 11 Aug 2006 17:31:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:467435</guid><dc:creator>pjohnson</dc:creator><slash:comments>93</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/pjohnson/rsscomments.aspx?PostID=467435</wfw:commentRss><comments>http://weblogs.asp.net/pjohnson/archive/2006/08/11/Ambiguous-match-found.aspx#comments</comments><description>&lt;P&gt;Looks like I've been away a few months. Sorry 'bout that. I've had stuff to write about but not enough time to set aside to do so, which is a little ironic; one of the main reasons I created this blog was so I could take 5 minutes and jot down stuff I find out while developing, largely in case it helps others, not so I could write my usual verbose 5000 word essays (which is what &lt;A title="ASP Alliance: Peter Johnson" href="http://aspalliance.com/author.aspx?uId=1026" mce_href="http://aspalliance.com/author.aspx?uId=1026"&gt;my AspAlliance site&lt;/A&gt; is for!).&lt;/P&gt;
&lt;P&gt;So, on that note, I wanted to share how I solved a goofy error that made no sense. I was upgrading a good-sized web application from .NET 1.1/Visual Studio 2003 to .NET 2.0/Visual Studio 2005 using &lt;A title="Migrating a VS 2003 Web Project to VS 2005" href="http://webproject.scottgu.com/CSharp/Migration/Migration.aspx" mce_href="http://webproject.scottgu.com/CSharp/Migration/Migration.aspx"&gt;Scott Guthrie's well-written instructions&lt;/A&gt; and the Web Application Projects add-in. Going through VS2005's automatic conversion and building it was pretty painless when I followed Scott's instructions; one wrinkle I ran into is that it forgot about the three web projects, so I had to add those manually using "Add Existing Project" after I converted the others.&lt;/P&gt;
&lt;P&gt;But it built and I went through the app and everything was fine. I didn't do the "Convert to Web Application" command on the whole project, preferring to keep a closer eye on what it changed, and touch it up after. So I started doing it folder by folder per Step 8 inScott's instructions, and it seemed to work great, until I got to one particular page and got this error. &lt;/P&gt;
&lt;HR&gt;
&lt;FONT face="Courier New" size=2&gt;Parser Error&lt;BR&gt;Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.&lt;BR&gt;&lt;BR&gt;Parser Error Message: Ambiguous match found.&lt;BR&gt;&lt;BR&gt;Source Error:&lt;BR&gt;&lt;BR&gt;Line 1:&amp;nbsp; &amp;lt;%@ Control language="c#" Inherits="MyApp.Namespace.MyCoolControl" CodeBehind="&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;MyCoolControl&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;.ascx.cs" AutoEventWireup="false" %&amp;gt;&lt;BR&gt;Line 2:&amp;nbsp; &amp;lt;%@ Import Namespace="&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;MyApp.OtherNamespace&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;" %&amp;gt;&lt;BR&gt;Line 3:&amp;nbsp; &amp;lt;div class="openingParagraph"&amp;gt;&lt;BR&gt;&lt;BR&gt;Source File: /MyApp/Namespace/&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;MyCoolControl&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;.ascx&amp;nbsp;&amp;nbsp;&amp;nbsp; Line: 1&lt;BR&gt;&lt;/FONT&gt;
&lt;HR&gt;

&lt;P&gt;So it says Line 1, Line 1 is highlighted, and yet, the only reference in line 1 is a fully-qualified one. To be safe, I pulled all my custom assemblies into the invaluable &lt;A title="Lutz Roeder's .NET Reflector" href="http://www.aisto.com/roeder/dotnet/" mce_href="http://www.aisto.com/roeder/dotnet/"&gt;.NET Reflector&lt;/A&gt; and double-checked, and there was only one instance of that class name anywhere.&lt;/P&gt;
&lt;P&gt;I tried what I normally try when I get weird ASP.NET errors I shouldn't be getting, a process many of you are probably too familiar with if you've worked with ASP.NET very long. I restarted IIS, deleted and recreated the application in IIS Manager, deleted the Temporary ASP.NET Files directory for MyApp (after closing Visual Studio), restarted Visual Studio and rebuilt the project, etc. None of these helped this time.&lt;/P&gt;
&lt;P&gt;Scott's instructions mentioned this error in some cases, notably the IE WebControls, but the solution has been to specify the full namespace, not just the class name, so that didn't help me. Other Google search results were similarly unhelpful, until I found &lt;A class="" title="Advanced .NET Debugging - Eran Sandler's blog" href="http://dotnetdebug.net/" mce_href="http://dotnetdebug.net/"&gt;the blog of a guy named Eran Sandler&lt;/A&gt; who talked about &lt;A class="" title='Advanced .NET Debugging: "Ambiguous match found" in a Web Control - a Possible Bug' href="http://dotnetdebug.net/2006/03/21/ambiguous-match-found-in-a-web-control-a-possible-bug/" mce_href="http://dotnetdebug.net/2006/03/21/ambiguous-match-found-in-a-web-control-a-possible-bug/"&gt;his "Ambiguous match found" error and how he solved it&lt;/A&gt;--two protected fields with names that differed only in case, apparently confusing reflection.&lt;/P&gt;
&lt;P&gt;Sure enough, my code had the same problem--I had myRepeaterControl (name changed to protect the innocent, of course), and MyRepeaterControl in my code-behind. The latter wasn't used and was probably left in mistakenly; I removed it, it still built fine, and the control worked great.&lt;/P&gt;
&lt;P&gt;Thanks, Eran!&lt;BR&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=467435" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/pjohnson/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/pjohnson/archive/tags/Visual+Studio/default.aspx">Visual Studio</category></item><item><title>Convert.ChangeType wrapper that handles nullable types</title><link>http://weblogs.asp.net/pjohnson/archive/2006/05/19/447154.aspx</link><pubDate>Fri, 19 May 2006 17:06:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:447154</guid><dc:creator>pjohnson</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/pjohnson/rsscomments.aspx?PostID=447154</wfw:commentRss><comments>http://weblogs.asp.net/pjohnson/archive/2006/05/19/447154.aspx#comments</comments><description>As I &lt;A href="http://weblogs.asp.net/pjohnson/archive/2006/02/07/437631.aspx"&gt;mentioned before&lt;/a&gt;, the Convert.ChangeType method doesn't handle nullables. One of the comments proposed a replacement, but I preferred to have a wrapper around the original Convert.ChangeType method, so in general it would behave identical to Convert.ChangeType, except that it would handle nullable types as well instead of throwing an InvalidCastException.&lt;br /&gt; &lt;br /&gt; I wrote, compiled, and tested such a wrapper finally, and posted it as a CodeSnip article on ASP Alliance, where I've also been an author for over five years. &lt;a href="http://aspalliance.com/852"&gt;Check out my ChangeType method&lt;/a&gt;, use it, let me know what you think! Oh, and if anyone on the CLR team is reading this post, feel free to incorporate my wrapper in the next .NET Framework service pack. ;-)&lt;br /&gt; &lt;br /&gt; Special thanks to a fellow ASP Alliance author, the multiple blog-having &lt;a href="http://dotnettemplar.net/"&gt;J. Ambrose Little&lt;/a&gt; and alert reader, Google user, weblogs.asp.net surfer, and my brother, &lt;a href="http://blog.pumacode.org/"&gt;Toby Johnson&lt;/a&gt; for helping me put together this method.&lt;br /&gt; &lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=447154" width="1" height="1"&gt;</description></item><item><title>Web Application Projects for Visual Studio 2005 released</title><link>http://weblogs.asp.net/pjohnson/archive/2006/05/09/445847.aspx</link><pubDate>Tue, 09 May 2006 15:09:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:445847</guid><dc:creator>pjohnson</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/pjohnson/rsscomments.aspx?PostID=445847</wfw:commentRss><comments>http://weblogs.asp.net/pjohnson/archive/2006/05/09/445847.aspx#comments</comments><description>Last night, Microsoft &lt;A href="http://weblogs.asp.net/scottgu/archive/2006/05/08/445742.aspx"&gt;released the final version of the Web Application Projects option&lt;/a&gt; for Visual Studio 2005. This was &lt;A href="http://weblogs.asp.net/pjohnson/archive/2006/02/06/437563.aspx"&gt;one of the first things I blogged about&lt;/a&gt;, and they've been hammering it out and going through betas and CTP's and RC's ever since. For now, it's a separate download, but going forward (as of VS2005 SP1) it'll be integrated into the application as a "first-class citizen."&lt;br /&gt; &lt;br /&gt; In the .NET 2.0 app I'm working on, I finally got to a point in the project where I could try it out (a full 12 hours before release!). I followed &lt;a href="http://webproject.scottgu.com/CSharp/Migration2/Migration2.aspx"&gt;Scott Guthrie's directions to upgrade an existing VS2005 web site&lt;/a&gt; (I'm a C# guy; Scott has &lt;a href="http://webproject.scottgu.com/VisualBasic/Migration2/Migration2.aspx"&gt;directions for VB&lt;/a&gt; too) and was quite pleased with them overall--easy to follow, didn't leave much out.&lt;br /&gt; &lt;br /&gt; First, the things I like about WAP:&lt;br /&gt; &lt;br /&gt; - Namespaces: In a VS2005 web site, newly added files don't get a namespace, which is kind of kludgy if you have a VS.NET 2003 project with namespaces specified for every page and control, then upgrade to VS2005, and add new pages and controls and have to leave them in the default namespace, or manually put that code in (or maintain the VS2005 file templates manually). WAP lets you specify and modify default namespaces again.&lt;br /&gt; &lt;br /&gt; - AssemblyInfo.cs and generated code files: I'm a pretty picky developer and I like being able to specify properties for my assemblies myself, and see all the code that goes into that assembly, and WAP makes that easier. You see the MyPage.aspx.designer.cs files in VS's Solution Explorer, which contain the wireup code that was mixed in with the regular code-behind file in VS.NET 2003, and generated and compiled behind the scenes in VS2005 web sites.&lt;br /&gt; &lt;br /&gt; - Faster compilation: My web app is rather small, but it was still noticeably faster to compile it as a WAP rather than a web site. According to Scott:&lt;br /&gt; &lt;br /&gt; &lt;blockquote&gt;VS 2005 WAP build times are significantly faster that Web Site Projects – in some cases 10x or more. That is because WAP projects only compile the code-behind of the project and standalone classes (like VS 2003 did).&amp;nbsp; Web Site Projects do deeper compilation and verification, which is nice, but which does slow things down.&amp;nbsp; There are several settings you can change to modify this, but WAP projects will always compile fastest.&lt;br /&gt; &lt;/blockquote&gt;&lt;br /&gt; Note that I'm only talking about building the project in VS, not the JIT compilation from MSIL to native code that happens when you first pull it up in the web browser; that speed didn't appear to change in my case.&lt;br /&gt; &lt;br /&gt; Here are a few snags or "opportunities for improvement" (to use a more overly politically correct term) I found in upgrading from a VS2005 web site to a web application project:&lt;br /&gt; &lt;br /&gt; - One thing Scott did seem to leave out of his directions is how to convert web references. I had to dig out an URL, have VS2005 recreate the web reference, and then make some manual changes (since Reference.cs is apparently dynamically generated with a web site project, so I couldn't use it for, um, reference). Unfortunately, this is the way to do it for now (which would be a real pain if you listened to Microsoft's marketing a few years ago and used web services for darn near everything!), though they're considering automating that conversion in future versions.&lt;br /&gt; &lt;br /&gt; - Another thing the directions don't take into account is source control. I don't know if it's not expected that a large enough portion of the audience will be using source control to warrant including that in the directions, or because they're keeping it simple. As it is, I didn't want to lose my files' history (and didn't want to mess with branching, especially since I'm using the &lt;a href="http://msdn.microsoft.com/library/en-us/dnvsent/html/vsts-team.asp"&gt;source control in Team Foundation Server&lt;/a&gt;), so I moved from the site to the project instead of copying, and crossed my fingers I didn't break anything. So far, so good--the site's working great on my development machine.&lt;br /&gt; &lt;br /&gt; - Having upgraded my application from VS.NET 2003 originally, I had a Global.ascx and Global.ascx.cs; I moved the latter to App_Code and manually changed the former to inherit from it. So I manually moved that back when moving it to a web app project. I'm not sure if that's a common practice that would be worth including in the instructions, or just the weird way I did it when moving from VS.NET 2003 -&amp;gt; VS2005 web site. Also, when I double-click on Global.ascx in VS2005, it refuses to open that file, opening Global.ascx.cs instead. To change Global.ascx, I had to open it in Notepad (*gasp*).&lt;br /&gt; &lt;br /&gt; - We have a third-party component (Aspose.Excel, now called &lt;a href="http://www.aspose.com/Wiki/default.aspx/Aspose.Cells/ProductOverview.html"&gt;Aspose.Cells&lt;/a&gt;) that uses a .lic licensing file. I'm not sure we've ever (in VS.NET 2003, VS2005 web site, VS2005 web app) handled this the "right" way--pretty much just get it working and then leave it alone. I got it working this time by copying the file from the web site project's bin to the web app project's bin via Windows Explorer. I was hoping there would be a best practices way (probably using VS2005) to get this .lic file copied to the bin directory; I looked on the component reference's properties and didn't see anything obvious. No such luck for the time being.&lt;br /&gt; &lt;br /&gt; Overall I'm happy with it, and would definitely use a web application project for a new VS2005 project over the web site model. I'm kind of a low-level, class library developer sort of guy, so it's nice to have namespaces, AssemblyInfo.cs, generated code files in the solution, faster compilation, etc. back.&lt;br /&gt; &lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=445847" width="1" height="1"&gt;</description></item><item><title>Do you need to turn off your PC at night?</title><link>http://weblogs.asp.net/pjohnson/archive/2006/04/26/Do-you-need-to-turn-off-your-PC-at-night_3F00_.aspx</link><pubDate>Wed, 26 Apr 2006 19:26:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:444109</guid><dc:creator>pjohnson</dc:creator><slash:comments>11</slash:comments><description>I &lt;i&gt;knew&lt;/i&gt; there was a reason I still subscribe to the &lt;a href="https://www.microsoft.com/athome/newsletters/default.mspx"&gt;Microsoft At Home and At Work Newsletter&lt;/a&gt;.&lt;br /&gt; &lt;br /&gt; This morning's edition linked to &lt;a href="http://www.microsoft.com/smallbusiness/resources/technology/hardware/do_you_need_to_turn_off_your_pc_at_night.mspx"&gt;an article analyzing your PC's power usage&lt;/a&gt; at various states--on, off, hibernate, and standby--both the computer and the monitor. Sure, I knew you save power by turning it off, but I hadn't realized (nor thought about it lately) that turning it off and on every day doesn't really hurt much like it used to when I first started using computers (don't make me say how long ago THAT was). Nor did I realize that CRT's use so much more power than flat panels. The bottom line of the article is that turning your PC off indeed saves more power than the other options, but setting it to hibernate overnight is nearly as good.&lt;br /&gt; &lt;br /&gt; It also made a frank point that struck the bleeding-heart tree-hugging hippie in me (not to mention my frugal side)--is it worth wasting that energy (and money) to save a few minutes' startup time (to boot, log in, and restore state, such as opening mail, browser, and chat programs) every morning? And, using Windows' hibernate or standby, you don't even take THAT hit. I think Windows default settings have standby and/or hibernate on, but I always turn it off after I install Windows &lt;i&gt;because&lt;/i&gt; of that annoyance, not thinking about the consequences.&lt;br /&gt; &lt;br /&gt; Time to turn it back on on my computers.&lt;br /&gt; &lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=444109" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/pjohnson/archive/tags/General+Software+Development/default.aspx">General Software Development</category></item><item><title>ApplicationException obsolete?</title><link>http://weblogs.asp.net/pjohnson/archive/2006/04/12/442678.aspx</link><pubDate>Wed, 12 Apr 2006 18:09:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:442678</guid><dc:creator>pjohnson</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/pjohnson/rsscomments.aspx?PostID=442678</wfw:commentRss><comments>http://weblogs.asp.net/pjohnson/archive/2006/04/12/442678.aspx#comments</comments><description>As I catch up on finding and adding to NewsGator all the blogs I've missed and shouldn't have, I found the &lt;a href="http://blogs.msdn.com/fxcop/"&gt;FxCop blog&lt;/a&gt; thanks to &lt;a href="http://notgartner.com/posts/4082.aspx"&gt;a recent post by Mitch Denny&lt;/a&gt;. I'm a nut for best practices, but admit I don't use FxCop itself as much as I should. I just read up on design guidelines and do my best to implement them, which works out quite well relatively, judging by a lot of other code out there.&lt;br /&gt; &lt;br /&gt; In skimming said FxCop blog, I found &lt;a href="http://blogs.msdn.com/fxcop/archive/2006/04/05/569569.aspx"&gt;an entry on ApplicationException&lt;/a&gt;. It recommends not throwing ApplicationException in your code, nor deriving any custom exceptions from it, instead using Exception. Now, I've written a fair bit of code and a dozen or so custom exception classes that derive from ApplicationException which was the recommendation from Microsoft and the community, so this news was a bit shocking and hard to understand at first. I posted a long comment there with my feedback before realizing that it'd make a good blog post.&lt;br /&gt; &lt;br /&gt; These new recommendations coupled with the fact that ApplicationException is by definition not something the Framework will derive/throw, begs the question: What's the ApplicationException class to be used for now? And if the answer is "nothing," why isn't it marked as obsolete, since the &lt;a href="http://blogs.msdn.com/brada/archive/2004/03/25/96251.aspx"&gt;recommendation in Brad's entry&lt;/a&gt; came out nearly 18 months ahead of .NET 2.0? &lt;b&gt;Edit:&lt;/b&gt; David Kean, who cowrote the FxCop entry, replied and let me know a practical reason that class wasn't marked as obsolete (since it's used as a base class, so marking it obsolete would be a breaking change). So I can understand why it wasn't, but it would still be easier on developers if the compiler gave a warning like it does for other classes that should no longer be used in .NET 2.0.&lt;br /&gt; &lt;br /&gt; The post references "several outdated documents floating around on the web (some orginally published by Microsoft)" that still advise deriving all your exceptions from ApplicationException. One pretty significant example of said documents is &lt;a href="http://msdn2.microsoft.com/en-US/library/system.applicationexception%28VS.80%29.aspx"&gt;the official Microsoft .NET Framework documentation&lt;/a&gt;.&lt;br /&gt; &lt;br /&gt; After thinking about it and reading the applicable parts of Brad's entry a couple times, I can now understand the reasons for Microsoft reversing their advice regarding ApplicationException. I just wonder why the FxCop blog and a couple other blogs were the only ones that said so, and not more high-profile sources like the .NET documentation itself.&lt;br /&gt; &lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=442678" width="1" height="1"&gt;</description></item><item><title>New ASP.NET and IIS webcasts</title><link>http://weblogs.asp.net/pjohnson/archive/2006/03/28/441323.aspx</link><pubDate>Tue, 28 Mar 2006 16:42:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:441323</guid><dc:creator>pjohnson</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/pjohnson/rsscomments.aspx?PostID=441323</wfw:commentRss><comments>http://weblogs.asp.net/pjohnson/archive/2006/03/28/441323.aspx#comments</comments><description>I finally found and started using a decent RSS reader, &lt;a href="http://www.newsgator.com/home.aspx"&gt;NewsGator&lt;/a&gt; (not to be confused with &lt;a href="http://en.wikipedia.org/wiki/Claria_Corporation#Gator"&gt;Gator&lt;/a&gt; spyware). I'm still ironing out how to use it most efficiently, including figuring out which sites with RSS feeds work best in an RSS reader and which are better for me to just visit, and the best way to group feeds, but for now it's a useful way of keeping on top of the ASP.NET news headlines from all the Microsoft employee bloggers, and those elsewhere in the community with interesting stories from the trenches.&lt;br /&gt; &lt;br /&gt; Scott Guthrie recently posted information about &lt;a href="http://www.microsoft.com/windowsserver2003/iis/support/webcasts.mspx"&gt;upcoming ASP.NET and IIS webcasts&lt;/a&gt;, which have &lt;a href="http://www.microsoft.com/communities/rss.aspx?&amp;amp;Title=IIS+Webcasts&amp;amp;RssTitle=IIS+Webcasts&amp;amp;CMTYSvcSource=MSCOMMedia&amp;amp;CMTYRawShape=list&amp;amp;Params=%7eCMTYDataSvcParams%5e%0a++++++%7earg+Name%3d%27startDate%27+Value%3d%27Now-0%27%2f%5e%0a++++++%7earg+Name%3d%27endDate%27+Value%3d%27Now%2b90%27%2f%5e%0a++++++%7earg+Name%3d%27lang%27+Value%3d%27en%27%2f%5e%0a++++++%7earg+Name%3d%27cr%27+Value%3d%27US%27%2f%5e%0a++++++%7earg+Name%3d%27EventType%27+Value%3d%27LiveWebcast%27%2f%5e%0a++++++%7earg+Name%3d%27QueryAttribute%27+Value%3d%27product%27%2f%5e%0a++++++%7earg+Name%3d%27QueryValue%27+Value%3d%2786029bd1-a624-468e-b147-344eadb12d48%27+String%3d%27Internet+Information+Services%27%2f%5e%0a++++%7e%2fCMTYDataSvcParams%5e&amp;amp;NumberOfItems=10"&gt;their own RSS feed&lt;/a&gt; too.&lt;br /&gt; &lt;br /&gt; A few in particular:&lt;br /&gt; &lt;br /&gt; - Microsoft.com Operations Introduces Real World Debugging: Diagnosing Memory Leaks in ASP.NET Applications (Level 300) - This becomes a topic of interest for me every so often.&lt;br /&gt; - Managing IIS 6.0 Servers in an Enterprise Environment: A Handful of Tips and Tricks (Level 200) - I don't have much responsibility for server administration, but still sounded useful.&lt;br /&gt; - Efficient Deployment and Management of ASP.NET 2.0 Applications on IIS 6.0 (Level 300) - Ditto.&lt;br /&gt; &lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=441323" width="1" height="1"&gt;</description></item></channel></rss>