Tag Archives: C programming

Validation failed for one or more entities. See ‘EntityValidationErrors’ property for more details

If Code First is used, after miragtion is completed using Update Database-verbose, the run finds an exception:

Validation failed for one or more entities. See ‘EntityValidationErrors’ property for more details

This is due to migration changes to the model that result in restrictions on columns in the DB (for example, StringLength(30) causes NVARCHar (Max) to become NVarchar (30))

Want to see the details of the exception, can catch DbEntityValidationException:

try
{
    // Your code...
    // Could also be before try if you know the exception occurs in SaveChanges

    context.SaveChanges();
}
catch (DbEntityValidationException e)
{
    foreach (var eve in e.EntityValidationErrors)
    {
    }
}

GCC forces all symbols in the link library

GCC forces all symbols in the link library

wants to abstract SDK related functions out of a library for app to call.
thus the app-related code is compiled and linked to the library to generate the final elf executable.

method:

Add -wl,–whole-archive,

  • , add their own library to the mandatory link
  • ,–no whole-archive restore
  • :
    – Wl, — the whole – archive xx. A Wl, – no – whole – archive