Where are components (dll) references stored in ASP.NET? - asp.net

I have dlls in bin directory. I can't see where they are referenced in either solution or web.config files. So where are the references stored ?

The answer depends on if your project is a Web Site or a Web Application. In a Web Site all the assemblies in the bin directory are automatically referenced. A Web Application has the project references that you are looking for.

When working on a previously developed ASP.NET "WebSite" project in VS2012, I figured out how to find them (and thus add/remove/update them).
Over in the Solution Explorer, right-click the name of the project (the project will have the wire-frame globe icon next to it)
Click "Property Pages" (NOT Properties Window). It will appear in its own separate (floating) window frame.
Now just left-click the item "References" at the top of the list to the left. That's it! You can now add, delete, and update any reference(s) associated with your WebSite project.

If web app project or MVC, right-click and select unload project. Then right click again and select edit . If you dig through the XML, you will find the collection of project references and other DLL references to MS or other assemblies.

If you actually have them referenced, they should be "stored" in the project files (*.csproj for C#, *.vbproj for Visual Basic).

In the case of an ASP.NET web site, the references are stored in the web.config file.
I've removed most of the assemly references, but one of my old web sites has things like this:
<compilation debug="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
</assemblies>
</compilation>

Related

Visual Studio 2022 - could not load file or assembly Microsoft.Build.Tasks.v4.0. The system cannot find the file specified

So I'm back from a nice Christmas break - and completely stymied. When I try to build my Visual Studio 2022 solution I get this message:
Build (web): Could not load file or assembly 'Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
I also get this in VS 2019 too. My website is ASP.NET webforms - I've got two other MVC websites which build and run perfectly. Here is the relevant section of my web.config file:
<compilation debug="true" strict="true" explicit="true" batch="false" targetFramework="4.7.2">
<assemblies>
<add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Printing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
</assemblies>
I've just spent 3 hours reading through blogs like this StackOverflow one:
Could not load file or assembly 'Microsoft.Build.Framework'(VS 2017)
I've tried restarting Visual Studio, and even turning my computer off and on again. I've commented out the assembly lines in the web.config file shown above. I went into Nuget package manager and added Microsoft.Build.Framework to see if this would help (it didn't).
Here's what the project references look like:
I've had this sort of problem on numerous other occasions, and usually sorted it fairly quickly - but not this time. I know little about building projects - I just want Visual Studio to do it all for me!
Can any kind person help please?
So I've at least got this in a working state - here's an update for anyone else facing this nightmare (and who, like me, doesn't fully understand what building involves).
I still have the build error, but if I right-click on a .aspx file to view it in a browser this now works (before it gave a compilation error). To reach this state I removed any references to any Microsoft.Build libraries that I had set in Nuget. I don't know whether this helped or not!
Of course I can't debug (because this requires a build), so this is at best a temporary fix, but at least I can do some work on the website.
Someone also mentioned this page, which gives a good summary of the opacity of the build process:
How do references work in ASP.NET WebForms websites (not web applications)?

Could not load file or assembly 'CrystalDecisions.ReportAppServer.CommLayer, Version=13.0.2000.0

I have developed a simple project. where i have to print some crystal report. the project runs very well in local machine, but when i up this on a web hosting server, it shows me an error when crystal report viewing.
Could not load file or assembly 'CrystalDecisions.ReportAppServer.CommLayer, Version=13.0.2000.0,
Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its
dependencies. The system cannot find the file specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: Could not load
file or assembly 'CrystalDecisions.ReportAppServer.CommLayer,
Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304'
or one of its dependencies. The system cannot find the file specified.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to
determine why the assembly
'CrystalDecisions.ReportAppServer.CommLayer, Version=13.0.2000.0,
Culture=neutral, PublicKeyToken=692fbea5521e1304' could not be loaded.
WRN: Assembly binding logging is turned OFF. To enable assembly bind
failure logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There
is some performance penalty associated with assembly bind failure
logging. To turn this feature off, remove the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog].
Please any one can help me .....
I had the same error after moving to a new laptop (Windows 10). In addition to setting Copy Local to true as mentioned above, I had to install the Crystal Reports 32-bit runtime engine for .Net Framework, even though everything else is set to run in a 64-bit environment. Hope that helps.
As I said in comment your crystaldecisions.reportappserver.commlayer.dll is not copied / present on your server. So for this you have to manually copy the dll and paste into you Bin folder
To copy a DLL from visual studio project follow the steps
1.Expand your Project's References hierarchy (Project should not be in debug mod)
2.Right Click on Particular Dll (in your case crystaldecisions.reportappserver.commlayer.dll) and select Properties and set 'Copy Local' attribute to TRUE
3 Build your project. The Dll should be there in your BIN Folder.
I faced the same issue and used the following steps to solve it
1) go Right side in solution explorer
2) Click on your Project Name
3) click on Reference
4) you can see yellow symbol on some DLL
5) Right click on that DLL and go to Property
6) Find Specific Version = True replace it with Specific Version = False
and also change Copy Local = False to Copy Local = True
CR has changed the Version No of Assemblies. The Old Version is 13.0.2000.0 (this is a incompatible version problem). The New Version is 13.0.3500.0 or 13.0.4000.0 - this is for my test case of Visual Studio 2019 and .net 4.7.2 and Window Server 2019. You need to open all your projects, Remove the old dll reference and add the new references. Then build the application again.
I learnt from source:
Best Answer: https://answers.sap.com/questions/303438/could-not-load-file-or-assembly-%27crystaldecisionsr.html
Installation Notes
Crystal Reports for Visual Studio 2017:
https://www.tektutorialshub.com/crystal-reports/crystal-reports-download-for-visual-studio/#Service-Pack-16
TO remove: Right click on an assembly under references to remove it.
This is where the error comes from - it is exactly what the error message outputs:
error message:
Could not load file or assembly ... The located assembly's manifest
definition does not match the assembly reference ...
location error message referring to:
"C:\Visual-Studio-2019-Proj\Proj Windows Inventory\Proj Windows
Inventory\obj\x86\Debug\Press HDL Windows Inventory.exe.manifest"
And it looks like this:
-The older version of .net 3.5 and CReports version="13.0.2000.0" and VS2012:
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="CrystalDecisions.CrystalReports.Engine.dll" size="372736">
<assemblyIdentity name="CrystalDecisions.CrystalReports.Engine" version="13.0.2000.0" publicKeyToken="692FBEA5521E1304" language="neutral" processorArchitecture="msil" />
-The newer version of .net 4.7.2 and CReport version="13.0.4000.0" and VS2019:
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="CrystalDecisions.CrystalReports.Engine.dll" size="373248">
<assemblyIdentity name="CrystalDecisions.CrystalReports.Engine" version="13.0.4000.0" publicKeyToken="692FBEA5521E1304" language="neutral" processorArchitecture="msil" />
Edit Web Config for each CrystalDecisions file version make it same version of the .dll file (Right-click on it and select properties within solution explorer)
For example.
crystaldecisions.reportappserver.commlayer.dll --> 13.0.2000.0
after upgrade crystal report to CRforVS_13_0_21 edit it to ---> 13.0.3500.0
Somehow I had the wrong versions of the DLLs registered in my project.
I removed the three references to the Crystal Report dlls from my project.
I right click References, and click Add Reference
In the popup window, I click the Browse menu on the left and the Browse button
In the Directory window where your DLLs reside (perhaps your application's bin directory), select the three Crystal Reports DLLs and then click Add.
Back at the Reference Manager window, click in the first column to the left of the three Crystal dlls, and then click OK
At this point your Crystal Reports should work again.
I faced the same issue when move to new laptop and used the following steps to solve it
Close the project
Install SAP Crystal Reports 13.0 runtime (32-bit) enter image description here
Delete the project .suo file
Open the Project and first built the project
Now after running the project issue is resolved.
In the first plate you have to check that:
1) You install a appropriate version of Crystal Reports SDK =>
http://downloads.i-theses.com/index.php?option=com_downloads&task=downloads&groupid=9&id=101 (for example)
2) Add reference to dll =>
crystaldecisions.reportappserver.commlayer.dll
For me it was "Prefer 32bit": clearing the checkbox allowed CLR to load Crystal Reports 64bit runtime (the only one installed).
If you already have the DLL copied to your project and the Copy Local flag is in true, the solution should be just rebuild the project. That will copy the DLL to the bin folder.
For visual studio 2019
change the code in aspx.cs page
<%# Register Assembly="CrystalDecisions.Web, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
in web config:
<configSections>
<sectionGroup name="businessObjects">
<sectionGroup name="crystalReports">
<section name="rptBuildProvider" type="CrystalDecisions.Shared.RptBuildProviderHandler, CrystalDecisions.Shared, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, Custom=null"/>
</sectionGroup>
</sectionGroup>
</configSections>
<assemblies>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.ReportSource, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.Shared, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.Web, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
<add assembly="Microsoft.ReportViewer.Common, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
<add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.ReportSource, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.Shared, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.Web, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
</assemblies>
<buildProviders>
<add extension=".rpt" type="CrystalDecisions.Web.Compilation.RptBuildProvider, CrystalDecisions.Web, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
</buildProviders>
If you have the to your project and the Copy Local flag is in true, the solution should be just the project. That copy the DLL to the bin folder.

Crystal Reports "Load Report Failed" error running report on the server

I am getting error "load report failed" on server, it runs without error on localhost. I am using VS 2008 with .Net 3.5.
This is my code:
ReportDocument reportDocument = new ReportDocument();
String filePath = #"C:\abcSpaces\abc.com\xyz.com\wwwroot\Order Fulfilment.rpt";//full path
// I have tried OrderFullfilment.rpt and ~/OrderFullfilment.rpt and /OrderFullfilment.rpt
try
{
reportDocument.Load(filePath);
CrystalReportViewer1.ReportSource = reportDocument;
}
catch(Exception ex){
Label1.Text = ex.Message;
}
Aspx Page part:
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" Height="1291px"
ReuseParameterValuesOnRefresh="True" Width="1125px" />
^I have tried using
<CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
<Report FileName="expenseRep_summary.rpt">
</Report>
</CR:CrystalReportSource>
with no luck off course...
my web.config section for referencing assemblies:
<compilation debug="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="MySql.Data, Version=6.2.4.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>
<add assembly="MySql.Data.Entity, Version=6.2.4.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>
<add assembly="MySql.Web, Version=6.2.4.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>
<add assembly="CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.Shared, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.ReportSource, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.CrystalReports.Engine, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/><add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Enterprise.Framework, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Enterprise.InfoStore, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.Data.AdoDotNetInterop, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.VSDesigner, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/></assemblies>
</compilation>
I have tried all of these solutions posted in stackoverflow:
CrystalReport Load report failed (no I can't change registry or re-install crystal reports, my site is hosted on external server)
load report failed (where the hell is objReport??)
I got the problem in Crystal Report- Error Messsage:Load report failed (I have no object reffering to Report class :S)
Load report failed when implementing crystal report in asp.net 3.5 (I tried this '~' technique + Absolute path and none works)
Load report failed in Windows server 2003 (I have set read write execute permissions to every file)
https://stackoverflow.com/questions/3337185/crystal-report-giving-load-failed-error (this guy like me, hasn't found the solution yet :P )
So please please please help me! Or my client will eat me alive...
I know this is an old post. but For anyone still looking for the answer:
You need to register crystal reports in page markup
<% # Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
Set the property 'Copy to Output Directory' of the report to 'Copy always'
the path of the file in the crystalreportsource will be ~/bin/YOURFOLDER/YOURFILE
<CR: CrystalReportSource ID ="CrystalReportSource1" runat ="server">
<Report FileName="~/bin/oilmovement/rptOMDayEnd.rpt">
</Report>
</CR: CrystalReportSource>
Now the report should work
select your application pool for your apllication or website
Click on Recycling (Right side panel)
Reduce the value of Regular time interval 1740 to 20 min or set your desire value you want
this will release any resource hold by iis.
restart iis.
hope this will fix your problem
http://littleprograming.blogspot.com/2013/02/crystal-report-error-load-report-failed.html
I have the same issue before and it seems you need to install the CR runtime on the server. Having just the DLL is not enough. Hope it helps.
I know that this is an old question, but today I had similar problem.
Reports were working locally but when deployed to server (IIS) I had the same error.
Try to add write/read permissions to %TEMP% for IIS User (process that creates reports).
Reports are generated in Temp and from there viewer is getting content that is displayed on site.
I also had that problem and after exhausting all other options changed the Application Pool setting Load User Profile from False to True, which resolved the problem.
This was on an application which has been deployed to dozens of IIS6, IIS7, IIS7.5 servers and we've never encountered the problem before. The App Pool was running with the identity Network Service (which it usually is) and I first tried giving permission to C:\windows\temp which did not work (although I didn't check if that really was the temp directory).
I suspect another solution may have been to add Network Service to the IIS_IUSRS group, but I didn't try that and didn't really want to do so in case it affected other apps on the server.
On of the most common reason can be, Crystal Report (*.rpt) files are not physically present in the target location, which might have left-out during build and publishing application
Solution:
Open Visual Studio, select all the CrystalReport.rpt files, right click to set Properties"
Build Action: Content (can also be Embedded Resource)
CopyToOutputDirectory: Always (can also be Copy if Newer)

VS2008 targeting ASP.net 2.0: Project-level imports warning

I have a web app built against asp.net 2.0, but keep getting the following warning:
Namespace or type specified in the project-level Imports 'System.Xml.Linq' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
I cannot find anywhere that actually Linq is actually referenced. I've even opened up the .vbproj in a text editor, and it's not hidden in there either.
Any ideas where this is set?
Open your web.config and remove the reference to Linq in there. You should need to delete these lines from under the "assemblies" section:
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
Have you checked in your web.config file?
You also get this error if you have an older version of .Net Framework.
Go To Project->Properties->Advanced Compile Options->Target framework(all configurations)
If it is set to .NET Framework 2.0, try changing it to 3.5.
That fixed it for me.

Import Namespace System.Query

I am trying to load Linq on my .Net 3.5 enabled web server by adding the following to my .aspx page:
<%# Import Namespace="System.Query" %>
However, this fails and tells me it cannot find the namespace.
The type or namespace name 'Query' does not exist in the namespace 'System'
I have also tried with no luck:
System.Data.Linq
System.Linq
System.Xml.Linq
I believe that .Net 3.5 is working because var hello = "Hello World" seems to work.
Can anyone help please?
PS: I just want to clarify that I don't use Visual Studio, I simply have a Text Editor and write my code directly into .aspx files.
I have version 2 selected in IIS and I
Well, surely that's your problem? Select 3.5.
Actually, here's the real info:
http://www.hanselman.com/blog/HowToSetAnIISApplicationOrAppPoolToUseASPNET35RatherThan20.aspx
What does the part of your web.config file look like?
Here's what it looks like for a brand new ASP.NET 3.5 project made with Visual Studio 2008:
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
I found the answer :) I needed to add the following to my web.config:
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
Then I could add the following to my code:
<%# Import Namespace="System.Linq" %>
#Will,
Thanks for your help. I have accepted one of your answers :)
Make sure your project is set to target 3.5, and not 2.0.
As others have said, your 'var' test is a test of C#3 (i.e. VS2008), not the 3.5 framework.
If you set the project framework target settings properly, you should not expect to need to manually add dll references at this point.
The var hello stuff is compiler magic and will work without Linq.
Try adding a reference to System.Core
Sorry, I wasn't clear. I meant add System.Core to the web project's references, not to the page.
The Import on the page are basically just using statements, allowing you to skip the namespace on the page.
The csproj file might be missing the System.Core reference.
Look for a line in the csproj file like this:
<Reference Include="System" />
And add a line below it like this:
<Reference Include="System.Core" />

Resources