2

My project was downgraded from 4.0 to 2.0 version of .NET Framework. But it contains a lot of code that uses LINQ To Objects and LINQ To XML (I use a lot of XElement objects). When I include System.Core.dll and System.Xml.Linq.dll libraries from .NET Framework 3.5 into my project, this adds the necessary functionality and solves the problems.

But there are two questions:

  1. Are there any disadvantages of this solution?
  2. Can I distribute my program on a commercial basis with two included libraries from .NET Framework 3.5? What if I break any license to use and distribute .NET Framework?
paulem
  • 57
  • 1
  • 6
  • .NET license says that .NET framework is a free supplement to a licensed operating system. – Alex Mar 22 '13 at 07:37
  • 1
    " My project was downgraded from 4.0 to 2.0 version of .NET Framework " so you are going back in Time , i never heard of this transition WHY – TalentTuner Mar 22 '13 at 07:38
  • That doesn't sound like it should work. You tried the application on a machine that only has .NET 2.0? (Not 3.5 or 4 installed?) – Mike Zboray Mar 22 '13 at 07:45
  • I was forced to downgrade because the _conditions_ for the acquisition of the project have changed. – paulem Mar 22 '13 at 07:45
  • @mike-z Yes, and it works. NET 2.0 & NET 3.5 has the same CLR Version. – paulem Mar 22 '13 at 07:52
  • @PaulEm sure they have the same CLR version but that doesn't mean those libraries can be simply copied to another machine and everything will work. See http://stackoverflow.com/a/464955/517852 – Mike Zboray Mar 22 '13 at 08:14
  • @PaulEm You don't mention how the conditions changed, so this may or may not be useful, but I would recommend just bundling the (redistributable) .NET Framework 3.5 installer. If that's not an option because .NET Framework 2.0 supports more platforms than 3.5, then there is no guarantee that simply copying the DLLs would work either. –  Mar 22 '13 at 08:21
  • 4
    I'm voting to close this question as off-topic because it should be asked to a lawyer – BradleyDotNET Jun 10 '15 at 23:47

1 Answers1

0

I think the usage of System.Core may mean you run into some trouble (if only from a techy standpoint - IANAL so wouldn't comment on any sort of distribution issues)....

As an example (and I have no concrete evidence, just raising the hypothetical) you have the .NET 3.5 version of System.Core and there's a .NET 2.0 assembly which uses a class within System.Core but it has a wobbly because it's not the System.Core assembly which came with .NET 2.0 and may not behave the same way...or the reverse where something in the 3.5 System.Core expected that another one of the assemblies modified in .NET 3.5 does something a certain way or offers a certain function but the .NET 2.0 version of the assembly does not; it sounds like the kind of situation where you might invest quite a bit of time debugging/troubleshooting/diagnosing/head banging.

That being said it seems people have gotten it to work here and some previous SO questions here and here. There may also be some useful commentary in those links to help you along. Also some more links where people seem to be motivated by the same thing (using LINQ on .NET 2.0) here and here. And also some sort of implementation using assemblies from Mono here

It's one of those things that if you were just going to plop the assemblies in you'd want to (just my opinion) invest a fair amount of time in testing to reduce your risk footprint in terms of unpredictable results cropping up.

As you've noted, there wasn't a separate runtime between 2.0 and 3.5 (unlike from 2.0 -> 4.0) so using that fact could you get the latest 3.5 installed on each of the target machines your app will deploy to (desktops for a WinForms/WPF app or on the server for a web-based thing I guess) and just target 3.5 as your .NET version when developing in Visual Studio? That would make things a little safer I think as then you're actually targeting a Framework version as part of your dev effort rather than just swapping in/out a set of assemblies.

Community
  • 1
  • 1
nkvu
  • 5,551
  • 2
  • 16
  • 12