我在Asp.Net Core中获得了Access Exception。
System.UnauthorizedAccessException:'拒绝访问路径'C:**** \ source \ repos \ webcore \ webcore \ wwwroot'。
此异常由System.IO.File.WriteAllBytes生成
var webRoot = _hostingEnvironment.WebRootPath;
string hexString = System.Net.WebUtility.UrlEncode(reader.ReadToEnd());
System.IO.File.WriteAllBytes(webRoot, ConvertHexToBytes(hexString));
我试图在管理员模式下运行VS,我将网络服务添加到用户组,但它没有成功。你还有其他想法吗?
我的坏,Path是一个目录。让我尴尬: