To create a new ASP.NET Web Site that can use
LINQ/DLINQ/XLINQ and the new C# 3.0 language features, choose File->New Web
Site in VS and select the “LINQ ASP.NET Web Site Template”:
Figure 1
<img border=0 width=662 height=437src="/ArticleFiles/922/image001.jpg">
This will create a web-site project with the following files
in-it by default:
Figure 2
<img border=0 width=246 height=260src="/ArticleFiles/922/image002.jpg">
Note that it includes a number of LINQ assemblies in the
\bin folder. It also adds the following setting to the app’s web.config file
which tells both VS and ASP.NET to use the C# 3.0 compiler to compile and run
the app:
Listing 1
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp"
extension=".cs" type="Microsoft.CSharp.CSharp3CodeProvider,CSharp3CodeDomProvider"/>
</compilers>
</system.codedom>
Note that the C# 3.0 compiler and CodeDOM provider can run
side-by-side with the C# 2.0 versions (so you don’t have to worry about it breaking
VS or ASP.NET when you install it).