mirror of
https://github.com/gwdevhub/Daybreak.git
synced 2026-07-24 03:56:30 +00:00
22 lines
569 B
C#
22 lines
569 B
C#
namespace Daybreak.Utils;
|
|
|
|
public static class WebRootUtil
|
|
{
|
|
public static string GetWebRootPath()
|
|
{
|
|
var releasePath = Path.Combine(AppContext.BaseDirectory, "wwwroot");
|
|
if (Directory.Exists(releasePath))
|
|
{
|
|
return releasePath;
|
|
}
|
|
|
|
var debugPath = Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", "..", "wwwroot");
|
|
if (Directory.Exists(debugPath))
|
|
{
|
|
return debugPath;
|
|
}
|
|
|
|
throw new InvalidOperationException("Could not find web root folder");
|
|
}
|
|
}
|