locked
VS2019 and applicationhost.config RRS feed

  • Question

  • User-824531797 posted

    Hi

    We have several web projects and solutions on Asp.net MVC.

    Until VS 2017, applicationhost.config was located in .vs\config and now VS2019 has changed it to .vs\{solution}\config.

    This is creating issues for us as the no. of config files to be managed (across teams) have multiplied.

    Is it possible to configure project/vs such that one applicationhost.config file is used for the whole machine ?

    useglobalApplicationHostFile does not seem to be working.

    Thanks

    Thursday, April 16, 2020 6:54 AM

All replies

  • User475983607 posted

    applicationhost.config is an IIS configuration file located at %windir%\system32\inetsrv\config.

    https://docs.microsoft.com/en-us/iis/get-started/planning-your-iis-architecture/introduction-to-applicationhostconfig

    Thursday, April 16, 2020 10:36 AM
  • User-824531797 posted
    That link is for IIS.

    My question is regarding IIS express that is used for debugging from Visual Studio.
    Thursday, April 16, 2020 10:50 AM
  • User475983607 posted

    What exactly is the problem?  DO you have code that modifies or reads the appplicationhost.config where the path is hard coded? 

    Thursday, April 16, 2020 11:00 AM
  • User288213138 posted

    Hi abhisinghal21,

    Is it possible to configure project/vs such that one applicationhost.config file is used for the whole machine ?

    My question is regarding IIS express that is used for debugging from Visual Studio.

    According to your description, I couldn’t understand your requirement clearly.

    Do you mean applicationhost.config refers to the file under the "%userprofile%\Documents\IISExpress\config folde"?

    If so, you could refer to below link:

    https://docs.microsoft.com/en-us/iis/extensions/using-iis-express/running-iis-express-from-the-command-line#running-your-site-from-a-configuration-file

    If I misunderstand your requirement, please post more details information about your requirement.

    Best regards,

    Sam

    Friday, April 17, 2020 3:26 AM
  • User-824531797 posted

    Problem is that now we have to maintain many more applicationhost.config files.

    We maintain 15+ products, each of which have a top level directory. Inside each top level directory, there are solutions for that product. (3 solutions/product avg)

    Until now, we had to maintain one applicationhost.config file for each product, because its path was .vs\config\applicationhost.config. This was itself tedious but somehow manageable.

    Now, since the path is .vs\solution\config\applicationhost.config, we have to maintain 3x applicationhost.config files and it has become difficult. Also, this has to be done on every team member's PC.

    Looking to configure the project/vs such that one system wide applicationhost.config can be used for IIS express during Visual studio debugging.

    Kindly advise.

    Friday, April 17, 2020 10:20 AM
  • User-824531797 posted

    Awaiting response.

    Wednesday, April 22, 2020 5:36 AM
  • User288213138 posted

    Hi abhisinghal21,

    You can try to run this command in your project command line arguments.

    iisexpress /config:c:\myconfig\applicationhost.config 

    This command runs the first site in the specified configuration file.

    Best regards,

    Sam

    Wednesday, April 22, 2020 6:14 AM