What is the equivalent of Server.MapPath in ASP.NET Core?

后端 未结 4 1159
清酒与你
清酒与你 2020-11-28 14:24

I have this line in some code I want to copy into my controller, but the compiler complains that

The name \'Server\' does not exist in the current con

4条回答
  •  鱼传尺愫
    2020-11-28 14:52

    use for example: var fullPath = Path.Combine(Directory.GetCurrentDirectory(), "appsettings.json");

提交回复
热议问题