As stated in your last post, core 3.1 can not call 4.* code. Also .net core apps do not support .config files.
console core 3.1 gives this error - Unrecognized configuration section add
Hi, this is what i get from running my console core 3.1 project that is trying to access .net 4.7.2, through, .netstandard2.0, which will run a method in my 4.7.2 which returns data back into .netstandard2.0 and returns this data to be displayed on the core console. Take note, the data returned from 4.7.2 is entity framework data 6.4.4.
> The current error is (as in one of the images from my previous post)
Inner Exception 1:
ConfigurationErrorsException: Configuration system failed to initialize
Inner Exception 2:
ConfigurationErrorsException: Unrecognized configuration section add. (D:\MBSSys\MbsaMultiTargeting\MbsaMultiTargeting\bin\Debug\net472\MbsaMultiTargeting.exe.Config line 6)
As you can see, this is the location of my "MbsaMultiTargeting.exe.Config " this is what the config file looks like:
Now I need advice about what is WRONG with this config section error. Googling this error shows many different config files, but I dont see any that handle an "exe.config" file for core console 3.1?
Thanks for any advice or suggestions
Developer technologies ASP.NET ASP.NET Core
-
Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
2022-12-04T02:14:11.407+00:00
1 additional answer
Sort by: Most helpful
-
iqworks Information Quality Works 331 Reputation points
2022-12-09T20:07:21.7+00:00 Hi Yiyi, what i am trying to do is to use core 3.1 to access my .net4.7.2 EF6, THROUGH .netstandard.
Bruce was correct, you cannot access .net4.7.2 from core 3.1. But I found the actual reason pertaining to my particular issue.
Core 3.1 puts its connection string in appsettings.json. net4.7.2 cannot read this appsettings.json, it only reads its web.consig file. One solution is to pass the connection string as a parm or something like a session variable and send it from core 3.1 through .netstandard to .net7.7.2. This was ONE suggestion.But, for others that are looking into this issue. Do a google search with "core 3.1 console .nt472 Message=No connection string named could be found in the application config file. Source=EntityFramework". Here you will find MANY links of people explaining this issue and, the many different ways each link showing how to get around this.
Thank you guys for your help and enlighting information.