How to prevent EntityDeveloper from creating App.config

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
smokeing
Posts: 23
Joined: Fri 09 Oct 2015 00:51

How to prevent EntityDeveloper from creating App.config

Post by smokeing » Fri 09 Oct 2015 00:55

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?

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Re: How to prevent EntityDeveloper from creating App.config

Post by Shalex » Fri 09 Oct 2015 13:47

Please open Model Settings (double click the diagram surface) and clear the "Use the following connection string from App.Config" checkbox. Save the model.

smokeing
Posts: 23
Joined: Fri 09 Oct 2015 00:51

Re: How to prevent EntityDeveloper from creating App.config

Post by smokeing » Sun 11 Oct 2015 01:09

I have this field unchecked, nonetheless the App.config is still generated.

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Re: How to prevent EntityDeveloper from creating App.config

Post by Shalex » Mon 12 Oct 2015 10:58

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.

smokeing
Posts: 23
Joined: Fri 09 Oct 2015 00:51

Re: How to prevent EntityDeveloper from creating App.config

Post by smokeing » Mon 12 Oct 2015 12:17

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.

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Re: How to prevent EntityDeveloper from creating App.config

Post by Shalex » Mon 12 Oct 2015 14:35

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?

smokeing
Posts: 23
Joined: Fri 09 Oct 2015 00:51

Re: How to prevent EntityDeveloper from creating App.config

Post by smokeing » Mon 12 Oct 2015 20:54

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 :)

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Re: How to prevent EntityDeveloper from creating App.config

Post by Shalex » Tue 13 Oct 2015 07:42

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.

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Re: How to prevent EntityDeveloper from creating App.config

Post by Shalex » Wed 21 Oct 2015 15:10

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.

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Re: How to prevent EntityDeveloper from creating App.config

Post by Shalex » Thu 22 Oct 2015 15:52

The new (8.5.521) build of dotConnect for Oracle is available for download now.

Post Reply