Deploying an EF Application

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
rwarren
Posts: 9
Joined: Tue 07 Sep 2010 17:55

Deploying an EF Application

Post by rwarren » Tue 07 Sep 2010 18:14

I have a standalone windows application (not a webapp) that uses Entity Framework (EF) to access an Oracle database through the DevArt dotConnect for Oracle entity model. On my setup, it works perfectly.

Moving all the binaries to another computer, however doesn't work so well. I'm getting the following error:

Code: Select all

System.Configuration.ConfigurationErrorsException: Failed to find or load the registered .Net Framework Data Provider.
   at System.Data.Common.DbProviderFactories.GetFactory(DataRow providerRow)
   at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)
   at System.Data.EntityClient.EntityConnection.GetFactory(String providerString)
   at System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString)
   at System.Data.EntityClient.EntityConnection..ctor(String connectionString)
   at System.Data.Objects.ObjectContext.CreateEntityConnection(String connectionString)
   at System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName)
   at ForensicsDatabase.ForensicsEntities..ctor()
   at ForensicsDal.ForensicsCoreDalc.LoadPlates(DateTime startDate, DateTime endDate, Boolean newOnly, String queryString)
   at SelectionControl.ViewModels.SelectionViewModel.LoadPlatesWork(Object sender, DoWorkEventArgs e)
I did follow the instructions posted here:

http://www.devart.com/dotconnect/oracle ... yment.html

In my own app.config, I've added the stanza:

Code: Select all

	
		
			
			
		
	
The version number matches what I have installed in the GAC. I've also manually included the Devart.Data.Oracle.Entity.dll (from my install) with my application, though it isn't really referenced by any project.

Not sure where I'm going wrong... Anything obvious I'm missing?

Thanks,

Robin

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 08 Sep 2010 10:15

Looks like you have performed all necessary steps.
Could you please send us (support * devart * com, subject "EF Deployment") a small test project producing this error?
One more guess: do you have .NET Framework 3.5 SP 1 installed on the machine you are deploying the application on?

rwarren
Posts: 9
Joined: Tue 07 Sep 2010 17:55

Post by rwarren » Thu 09 Sep 2010 18:25

Yes, I do have .NET Framework 3.5 SP 1 installed on the target machine. I just sent a test project, so hopefully you can spot what I'm missing.

Thanks!

rwarren
Posts: 9
Joined: Tue 07 Sep 2010 17:55

Post by rwarren » Thu 09 Sep 2010 23:36

After making a smaller test project that isolated the issue (something I should have thought of on my own), I found I was able to experiment more easily. I discovered that I had the DevArt.Data.Oracle.Entity.dll, but I didn't have DevArt.Data.Oracle.dll and DevArt.Data.dll files in there! Once those were added, I got past the factory error, and got as far as a licensing error. I followed the instructions on the licensing page:

http://www.devart.com/dotconnect/oracle ... tml#manual

Simply adding the license file to my project, and recompiling resolved the problem! I am now able to deploy this app to a non-developer machine!

I'm curious why your Deployment instructions do not specify that the other two DLLs are needed. Is that something that should have been obvious? I'll admit it does make sense now that I've been through it, but it might make sense to explicitly state that in those instructions.

Thanks!

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Fri 10 Sep 2010 07:24

Glad to hear the issue is resolved.
Actually, the first paragraph of the Deployment article states that:
To deploy applications written with dotConnect for Oracle you should register run-time assemblies Devart.Data.Oracle.dll and Devart.Data.dll at Global Assembly Cache (GAC) for appropriate framework or place them in the folder of your application (Bin folder for web projects).

rwarren
Posts: 9
Joined: Tue 07 Sep 2010 17:55

Post by rwarren » Fri 10 Sep 2010 16:45

Oh wow, you're right. I was so focused on the EF portion of those instructions, I completely missed the first line's instructions!

Thanks for your help!

Post Reply