I have a problem where adding Application to IIS Site with network physical path.

In code:

    using Microsoft.Web.Administration;
    ...
    ServerManager serverManager = new ServerManager();
    var site = serverManager.Sites.Where(i => i.Name == "services").SingleOrDefault();
    site.Applications.Add("\\src\services\myservice", "myservice"); //exception

My application throws an exception "Invalid application path". I try to create a Virtual Directory, but I already catch this exception. Application pool and my program have a permissions to this network folder. How to fix this problem?

没有正确的解决方案

其他提示

Resolved. .Applications.Add() method requires slash at beginning:

site.Applications.Add("\\src\services\myservice", "/myservice");
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top