Set web.config transform in Asp.NET Core

后端 未结 8 1675
遥遥无期
遥遥无期 2021-01-04 10:54

I\'ve just came across with problem of web.config transformation in asp.net core.

There are two files: base web.config and web.prod-zone-a.config. My aim is to use t

8条回答
  •  长发绾君心
    2021-01-04 11:39

    IIS Web Deploy ASP.NET Core (2.1) in Visual Studio 2017 (VS2017)

    First do this: (ref:https://github.com/nil4/dotnet-transform-xdt#-use-with-msbuildcsproj-tooling)

    1. Install package - dotnet add package DotNet.Xdt --version 2.1.0
    2. Modify .csproj - add package - refer github
    3. Modify .csproj - add transform code (ApplyXdtConfigTransform) at the end - refer github
    4. Add web.DEV_Server.config transfor file by right-clicking on DEV_Server.pubxml
    5. Added following to web.DEV_Server.config

    1. Modify DEV_Server.pubxml to modify following setting value.

    DEV_Server

    1. Validate Connection & Publish

    Deploy still uploads other config files, not sure how to stop that.

提交回复
热议问题