Error in ASP.NET MVC 4 with Visual Web Developer 2010 Express and .NET Framework 4.0

Error in ASP.NET MVC 4 with Visual Web Developer 2010 Express and .NET Framework 4.0

jgletejglete Posts: 3Questions: 1Answers: 0

I have the following scenario:

  • Visual Web Developer 2010 Express Service Pack 1
  • .NET Framework 4.0
  • ASP.NET MVC 4
  • An SQL Server Express .mdf in AppData, with the "staff" fields
  • The example of ASP.NET MVC in controller and the example "staff" model
  • Settings configured to the AppData database

The problem comes when I try to access to /staff/table and gives me the following JSON:

{"draw":null,"data":[],"recordsTotal":null,"recordsFiltered":null,"error":"GenericArguments[0], \u0027DataTables.PostGetEventArgs\u0027, en \u0027System.EventHandler`1[TEventArgs]\u0027 infringe la restricción del parámetro de tipo \u0027TEventArgs\u0027.","fieldErrors":[],"id":null,"meta":{},"options":{},"files":{},"upload":{"id":null},"debugSql":null,"cancelled":[]}

Answers

  • allanallan Posts: 63,866Questions: 1Answers: 10,520 Site admin

    Have you recompiled the DataTables.dll for .NET 4.0? The default distribution targets 4.5. Also because C# 6 features are used in the dll you'd need to install the C# 6 compiler (VS 2010 doesn't ship with it).

    That's what immediately stands out to me from the above.

    I assume that you've not modified the demo files at all and have installed the SQL database?

    Thanks,
    Allan

  • jgletejglete Posts: 3Questions: 1Answers: 0

    Hello Allan.

    I thought that the dll was compiled for .NET Framework 4.0 because of the compatibility with it.

    2: The .NET libraries support .NET Framework 4.0 and newer. .NET Core is not yet supported. C# 6.0 is the language used should you wish to compile the library dll.

    I have tried to compile the dll with the Visual Studio 2015 Community Edition.

    I have changed the .NET Target Framework to 4.0.

    I get the following error:

    CS0311 The type 'DataTables.PostGetEventArgs' cannot be used as type parameter 'TEventArgs' in the generic type or method 'EventHandler<TEventArgs>'. There is no implicit reference conversion from 'DataTables.PostGetEventArgs' to 'System.EventArgs'.

    I need to use the .NET Framework version 4.0 because the server where the application will run is a Windows 2003 Server.

    I have fixed that error at your source code making PostEventArgs extend EventArgs (like the other EventArgs that you have in your source code).

    I suppose that was a mistake.

    But it's strange that with .NET 4.5 compiles without an error with that class missing the inheritance, but with .NET 4.0 not.

    It seems that if the library had that inheritance would work directly without recompiling.

    Thank you Allan.

    P.D: I also crave for the library for .NET Core. :#

    P.D. 2: at the generator the button Model doesn't work

    P.D. 3: the generator project seems to fail if you don't have IIS installed. (Some sections of the project XML aren't recognized by the parser).

    P.D. 4: what about a Java versión of the Editor? :#

  • allanallan Posts: 63,866Questions: 1Answers: 10,520 Site admin

    Thanks! I'll get that fixed for the next release!

    P.D: I also crave for the library for .NET Core.

    Me too! As soon as DbProvider is available in .NET Core, I'll have Editor working with it.

    P.D. 2: at the generator the button Model doesn't work

    Thanks. I'll fix that as well!

    P.D. 3: the generator project seems to fail if you don't have IIS installed. (Some sections of the project XML aren't recognized by the parser).

    Interesting. I'll check out what is going on there.

    P.D. 4: what about a Java versión of the Editor? :#

    Not currently planned. There is JED which are server-side libraries for Editor in a Java environment, but they aren't supported by myself.

    Regards,
    Allan

This discussion has been closed.