<p>I am trying to load Linq on my .Net 3.5 enabled web server by adding the following to my .aspx page:</p>

<pre><code>&lt;%@ Import Namespace="System.Query" %&gt;
</code></pre>

<p>However, this fails and tells me it cannot find the namespace.</p>

<blockquote>
  <p>The type or namespace name 'Query' does not exist in the namespace 'System' </p>
</blockquote>

<p>I have also tried with no luck:</p>

<ul>
<li><code>System.Data.Linq</code></li>
<li><code>System.Linq</code></li>
<li><code>System.Xml.Linq</code></li>
</ul>

<p>I believe that .Net 3.5 is working because <code>var hello = "Hello World"</code> seems to work.</p>

<p>Can anyone help please?</p>

<p>PS: I just want to clarify that I don't use Visual Studio, I simply have a <a href="http://www.ultraedit.com/" rel="nofollow noreferrer">Text Editor</a> and write my code directly into .aspx files.</p>

[{'answer_id': 8657, 'author': 'Keith', 'author_id': 905, 'author_profile': 'https://Stackoverflow.com/users/905', 'pm_score': 0, 'selected': False, 'text': "<p>The <code>var hello</code> stuff is compiler magic and will work without Linq.</p>\n\n<p>Try adding a reference to <code>System.Core</code></p>\n\n<hr>\n\n<p>Sorry, I wasn't clear. I meant add <code>System.Core</code> to the web project's references, not to the page.</p>\n\n<p>The <code>Import</code> on the page are basically just using statements, allowing you to skip the namespace on the page.</p>\n"}, {'answer_id': 8663, 'author': 'Will Dean', 'author_id': 987, 'author_profile': 'https://Stackoverflow.com/users/987', 'pm_score': 1, 'selected': False, 'text': "<p>Make sure your project is set to target 3.5, and not 2.0.</p>\n\n<p>As others have said, your 'var' test is a test of C#3 (i.e. VS2008), not the 3.5 framework.</p>\n\n<p>If you set the project framework target settings properly, you should not expect to need to manually add dll references at this point.</p>\n"}, {'answer_id': 8687, 'author': 'Will Dean', 'author_id': 987, 'author_profile': 'https://Stackoverflow.com/users/987', 'pm_score': 4, 'selected': True, 'text': '<blockquote>\n  <p>I have version 2 selected in IIS and I</p>\n</blockquote>\n\n<p>Well, surely that\'s your problem?  Select 3.5.</p>\n\n<p>Actually, here\'s the real info:</p>\n\n<p><a href="http://www.hanselman.com/blog/HowToSetAnIISApplicationOrAppPoolToUseASPNET35RatherThan20.aspx" rel="noreferrer">http://www.hanselman.com/blog/HowToSetAnIISApplicationOrAppPoolToUseASPNET35RatherThan20.aspx</a></p>\n'}, {'answer_id': 8803, 'author': 'Lasse V. Karlsen', 'author_id': 267, 'author_profile': 'https://Stackoverflow.com/users/267', 'pm_score': 2, 'selected': False, 'text': '<p>What does the  part of your web.config file look like?</p>\n\n<p>Here\'s what it looks like for a brand new ASP.NET 3.5 project made with Visual Studio 2008:</p>\n\n<pre><code>&lt;assemblies&gt;\n  &lt;add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;\n  &lt;add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;\n  &lt;add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;\n  &lt;add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;\n&lt;/assemblies&gt;\n</code></pre>\n'}, {'answer_id': 8806, 'author': 'GateKiller', 'author_id': 383, 'author_profile': 'https://Stackoverflow.com/users/383', 'pm_score': 2, 'selected': False, 'text': '<p>I found the answer :) I needed to add the following to my web.config:</p>\n\n<pre><code>&lt;assemblies&gt;  \n    &lt;add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;  \n    &lt;add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;  \n    &lt;add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;  \n    &lt;add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;  \n    &lt;add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;\n&lt;/assemblies&gt;\n</code></pre>\n\n<p>Then I could add the following to my code:</p>\n\n<pre><code>&lt;%@ Import Namespace="System.Linq" %&gt;\n</code></pre>\n\n<p>@Will,</p>\n\n<p>Thanks for your help. I have accepted one of your answers :)</p>\n'}, {'answer_id': 2807830, 'author': 'aboy021', 'author_id': 198452, 'author_profile': 'https://Stackoverflow.com/users/198452', 'pm_score': 0, 'selected': False, 'text': '<p>The csproj file might be missing the System.Core reference.\nLook for a line in the csproj file like this:</p>\n\n<pre><code>&lt;Reference Include="System" /&gt;\n</code></pre>\n\n<p>And add a line below it like this:</p>\n\n<pre><code>&lt;Reference Include="System.Core" /&gt;\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/8651', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/383/']