However, this does not work locally. To get it to work locally, I must remove the tilde specifying the root document and just have Index.aspx. The file is not in any subfolder.
Currently, I have it set to work in Azure, and set a specific start page, which is functional, but not exactly the same thing. I was wondering if there was a way to have both environments work without some kind of publish transform?
I am aware you can set the default document from the Azure General settings as well, but I would like to have it work locally.
Based on your description, I recommend that you make transformation in web.config which contains
Web.Debug.config and Web.Release.config files.
You can select the index page in your current root directory as the default document in one of the config files (like Web.Debug.config) in the local test environment.
Then add the correct default document path to another config
(like Web.Release.config ) and select this config type for publication.
None
0 Points
2 Posts
DefaultDocument not working locally
Aug 01, 2019 02:08 PM|Rstan122|LINK
When running live on Azure, setting the defaultDocument in web.config with the root directory works:
However, this does not work locally. To get it to work locally, I must remove the tilde specifying the root document and just have Index.aspx. The file is not in any subfolder.
Currently, I have it set to work in Azure, and set a specific start page, which is functional, but not exactly the same thing. I was wondering if there was a way to have both environments work without some kind of publish transform?
I am aware you can set the default document from the Azure General settings as well, but I would like to have it work locally.
Contributor
3710 Points
1043 Posts
Re: DefaultDocument not working locally
Aug 02, 2019 07:27 AM|Yongqing Yu|LINK
Hi Rstan,
According to your description, could you tell us where your project stay?
Azure web app? or Azure Virtual machine?
Different places need to consider different directions to explore this issue.
Best Regards,
YongQing.
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
None
0 Points
2 Posts
Re: DefaultDocument not working locally
Aug 02, 2019 12:01 PM|Rstan122|LINK
Hello,
It is an Azure Web App. I believe it is specifically called an Azure "App Service" within the resource group.
Contributor
3710 Points
1043 Posts
Re: DefaultDocument not working locally
Aug 06, 2019 05:53 AM|Yongqing Yu|LINK
Hi Rstan,
Based on your description, I recommend that you make transformation in web.config which contains Web.Debug.config and Web.Release.config files.
You can select the index page in your current root directory as the default document in one of the config files (like Web.Debug.config) in the local test environment.
Then add the correct default document path to another config (like Web.Release.config ) and select this config type for publication.
Here is a tutorial about this way : Web.config Transformation Syntax for Web Application Project Deployment
Best Regards,
YongQing.
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.