error to enable Enable-Migrations tool
Hello,
Despite changing the version of the NuGet Npgsql (to 4.1.3) I end up always getting an error on the low-level assembly "System.Runtime.CompilerServices.Unsafe" requiring version 4.0.4.1. The class library project that is used has an app.config that contains in part :
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Npgsql" publicKeyToken="5d8b90d52f46fda7" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.3.1" newVersion="4.1.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
The start of the exception shows which assembly is wrong :
Enable-Migrations -ContextTypeName MyProject.MyDBContext
Checking if the context targets an existing database...
System.Data.Entity.Core.ProviderIncompatibleException: An error occurred accessing the database. This usually means that the connection to the database failed. Check that the connection string is correct and that the appropriate DbContext constructor is being used to specify it or find it in the application's config file. See http://go.microsoft.com/fwlink/?LinkId=386386 for information on DbContext and connections. See the inner exception for details of the failure. ---> System.Data.Entity.Core.ProviderIncompatibleException: The provider did not return a ProviderManifestToken string. ---> System.IO.FileLoadException: Impossible de charger le fichier ou l'assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ou une de ses dépendances. La définition trouvée du manifeste de l'assembly ne correspond pas à la référence de l'assembly. (Exception de HRESULT : 0x80131040)
could you give me a solution please, i have tried many community bypasses by modifying the .config but nothing solves the problem, is it a really deep problem?
thanks