简体   繁体   中英

Access Denied,when Process.Start after Deploy on Local IIS

I am developing an ASP.Net MVC 5 application. When I am running the project on visual studio 2015 the Windows Explorer opened without problem.

But after Deploy on Local IIS , I Get Access Denied.

1) I added IUSR & IIS_IUSR
2) I checked Static from Control pane

public ActionResult Attachments(int? id)
{
    if (id > 0)
    {
        Client client = db.Clients.Find(id);
        string Path = Server.MapPath("~/Content/Attachments/Clients/");
        if (Directory.Exists(Path))
        {
            Process.Start(Path);
        }
    }

    return RedirectToAction("Index");
}

When you run it in Visual Studio using IISExpress you're running under an interactive user session. Local IIS won't be.

You could try switching on "Allow service to interact with desktop" for the W3SVC service under Services manager.

It's a strange thing to do though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM