Why the web.config isn't copied when I publish an ASP.NET Web Project with the “Only files needed to run this application” option?

前端 未结 3 1945
鱼传尺愫
鱼传尺愫 2021-02-20 11:18

How to correct it?

相关标签:
3条回答
  • 2021-02-20 12:04

    "Only files needed to run this application" means any build output files like DLLs and references in the bin folder and any files that have a Build Action of Content.

    Since the web.config is neither of these, you'll have to change the publish option to All Project Files, or else copy the web.config manually.

    0 讨论(0)
  • 2021-02-20 12:08

    I know it sounds silly but make sure it is marked as 'Content' as it's Build Action under it's properties.

    0 讨论(0)
  • 2021-02-20 12:09

    When you say 'ASP.NET web project', do you mean 'ASP.NET web application project'?

    If so, the web.config should have a build action of Content by default. As Brandon mentioned, Content is then copied over to the publish destination.

    To verify, select the web.config file in your Solution Explorer then use the Properties Window. An example:

    example http://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&id=558

    0 讨论(0)
提交回复
热议问题