dotnet发布iis不';行不通

dotnet发布iis不';行不通,iis,asp.net-core,publish,Iis,Asp.net Core,Publish,我有一个ASP.NET Core RC2项目,我正在尝试将其发布到IIS,并且命令dotnet publish IIS始终提供: Asp.Net Core IIS Publisher Usage: dotnet publish-iis [arguments] [options] Arguments: <PROJECT> The path to the project (project folder or project.json) being published. If emp

我有一个ASP.NET Core RC2项目,我正在尝试将其发布到IIS,并且命令
dotnet publish IIS
始终提供:

Asp.Net Core IIS Publisher
Usage: dotnet publish-iis [arguments] [options]
Arguments:
  <PROJECT>  The path to the project (project folder or project.json) being published. If empty the current directory is used.
Options:
  -h|--help                   Show help information
  --publish-folder|-p         The path to the publish output folder
  -f|--framework <FRAMEWORK>  Target framework of application being published
Asp.Net核心IIS发布服务器
用法:dotnet发布iis[参数][选项]
论据:
正在发布的项目(项目文件夹或project.json)的路径。如果为空,则使用当前目录。
选项:
-h |--帮助显示帮助信息
--发布文件夹|-p发布输出文件夹的路径
-f |——发布应用程序的框架目标框架
有没有一个例子说明这是如何工作的? 如何传递参数?它永远不会工作…

--publish文件夹和
--framework
参数是必需的。如果不提供这些参数,该工具将显示使用情况

尽管如此,实际上并不期望它自己运行这个工具。publish iis所做的只是调整已发布应用程序的web.config文件(如果不存在,则创建一个新的web.config),以便iis/IISExpress可以找到要启动的应用程序。换句话说,你必须先发布你的应用程序,然后发布iis,只需稍微按摩一下就可以了。因此,预期用途是将其配置为作为发布后脚本运行:

"scripts": {
  "postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
}

我在这篇

中为ASP.NET Core 1.1详细介绍了
发布iis
工具。project.json中的关键部分包括:

  "tools": {
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final"
  },

  "scripts": {
    "postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
  }

对我来说太棒了

但这不会在wwwroot中生成
web.config
。这是预期的吗?我认为project root和wwwroot中都需要web.config。web.config文件的默认位置现在是您的approot,而不是wwwroot。还有,为什么有2个web.config文件会有用呢?这个名称一点也不令人困惑。顺便说一句,写得很棒。aspnet文档很棒,但这一部分在文档中尤其没有意义。