Page 1 of 1

How to prevent EntityDeveloper from creating App.config

Posted: Fri 09 Oct 2015 00:55
by smokeing
We are using code approach (our app runs without App.config), but EntityDeveloper after every change creates App.config. Of course we can delete it manually after each edit, but that is a bit annoying.

Is there a way to prevent ED from creating App.config?

Re: How to prevent EntityDeveloper from creating App.config

Posted: Fri 09 Oct 2015 13:47
by Shalex
Please open Model Settings (double click the diagram surface) and clear the "Use the following connection string from App.Config" checkbox. Save the model.

Re: How to prevent EntityDeveloper from creating App.config

Posted: Sun 11 Oct 2015 01:09
by smokeing
I have this field unchecked, nonetheless the App.config is still generated.

Re: How to prevent EntityDeveloper from creating App.config

Posted: Mon 12 Oct 2015 10:58
by Shalex
We cannot reproduce the problem in our environment.
1. Tell us the exact (x.x.x) version of your Entity Developer. You can check it via Tools > Entity Developer > About.
2. Send us a small test project with a model and specify the exact steps we should follow with it for reproducing the issue.

Re: How to prevent EntityDeveloper from creating App.config

Posted: Mon 12 Oct 2015 12:17
by smokeing
I am using version 5.8.705.

I have sent you a test project. You should delete App.config from host project and click update model from database (recreate model checked) and save all.

Re: How to prevent EntityDeveloper from creating App.config

Posted: Mon 12 Oct 2015 14:35
by Shalex
Thank you for the test project.

Remarks:
1. The app.config is created because Entity Developer automatically adds EF6 provider registration (via app.config). There is no generated connection string in *.config when the "Use the following connection string from App.Config" option is turned off.
2. The app.config is created in the devarteftest.host project because this is a StartUp project.

Be aware that your project should include registrations of
a) DbProviderFactory
b) EF6 provider
when you deploy it.

In the same time, in opposite to *.config registrations, it is possible to add both registrations via code like it is implemented here: http://forums.devart.com/viewtopic.php?f=30&t=31799.

Do you actually need the option in Entity Developer settings for turning off automatic EF6 provider registration?

Re: How to prevent EntityDeveloper from creating App.config

Posted: Mon 12 Oct 2015 20:54
by smokeing
I have registered EF6 provider in code, but I haven't registered DbProviderFactory at all and everything seems to work.
I assume DbProviderFactory is needed only for ASP.NET projects?

Yes, we would like option for turning off automatic EF6 provider registration :)

Re: How to prevent EntityDeveloper from creating App.config

Posted: Tue 13 Oct 2015 07:42
by Shalex
smokeing wrote:I have registered EF6 provider in code, but I haven't registered DbProviderFactory at all and everything seems to work.
The provider factory can be described either in machine.config (globally) or in app.config / web.config (just for your application). The dotConnect for Oracle installation adds registration in machine.config.
smokeing wrote:I assume DbProviderFactory is needed only for ASP.NET projects?
It is required when your code uses dotConnect for Oracle via a factory-based class.
smokeing wrote:Yes, we would like option for turning off automatic EF6 provider registration :)
We will consider the implementation of this option and notify you about the result.

Re: How to prevent EntityDeveloper from creating App.config

Posted: Wed 21 Oct 2015 15:10
by Shalex
Shalex wrote:
smokeing wrote:Yes, we would like option for turning off automatic EF6 provider registration :)
We will consider the implementation of this option and notify you about the result.
Starting from the next public build of dotConnect for Oracle, there will be a way to turn off automatic EF6 provider registration: you should add the WriteProviderServicesConfiguration="false" attribute in the ModelSettings tag within the Model1.edps file (edit it with a text editor).

We will notify you when the corresponding build is available for download.

Re: How to prevent EntityDeveloper from creating App.config

Posted: Thu 22 Oct 2015 15:52
by Shalex
The new (8.5.521) build of dotConnect for Oracle is available for download now.