Page 1 of 1

Method not found exception after calling EnsureCreated() in EFCore

Posted: Tue 02 Jan 2018 11:09
by StefanWoe
Hi,

I have a problem using dotnet connect for Oracle. I've created a small console test project in VS2015 using the .NETCore template and the devart EFCore connector.
I always got an System.MissingMethodException, after the build was finished and the application started. The related error message is "Method not found: 'Devart.Common.DbCommandBase Devart.Common.DbCommandBase.InternalClone()'". The exception is fired after context.Database.EnsureCreated() is called.

I am using net462 as framework in project.json and "Devart.Data.Oracle.EFCore" in version "9.5.399".

If I switch to netstandard1.6 as main framework in project.json, the test project will be working properly. But I have to use net461 and EFCore.

Project.json:

Code: Select all

  "version": "1.0.0-*",
  "buildOptions": {
    "emitEntryPoint": true,
    "copyToOutput": {
      "include": [ "configuration.json"]
    }
  },

  "dependencies": {
    "NETStandard.Library": "1.6.1",
    "Microsoft.NETCore.Portable.Compatibility": "1.0.1",
    "Microsoft.EntityFrameworkCore": "1.1.5",
    "Newtonsoft.Json": "10.0.3",
    "Microsoft.EntityFrameworkCore.Relational": "1.1.3",
    "System.Runtime": "4.3.0",
    "Devart.Data.Oracle.EFCore": "9.5.399"
  },

  "frameworks": {
    "net461": {}
  },

  "runtimes": { "win7-x64": {} }
}

Re: Method not found exception after calling EnsureCreated() in EFCore

Posted: Wed 03 Jan 2018 14:46
by Shalex
1. You have created the project in the following way: VS2015 > File > New > Project > Installed > Templates > Visual C# > .NET Core > Console Application (.NET Core). Is this correct?

2. There two versions of Devart.* assemblies:
a) .NET Framework assemblies (supplied with dotConnect for Oracle installation)
b) .NET Standard assemblies (available via https://www.nuget.org/packages/devart.d ... ore.design)
Which ones (a or b) do you use?

3. Run your code in the debug mode, navigate to Debug > Windows > Modules and specify the full paths of the loaded Devart.* assemblies.

Re: Method not found exception after calling EnsureCreated() in EFCore

Posted: Wed 03 Jan 2018 15:51
by StefanWoe
Thanks for your reply!

1. Correct
2. (b) via nuget server
3. Following dlls found:
  • Devart.Data.dll C:\WINDOWS\assembly\GAC_MSIL\Devart.Data\5.0.1823.0__09af7300eec23701\Devart.Data.dll
  • Devart.Data.Oracle.dll C:\WINDOWS\assembly\GAC_MSIL\Devart.Data.Oracle\9.5.399.0__09af7300eec23701\Devart.Data.Oracle.dll
  • Devart.Data.Oracle.Entity.EFCore.dll D:\sources\OracleConnector_POC_App\src\OracleConnector_POC_App\bin\Debug\net461\win7-x64\Devart.Data.Oracle.Entity.EFCore.dll

Re: Method not found exception after calling EnsureCreated() in EFCore

Posted: Fri 05 Jan 2018 13:20
by Shalex
StefanWoe wrote:3. Following dlls found:
  • Devart.Data.dll C:\WINDOWS\assembly\GAC_MSIL\Devart.Data\5.0.1823.0__09af7300eec23701\Devart.Data.dll
  • Devart.Data.Oracle.dll C:\WINDOWS\assembly\GAC_MSIL\Devart.Data.Oracle\9.5.399.0__09af7300eec23701\Devart.Data.Oracle.dll
  • Devart.Data.Oracle.Entity.EFCore.dll D:\sources\OracleConnector_POC_App\src\OracleConnector_POC_App\bin\Debug\net461\win7-x64\Devart.Data.Oracle.Entity.EFCore.dll
These are .NET Framework assemblies.

.NET Standard assemblies are located at C:\Users\%userName%\.nuget\packages\ (.NET Core projects) OR at ..\%ProjectFolder%\packages\ (.NET Framework projects).

To fix the issue, uninstall dotConnect for Oracle, then reinstall it and select the "Do not install assemblies in the GAC" option in the install wizard.

Does this help?

Re: Method not found exception after calling EnsureCreated() in EFCore

Posted: Wed 10 Jan 2018 09:16
by StefanWoe
Shalex wrote:
To fix the issue, uninstall dotConnect for Oracle, then reinstall it and select the "Do not install assemblies in the GAC" option in the install wizard.

Does this help?
Yes, it did. Thank you very much!