tags:

views:

362

answers:

4

I have an ASP.NET 2.0 web site. I am building new functionality that is based on some features from .NET 3.5 (specifically Linq to Sql).

Provided I have .NET 3.5 installed on web server (but keep my IIS Application as .NET 2.0) will I have any "issues" calling into the 3.5 assembly? Can anyone explain what happens under the covers when this is done?

+1  A: 

duplicate? basically, you should be able to do what you are asking...

http://stackoverflow.com/questions/135269/can-i-run-asp-net-2-0-and-3-5-code-on-the-same-website

Nick Franceschina
A: 

It should be ok as long as the .NET 3.5 runtime is installed. However, it is just as easy to target your 2.0 application to target 3.5 instead.

James
A: 

If your 3.5 specific functionality is being served up externally from something like WCF or returning results via SOAP or JSON or something similar, I don't see anything keeping you from consuming that from a ASP.NET 2.0 site. However, if the functionality is just a dll that you're trying to reference, I know I've tried that in the past and VS won't let me do that unless I increase the framework target to 3.5 on my site. This shouldn't be a problem though, since the 3.5 framework is completely supplemental to the 2.0 framework, but if you're trying to keep 3.5 assemblies out of your 2.0 website, you're going to run into problems.

Joseph
+2  A: 

There should be NO Issues since you have .net 3.5 installed

.Net 3.5 is essentially CLR 2.0 with additional dll's/assemblies from Framework 3.0 and 3.5 added on, when you write code in using 3.5, the compiler compiles to CLR 2.0

So your code in .net 2.0 can call code in .net 3.5 ( assuming all referenced assemblies are available ) as they both use the same IL instruction set, so MSIL'cally speaking ( just making this up ) there's no difference !

an example would be the MS chart controls which are Framework 3.5 but work on .net 2.0 without issues, of course with the System.DAta.Datavisualization.dll available to the app

Kumar
This all makes sense, however, I cannot confirm/deny it. This comes closest to actually providing an answer to my question (which was to explain what is going on). Thanks for the help!
Brian