<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Peter Johnson's Blog</title><subtitle type="html">ASP.NET and other technologies</subtitle><id>http://weblogs.asp.net/pjohnson/atom.aspx</id><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pjohnson/default.aspx" /><link rel="self" type="application/atom+xml" href="http://weblogs.asp.net/pjohnson/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20510.895">Community Server</generator><updated>2006-04-26T15:26:00Z</updated><entry><title> VS 2008 and .NET 3.5 Beta 2 released, with Go Live</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pjohnson/archive/2007/07/26/vs-2008-and-net-3-5-beta-2-released-with-go-live.aspx" /><id>http://weblogs.asp.net/pjohnson/archive/2007/07/26/vs-2008-and-net-3-5-beta-2-released-with-go-live.aspx</id><published>2007-07-26T21:18:00Z</published><updated>2007-07-26T21:18:00Z</updated><content type="html">&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;</content><author><name>pjohnson</name><uri>http://weblogs.asp.net/members/pjohnson.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/pjohnson/archive/tags/ASP.NET/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/pjohnson/archive/tags/.NET/default.aspx" /></entry><entry><title>Microsoft Sandcastle</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pjohnson/archive/2007/07/03/microsoft-sandcastle.aspx" /><id>http://weblogs.asp.net/pjohnson/archive/2007/07/03/microsoft-sandcastle.aspx</id><published>2007-07-03T16:27:00Z</published><updated>2007-07-03T16:27:00Z</updated><content type="html">&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;</content><author><name>pjohnson</name><uri>http://weblogs.asp.net/members/pjohnson.aspx</uri></author><category term="General Software Development" scheme="http://weblogs.asp.net/pjohnson/archive/tags/General+Software+Development/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/pjohnson/archive/tags/.NET/default.aspx" /><category term="C#" scheme="http://weblogs.asp.net/pjohnson/archive/tags/C_2300_/default.aspx" /><category term="Sandcastle" scheme="http://weblogs.asp.net/pjohnson/archive/tags/Sandcastle/default.aspx" /></entry><entry><title>HTTP modules - subdirectories and private variables</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pjohnson/archive/2007/03/02/http-modules-subdirectories-and-private-variables.aspx" /><id>http://weblogs.asp.net/pjohnson/archive/2007/03/02/http-modules-subdirectories-and-private-variables.aspx</id><published>2007-03-02T21:29:00Z</published><updated>2007-03-02T21:29:00Z</updated><content type="html">&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;</content><author><name>pjohnson</name><uri>http://weblogs.asp.net/members/pjohnson.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/pjohnson/archive/tags/ASP.NET/default.aspx" /></entry><entry><title>ASPInsiders Summit 2006 - C# 3.0 and LINQ</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pjohnson/archive/2007/01/16/aspinsiders-summit-2006-c-3-0-and-linq.aspx" /><id>http://weblogs.asp.net/pjohnson/archive/2007/01/16/aspinsiders-summit-2006-c-3-0-and-linq.aspx</id><published>2007-01-16T21:19:00Z</published><updated>2007-01-16T21:19:00Z</updated><content type="html">&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;</content><author><name>pjohnson</name><uri>http://weblogs.asp.net/members/pjohnson.aspx</uri></author><category term=".NET" scheme="http://weblogs.asp.net/pjohnson/archive/tags/.NET/default.aspx" /><category term="ASPInsiders2006" scheme="http://weblogs.asp.net/pjohnson/archive/tags/ASPInsiders2006/default.aspx" /><category term="Events" scheme="http://weblogs.asp.net/pjohnson/archive/tags/Events/default.aspx" /><category term="ASPInsiders" scheme="http://weblogs.asp.net/pjohnson/archive/tags/ASPInsiders/default.aspx" /><category term="C#" scheme="http://weblogs.asp.net/pjohnson/archive/tags/C_2300_/default.aspx" /><category term="LINQ" scheme="http://weblogs.asp.net/pjohnson/archive/tags/LINQ/default.aspx" /></entry><entry><title>ASPInsiders Summit 2006 - IIS 7</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pjohnson/archive/2006/12/29/aspinsiders-summit-2006-iis-7.aspx" /><id>http://weblogs.asp.net/pjohnson/archive/2006/12/29/aspinsiders-summit-2006-iis-7.aspx</id><published>2006-12-29T18:15:00Z</published><updated>2006-12-29T18:15:00Z</updated><content type="html">&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;</content><author><name>pjohnson</name><uri>http://weblogs.asp.net/members/pjohnson.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/pjohnson/archive/tags/ASP.NET/default.aspx" /><category term="ASPInsiders2006" scheme="http://weblogs.asp.net/pjohnson/archive/tags/ASPInsiders2006/default.aspx" /><category term="Events" scheme="http://weblogs.asp.net/pjohnson/archive/tags/Events/default.aspx" /><category term="ASPInsiders" scheme="http://weblogs.asp.net/pjohnson/archive/tags/ASPInsiders/default.aspx" /><category term="IIS" scheme="http://weblogs.asp.net/pjohnson/archive/tags/IIS/default.aspx" /><category term="Vista" scheme="http://weblogs.asp.net/pjohnson/archive/tags/Vista/default.aspx" /></entry><entry><title>Windows service setup projects - Unable to build custom action error</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pjohnson/archive/2006/08/14/Windows-service-setup-projects-_2D00_-Unable-to-build-custom-action-error.aspx" /><id>http://weblogs.asp.net/pjohnson/archive/2006/08/14/Windows-service-setup-projects-_2D00_-Unable-to-build-custom-action-error.aspx</id><published>2006-08-14T18:22:00Z</published><updated>2006-08-14T18:22:00Z</updated><content type="html">
&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;</content><author><name>pjohnson</name><uri>http://weblogs.asp.net/members/pjohnson.aspx</uri></author><category term="General Software Development" scheme="http://weblogs.asp.net/pjohnson/archive/tags/General+Software+Development/default.aspx" /><category term="Visual Studio" scheme="http://weblogs.asp.net/pjohnson/archive/tags/Visual+Studio/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/pjohnson/archive/tags/.NET/default.aspx" /><category term="Windows Services" scheme="http://weblogs.asp.net/pjohnson/archive/tags/Windows+Services/default.aspx" /></entry><entry><title>Ambiguous match found</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pjohnson/archive/2006/08/11/Ambiguous-match-found.aspx" /><id>http://weblogs.asp.net/pjohnson/archive/2006/08/11/Ambiguous-match-found.aspx</id><published>2006-08-11T17:31:00Z</published><updated>2006-08-11T17:31:00Z</updated><content type="html">&lt;p&gt;Looks like I&amp;#39;ve been away a few months. Sorry &amp;#39;bout that. I&amp;#39;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 href="http://aspalliance.com/author.aspx?uId=1026" title="ASP Alliance: Peter Johnson"&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 href="http://webproject.scottgu.com/CSharp/Migration/Migration.aspx" title="Migrating a VS 2003 Web Project to VS 2005"&gt;Scott Guthrie&amp;#39;s well-written instructions&lt;/a&gt;
and the Web Application Projects add-in. Going through VS2005&amp;#39;s
automatic conversion and building it was pretty painless when I
followed Scott&amp;#39;s instructions; one wrinkle I ran into is that it forgot
about the three web projects, so I had to add those manually using &amp;quot;Add
Existing Project&amp;quot; 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&amp;#39;t do the &amp;quot;Convert to Web Application&amp;quot; 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&amp;#39;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=&amp;quot;c#&amp;quot; Inherits=&amp;quot;MyApp.Namespace.MyCoolControl&amp;quot; CodeBehind=&amp;quot;&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&amp;quot; AutoEventWireup=&amp;quot;false&amp;quot; %&amp;gt;&lt;br /&gt;
Line 2:&amp;nbsp; &amp;lt;%@ Import Namespace=&amp;quot;&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;quot; %&amp;gt;&lt;br /&gt;
Line 3:&amp;nbsp; &amp;lt;div class=&amp;quot;openingParagraph&amp;quot;&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 href="http://www.aisto.com/roeder/dotnet/" title="Lutz Roeder&amp;#39;s .NET Reflector"&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&amp;#39;t
be getting, a process many of you are probably too familiar with if
you&amp;#39;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&amp;#39;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&amp;#39;t help me. Other
Google search results were similarly unhelpful, until I found &lt;a href="http://dotnetdebug.blogspot.com/"&gt;the blog of a guy named Eran Sandler&lt;/a&gt; who talked about &lt;a href="http://dotnetdebug.blogspot.com/2006/03/ambiguous-match-found-in-web-control.html" title="Advanced .NET Debugging: &amp;quot;Ambiguous match found&amp;quot; in a Web Control - a Possible Bug"&gt;his &amp;quot;Ambiguous match found&amp;quot; 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&amp;#39;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;</content><author><name>pjohnson</name><uri>http://weblogs.asp.net/members/pjohnson.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/pjohnson/archive/tags/ASP.NET/default.aspx" /><category term="Visual Studio" scheme="http://weblogs.asp.net/pjohnson/archive/tags/Visual+Studio/default.aspx" /></entry><entry><title>Convert.ChangeType wrapper that handles nullable types</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pjohnson/archive/2006/05/19/447154.aspx" /><id>http://weblogs.asp.net/pjohnson/archive/2006/05/19/447154.aspx</id><published>2006-05-19T17:06:00Z</published><updated>2006-05-19T17:06:00Z</updated><content type="html">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;</content><author><name>pjohnson</name><uri>http://weblogs.asp.net/members/pjohnson.aspx</uri></author></entry><entry><title>Web Application Projects for Visual Studio 2005 released</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pjohnson/archive/2006/05/09/445847.aspx" /><id>http://weblogs.asp.net/pjohnson/archive/2006/05/09/445847.aspx</id><published>2006-05-09T15:09:00Z</published><updated>2006-05-09T15:09:00Z</updated><content type="html">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;</content><author><name>pjohnson</name><uri>http://weblogs.asp.net/members/pjohnson.aspx</uri></author></entry><entry><title>Do you need to turn off your PC at night?</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pjohnson/archive/2006/04/26/Do-you-need-to-turn-off-your-PC-at-night_3F00_.aspx" /><id>http://weblogs.asp.net/pjohnson/archive/2006/04/26/Do-you-need-to-turn-off-your-PC-at-night_3F00_.aspx</id><published>2006-04-26T19:26:00Z</published><updated>2006-04-26T19:26:00Z</updated><content type="html">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;</content><author><name>pjohnson</name><uri>http://weblogs.asp.net/members/pjohnson.aspx</uri></author><category term="General Software Development" scheme="http://weblogs.asp.net/pjohnson/archive/tags/General+Software+Development/default.aspx" /></entry></feed>