Editor 1.6.1 on .NET 4.0 framework incompatibility?

Editor 1.6.1 on .NET 4.0 framework incompatibility?

ghostgrahamghostgraham Posts: 2Questions: 1Answers: 0

Hi,

after following the set-up instructions for Editor on .NET and adding the service reference to Datatables.dll and the 'using' directive in my C# project (in Visual Studio 2010), intellisense recognises the fact that the library is available. However on building the solution, it gives the error "The type or namespace name 'DataTables' could not be found". The reference is definitely present and available, after much searching the suggestion was that the .NET versions of the project/reference may not be compatible.

On removing the code and using directive (but leaving the service reference in place) and re-building, the following warning comes out:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3274: The primary reference "DataTables, Version=1.6.1.0, Culture=neutral, processorArchitecture=MSIL" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".

I'm not sure where the problem is here, as the Datatables.dll properties says:

Runtime version: v4.0.30319

which is the same as the current project framework. Anyone else had this issue on initial set up? Any help appreciated.

Thanks, GB

Answers

  • allanallan Posts: 63,274Questions: 1Answers: 10,424 Site admin

    Hi,

    Editor's DataTables.dll is indeed built against .NET Framework 4.5, which is probably the root cause of the issue here. You could download the .NET package and recompile it with a .NET 4.0 target (although if you are using VS2010 you'll need to install the C# 6 compiler).

    I'm away from my PC at the moment I'm afraid, but I can take a look and rebuilt it for a 4.0 target when I get back if you like?

    Allan

  • ghostgrahamghostgraham Posts: 2Questions: 1Answers: 0

    Hi Allan,

    thanks for the quick reply and the offer to re-build but I think I tried that as one of many attempts after posting this query and didn't manage to get it to work. I don't want to take up your time doing that so no worries, it was more to see if this was a common scenario and I was being dumb though I'd obviously scoured the forums first.

    On further research I found the following in case it helps anyone else:

    "Apparently if you have only .NET Frameworks 4.0 installed, you can add as a reference a .NET assembly that targets 4.5, to a project that targets .NET 4.0. This will compile and run with no errors. As soon as you install .NET Frameworks 4.5, compile will fail. The solution is to target your project for .NET Framework 4.5 or get a version of the referenced assembly that targets .NET 4.0."

    I've got .NET 4.5 and 4.0 (and older) installed. So this issue of having 4.0 and 4.5 on the development machine and attempting to target the 4.5 assembly to version 4.0 is the issue. This combined with VS 2010 not letting you target a project higher than 4.0 means I can't win either way with the current set-up.

    I reckon my options are to remove .NET 4.5 from the development box or upgrade to a later VS (... and therefore upgrade all other packages to 4.5 versions.)

    I'll get there one way or another. By the way, thanks so much for an awesome product. Been using DataTables for quite a while now and it's been so great, just bought Editor to save messing about with the multiple other plugins I've accumulated as I think the capabilities look amazing, cheers.

  • allanallan Posts: 63,274Questions: 1Answers: 10,424 Site admin

    Urgh - I didn't realise it was quick so messy as that with multi-targeting!

    Delighted to hear you are enjoying using DataTables and Editor so far!

    Let me know how you get on with it if you would. And the offer to rebuild the library stands!

    Regards,
    Allan

This discussion has been closed.