asp.net core - Referencing .Net framework dll which needs to read configuration data -
i have created asp.net core (.net framework) website references .net framework dll. dll needs read configuration data calling applications web.config or application.config file.
how can in asp.net core application? have tried adding configuration settings web.config in asp.net core application not being picked in dll.
after bit more research noticed although asp.net core (.net framework) project uses appsettings.json settings still contains web.config file. added settings dll needs web.config , added 'copytooutput' setting (below) project.json file.
"buildoptions": { "emitentrypoint": true, "preservecompilationcontext": true, "copytooutput": "web.config" },
now dll can retrieve settings needs. 1 downside may end doubling configuration settings (adding them appsettings.json , web.config) if both asp.net core , dll require them. haven't tested deploying azure etc.
welcome comments.
Comments
Post a Comment