10 Replies Latest reply on Apr 26, 2012 7:11 PM by nswandel

    <oracle.dataaccess.client> not recognized in app.config for edmMapping

    911303
      Hi,

      I installed ODTwithODAC112030 EF provider release version.
      So I want to use custom EDM Mapping for boolean or something else.
      But Entity Data Model can't recognize
      <oracle.dataaccess.client>
      <settings>
      section in appConfig file.
      I'm using Win 7 x64 , VS 2010 and x86 odac components.
      How can i resolve this problem.

      Thank you..
        • 1. Re: <oracle.dataaccess.client> not recognized in app.config for edmMapping
          839477
          Hello,

          You need to add the Oracle.DataAccess.DLL to your project to use it on the app.config.
          • 2. Re: <oracle.dataaccess.client> not recognized in app.config for edmMapping
            911303
            I think, no need to add that reference.
            But I added to project and tried again.And it doesn't work.:(

            oracle.dataaccess.client section doesn't work when creating model.
            I changed some values like
            <add name="boolHello" value="edmmappingHelllo number(1,0)" />

            It must return exception but nothing happens.
            • 3. Re: <oracle.dataaccess.client> not recognized in app.config for edmMapping
              Tridus
              You sound like you might be having the same problem I am, where the model generator doesn't pick up anything you do in the config files with <oracle.dataaccess.client>. If you manually set the types in the model to boolean and then run the application with that config set, the application itself should work (it DOES pick up the config at runtime).

              I really haven't figured out why it's not picking it up in the model builder.
              • 4. Re: <oracle.dataaccess.client> not recognized in app.config for edmMapping
                911303
                Thanks for your post Tridus.
                But I have 200 tables and many fields.
                And number mappings includes 4 type mappings.
                So it's difficult to replace all fields.

                And one virtual machine that I use working properly.
                • 5. Re: <oracle.dataaccess.client> not recognized in app.config for edmMapping
                  15208
                  Would you please do a simple test like follows?

                  1. create test table

                  create table test_table (c1 number(4) primary key not null, c2 number(1, 0), c3 number(2), c4 number(5, 0), c5 number(10, 0), c6 number(19, 0));

                  2. create a C# Console application and create a data model from test_table.

                  Because there is no custom type mapping specified in app.config, default mapping is used in the model.
                  Your CSDL section in Model1.edmx should show:

                  <EntityType Name="TEST_TABLE">
                  <Key>
                  <PropertyRef Name="C1" />
                  </Key>
                  <Property Name="C1" Type="Int16" Nullable="false" />
                  <Property Name="C2" Type="Int16" />
                  <Property Name="C3" Type="Int16" />
                  <Property Name="C4" Type="Int16" />
                  <Property Name="C5" Type="Int32" />
                  <Property Name="C6" Type="Int64" />
                  </EntityType>


                  3. Delete Model1.edmx.

                  4. Open app.config and add the following below </connectionStrings> and above </configuration>. Save changes.

                  <oracle.dataaccess.client>
                  <settings>
                  <add name="bool" value="edmmapping number(1, 0)" />
                  <add name="byte" value="edmmapping number(3, 0)" />
                  <add name="int16" value="edmmapping number(4, 0)" />
                  <add name="int32" value="edmmapping number(9, 0)" />
                  <add name="int64" value="edmmapping number(18, 0)" />
                  </settings>
                  </oracle.dataaccess.client>


                  5. Create a data model from test_table again.
                  The new model should be using your custom type mapping.
                  Your CSDL section in Model1.edmx should show:

                  <EntityType Name="TEST_TABLE">
                  <Key>
                  <PropertyRef Name="C1" />
                  </Key>
                  <Property Name="C1" Type="Int16" Nullable="false" />
                  <Property Name="C2" Type="Boolean" />
                  <Property Name="C3" Type="Byte" />
                  <Property Name="C4" Type="Int32" />
                  <Property Name="C5" Type="Int64" />
                  <Property Name="C6" Type="Decimal" Precision="19" Scale="0" />
                  </EntityType>


                  If it does not work for you, you may want to check the version of your Oracle.DataAccess.dll in the GAC.

                  gacutil /l Oracle.DataAccess

                  Or change the timestamp of app.config.

                  touch.exe app.config
                  • 6. Re: <oracle.dataaccess.client> not recognized in app.config for edmMapping
                    911303
                    Thanks shsu.

                    I tried everything you said.
                    But nothing changed.
                    Than I changed regional settings and it worked.

                    My Region Format: Turkish Location: Turkey
                    And changed to
                    Format:English Location:United States.

                    So what can I do now.
                    Any suggestions??

                    Edited by: melyurt on Jan 25, 2012 5:03 AM
                    • 7. Re: <oracle.dataaccess.client> not recognized in app.config for edmMapping
                      15208
                      Thanks for the input.
                      That sounds like the famous Turkish letter "i" issue.

                      When use Region Format: Turkish Location: Turkey,
                      does the lower case "i" in "client" of "<oracle.dataaccess.client>" have a dot?
                      • 8. Re: <oracle.dataaccess.client> not recognized in app.config for edmMapping
                        911303
                        Sure, "i" have a dot.
                        I tried uppercase characters but nothing worked again.

                        And there is another problem that reading config file at runtime
                        when current thread culture equals to "tr-TR".

                        Thread.CurrentThread.CurrentCulture = "tr-TR";

                        So can I find the proper solution or need to wait until Oracle's next release??

                        Edited by: melyurt on Jan 25, 2012 11:59 PM
                        • 9. Re: <oracle.dataaccess.client> not recognized in app.config for edmMapping
                          15208
                          The issue is confirmed and I have filed bug 13632530 on your behalf.
                          • 10. Re: <oracle.dataaccess.client> not recognized in app.config for edmMapping
                            nswandel
                            Hi! I feel your pain. I have had some similar issues and have made a few discoveries that have allowed me to get around these issues through a couple of ODAC releases. I just upgraded from the previous beta 3. With the beta 3 I found that any time the .edmx was changed or validated I would get these errors. I could get rid of the errors by moving my edmmapping in the App.Config from on place to another and rebuilding. Very annoying, but I could proceed. Sometimes the errors would return seemingly without cause, but my kludgey fix would get rid of them. The reasons for the issue or why my recurring fix works are beyond me. It will differ a bit depending on what you are remapping, but this is the piece I move around.

                            <oracle.dataaccess.client>
                            <settings>
                            <add name="bool" value="edmmapping number(1,0)"/>
                            </settings>
                            </oracle.dataaccess.client>

                            Now I have downloaded the current release ODAC 11.2 Release 4 (11.2.0.3.0) and my ludgy fix no longer gets rid of the errors. Well it is always good to know someone who has suffered .NET development longer than you. I was whine to my more experienced friend and he knew of the issue and it is not restricted to Oracle. He has experienced this issue with SQL Server and mySQL as well. He found a fix by accident after much suffering (no claim of brilliance) and why it works is a mystery. If I click on the designer background and "Generate Database from Model…" and save the file to my project then my issues are gone. I am told I may have to occasionally do this again if the issues reappear. The presence of the file is benign and solves my issues. Let me know if the works for you.