找不到路径'C:\ inetpub \ wwwroot \ Files \ Flowers'的一部分。
$var ImageDirectory = new DirectoryInfo(Path.Combine(HostingEnvironment.MapPath(WebConfigurationManager.AppSettings["PathFlowerImages"]))); //this line produces error
where WebConfigurationManager.AppSettings["PathFlowerImages"])
is ~/Files/Flowers/
Folder structure is
ChapelAdmin //Project
--Files
--Flowers
--Image.jpg
with in ebextensions
container_commands :
01 –changeperm :
command : icacls "C:/inetpub/wwwroot/ChapelAdmin/Files" /grant DefaultAppPool : (OI ) (CI )F > log. txt 2 >& 1
cwd : "C:/inetpub/wwwroot/ChapelAdmin"
{
"container_commands": {
"01-aclchange": {
"command": "icacls \"C:/inetpub/wwwroot/ChapelAdmin_deploy/Files\" /grant DefaultAppPool:(OI)(CI)"
}
}
}
我还没有将Files文件夹放在appdata中。 还创建了一个ChapelAdmin.json // ChapelAdmin是项目名称,用于向Files Folder授予权限,但仍然出现相同的错误 命名:ChapelAdmin.json 我已经尝试过,但是未能使其发挥作用,对此不胜感激。