dotConnect for Oracle and EF6 not working on client pc

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
yammi900
Posts: 4
Joined: Thu 21 May 2015 16:18

dotConnect for Oracle and EF6 not working on client pc

Post by yammi900 » Wed 06 Jan 2016 12:57

Hi all,

I'm using Devart.Data.Oracle, Version=8.4.293.0 together with EF6.1.1 in a winforms application and added the recommended sections

Code: Select all

    <providers>
      <!--provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /-->
      <provider invariantName="Devart.Data.Oracle" type="Devart.Data.Oracle.Entity.OracleEntityProviderServices, Devart.Data.Oracle.Entity, Version=8.4.293.6, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </providers>
and

Code: Select all

  <system.data>
    <DbProviderFactories>
      <remove invariant="Devart.Data.Oracle" />
      <add name="dotConnect for Oracle" invariant="Devart.Data.Oracle" description="Devart dotConnect for Oracle"
       type="Devart.Data.Oracle.OracleProviderFactory, Devart.Data.Oracle, Version=8.4.293.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </DbProviderFactories>
  </system.data>
This works fine on my development machine. However, if I deploy the solution using ClickOnce I get a runtime error the moment I touch the provider for the first time.

Code: Select all

	Shared Sub Main()
		Try
			Dim config As OracleEntityProviderConfig = Devart.Data.Oracle.Entity.Configuration.OracleEntityProviderConfig.Instance
			config.DmlOptions.InsertNullBehaviour = InsertNullBehaviour.InsertDefaultOrNull

			Application.Run(New frmMain)
		Catch ex As Exception
			ExtendedExceptionDialog.DisplayException(ex)
		End Try
	End Sub
The exception is:

The file or assembly "Devart.Data.Oracle, Version=8.4.293.0 ..." or a reference could not be found. The located assembly’s manifest definition does not match the assembly reference .


All references are copied locally and specific version is set to false.

Any ideas how to resolve this problem?

Regards,

Chris

Shalex
Devart Team
Posts: 8036
Joined: Thu 14 Aug 2008 12:44

Re: dotConnect for Oracle and EF6 not working on client pc

Post by Shalex » Wed 06 Jan 2016 14:27

Please make sure that you copy the following Devart.* assemblies
Devart.Data.dll
Devart.Data.Oracle.dll
Devart.Data.Oracle.Entity.dll
in the folder with your application (or in GAC) in your deployment environment.

If this doesn't help, upload a small test application to some file exchange server (and send us a download link) so that we can reproduce the issue in our environment.

yammi900
Posts: 4
Joined: Thu 21 May 2015 16:18

Re: dotConnect for Oracle and EF6 not working on client pc

Post by yammi900 » Thu 07 Jan 2016 10:47

I found the issue! I'm the one to blame.

Instead of
C:\Program Files (x86)\Devart\dotConnect\Oracle\Entity\EF6\Devart.Data.Oracle.Entity.dll
I included a reference to ..\EF5\Devart.Data.Oracle.Entity.dll. Now everything is working fine and the .dll has the correct version number.

However, I wonder how the programm could run on my development machine. The assembly mentioned above was neither in the GAC nor in the path. How was it found?


Regards,

Chris

Shalex
Devart Team
Posts: 8036
Joined: Thu 14 Aug 2008 12:44

Re: dotConnect for Oracle and EF6 not working on client pc

Post by Shalex » Fri 08 Jan 2016 12:18

Please check GACv4.0:

Code: Select all

C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Devart.Data.Oracle.Entity\v4.0_8.4.293.6__09af7300eec23701\Devart.Data.Oracle.Entity.dll

Post Reply