Hi,
I dont think I am using the multi-targeting correctly, and, Going from the console through netstandard2.0 is NOT multi-targeting. All I see from videos or forum post just show you how to set up multi-targeting, but then what. If you know of any links or videos that go beyond setting up a multi-targeting project, it would be VERY helpful.
This is my multi-targeting project:
My Mbsa .net 4.7.2 project:
My Mbsa Entity framework in .net 4.7.2 in web.config :
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
Here, I am calling the .netstandard method to return the EF member table data from .net 4.7.2 for member number 1.
when I run the core console app I get this error in my Mbsa .net 4.7.2.
This is the description
System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception.
Source=EntityFramework
StackTrace:
at System.Data.Entity.Internal.AppConfig.get_DefaultInstance()
at System.Data.Entity.Internal.LazyInternalConnection..ctor(DbContext context, String nameOrConnectionString)
at System.Data.Entity.DbContext..ctor(String nameOrConnectionString)
at Mbsa.Models.MbsaDataEntities..ctor() in D:\MBSSys\Mbsa\Mbsa 2021\Models\MbsaDB.Context.cs:line 19
at Mbsa.Common.CommonRepo`1..ctor() in D:\MBSSys\Mbsa\Mbsa 2021\Common\CommonRepo.cs:line 24
at Mbsa.BL.MembersService..ctor() in D:\MBSSys\Mbsa\Mbsa 2021\BL\MembersService.cs:line 38
at MbsaDotNetStandard.MbsaUseFrameworkMethods.grabMbsaMember(Int32 mno) in D:\MBSSys\MbsaDotNetStandard\MbsaUseFrameworkMethods.cs:line 16
at MbsaMultiTargeting.Program.Main(String[] args) in D:\MBSSys\MbsaMultiTargeting\MbsaMultiTargeting\Program.cs:line 31
This exception was originally thrown at this call stack:
[External Code]
Inner Exception 1:
ConfigurationErrorsException: Configuration system failed to initialize
Inner Exception 2:
ConfigurationErrorsException: Unrecognized configuration section add. (D:\MBSSys\MbsaMultiTargeting\MbsaMultiTargeting\bin\Debug\netcoreapp3.1\MbsaMultiTargeting.dll.config line 3)
this is the problem. I have seen several posts about this from various forums but I dont know where to put what. It looks like I need a <section name> in my app.config.
this is my appsettings.json
This is what I SHOULD be focusing on "line 6 ":
Perhaps I need a new thread to clear what the focus should be on:
https://learn.microsoft.com/en-us/answers/questions/1114938/console-core-31-gives-this-error.html
thanks for any suggestions and advice