Why would this line in an .ascx file:
<%@ Import Namespace="System.Linq" %>
cause an Compile error exception on our production server:
CS0234: The type or namespace name ‘Linq’ does not exist in the
namespace ‘System’ (are you missing an assembly reference?)
It works fine on our development and test environments. We use LINQ extensively throughout the site, although it is the only place where we include it in an .ascx file with an Import-statement. The site is a .NET 3.5 web application.
Check the .Net Framework Version being used by the Application Pool on your server.
It should be 3.5 or above.
Refer this for how to set application pools
Open Internet Information Services (IIS) Manager:
On the taskbar, click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.
On the taskbar, click Start, and then click Control Panel.
In the Connections pane, expand the server name, and then click Application Pools.