0

I am working on an asp.net core project in which I wrote a custom library for retrieving data from restful API. I am planning to refer this class library in my project and I need to pass some details like TenantId, ClientId & etc from the web project to the class library

The below image is my current setup but upon running the code I always got NULL

Configuration.cs

This class are found in my Class Library

enter image description here

Web.config

enter image description here

Can someone help me on this matter. Thank you

VLAZ
  • 26,331
  • 9
  • 49
  • 67
Noyti
  • 121
  • 2
  • 11
  • asp.net or asp.net core? – Jeremy Lakeman Feb 24 '22 at 04:06
  • Can you confirm if this answers your question: https://stackoverflow.com/a/11535980/495455 - If so then we can close as a duplicate. – Jeremy Thompson Feb 24 '22 at 04:24
  • asp.net core buddy @JeremyLakeman – Noyti Feb 24 '22 at 05:00
  • 1
    web.config is for IIS configuration. While it used to be how you would configure an aspx project. In an asp.net core project, IIS is just a reverse proxy. While I'm sure its possible to write a web.config configuration provider, IMHO you should just adopt the new appsettings.json way https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-6.0. – Jeremy Lakeman Feb 24 '22 at 05:45

0 Answers0