reading web.config from class library

后端 未结 5 1951
生来不讨喜
生来不讨喜 2021-01-21 03:30

i have two project 1) class library with no inteface just an api 2) web application

from web apps i will be calling the class library api

so i have all the web

5条回答
  •  灰色年华
    2021-01-21 03:43

    just saw the post and i had same problem but i got a way.. add System.Web.Configuration reference to your class library prj then

    ConnectingString = WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;

    Hope this will help

提交回复
热议问题