質問

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