When I publish my intranet site - the web.config is not updating. I made a change the live web.config and then publish my site it over rights the live web.config (When I exclude web.config from the Project and publish) . I am not sure why.
If I include web.config and try to publish I get the following error and it will not publish:
Warning The file 'Web.config' could not be added to the project. Cannot add a link to the file C:\Intranet\Web.config. This file is within the project directory tree. Intranet
Build Action: Content
Copy to Output Directory: Copy Always
Under Web.config in the Solution ExporerI have Web.Debug.config and Web.Release.config
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
29 Points
127 Posts
Publish web.config - Get error
Feb 14, 2020 02:53 PM|Baze72|LINK
When I publish my intranet site - the web.config is not updating. I made a change the live web.config and then publish my site it over rights the live web.config (When I exclude web.config from the Project and publish) . I am not sure why.
If I include web.config and try to publish I get the following error and it will not publish:
Warning The file 'Web.config' could not be added to the project. Cannot add a link to the file C:\Intranet\Web.config. This file is within the project directory tree. Intranet
Build Action: Content
Copy to Output Directory: Copy Always
Under Web.config in the Solution ExporerI have Web.Debug.config and Web.Release.config
Any ideas?
Thanks!
Participant
1320 Points
491 Posts
Re: Publish web.config - Get error
Feb 17, 2020 08:46 AM|jiadongm|LINK
Hi Baze72,
Edit your .csproj file, remove the duplicate Compile lines.
You can refer to the below link:
https://stackoverflow.com/a/15907942/11965297
Best Regards,
Jiadong Meng