none
where is the Application settings file located that contains the entity (edmx) information for a given project? RRS feed

  • Question

  • Every now and then, after I add an ADO.Net entity (edmx) I  have to delete it and start over -- like the last one was not pluralized but I added one that is.  In the connection string -- it won't allow me to re-use one that was already used -- even though I go  to web.config and remove that previous connection string.  I get the message that the Application Setting file already contains this particular connection string.

    Where is this Application Setting file located so I can remove the entity information?  I looked at some app.config files (which I have hundreds of -- which one is it?).  I even used baregrep to read through hundreds of app.config files looking for a given connection string name, but nothing turns up.


    Rich P


    • Edited by Rich P123 Wednesday, October 18, 2017 3:23 PM ..........
    Wednesday, October 18, 2017 3:22 PM

Answers

  • app.config files are only used in debug runtime, at the project level.

    Wherever the EF model is created, then an app.config containing the EF config info will be created at the location of the model. If an app.config is there from a previous EF model creation, then you should delete it before generating the model.

    So the info about EF in the app.config at the model location is the latest one, and the config info for EF must be copied to the Web.config as an example.

    • Marked as answer by Rich P123 Wednesday, October 18, 2017 9:21 PM
    Wednesday, October 18, 2017 8:29 PM

All replies

  • app.config files are only used in debug runtime, at the project level.

    Wherever the EF model is created, then an app.config containing the EF config info will be created at the location of the model. If an app.config is there from a previous EF model creation, then you should delete it before generating the model.

    So the info about EF in the app.config at the model location is the latest one, and the config info for EF must be copied to the Web.config as an example.

    • Marked as answer by Rich P123 Wednesday, October 18, 2017 9:21 PM
    Wednesday, October 18, 2017 8:29 PM
  • Finally!  I found that dagnab config file.  In my case the file was called

    <myAppName>.dll.config

    I was wantonly looking for app.config, but turned out be myTestPagingApp.dll.config which contained the exact same connection string as in web.config.  I deleted the connection string  in both files and was able to re-add another edmx with the same entity name.

    The big thing for me was that the .config file was located in the same folder structure as my application.

    This has been bugging me for a long time.  Finally conquered.  Many thanks for the help.


    Rich P

    Wednesday, October 18, 2017 9:27 PM