Вопрос

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