dotnet / dotnet/AspNetCore.Docs

web.config - difference between web site and web application projects in Visual Studio?

Open
#34,899 0 comments 0 reactions 1 assignee Claimed by @tdykstra View on GitHub
aspnet-core/svc hosting-deployment/subsvc Pri3 Source - Docs.ms
Dominant language
C#
Stars
13.1k
Forks
24.6k
Avg merge
1d 2h
Merged PRs (30d)
109

Description

### Description

As a reference, please see the StackOverflow question at:
[https://stackoverflow.com/questions/79485331/visual-studio-2022-asp-net-core-web-application-and-web-config-transformations](https://stackoverflow.com/questions/79485331/visual-studio-2022-asp-net-core-web-application-and-web-config-transformations)

The documentation page(s) regarding web.config transformations seem to imply that web.config transformations are **automatically** performed upon building a project. HOWEVER, **this is not the case** as there seem to be subtle differences in how **web site projects** and **web application projects** in ASP.NET Core transform the web.config file (if at all). This is very confusing as there is no "frame of reference" with regard to the project type.

In my experience, the only way to transform a web.config file for a **web application** is to include a task within the project file, for example:

```





```

Can clarification please be added with regard to the different project types (web project vs web application) and how web.config transformations should be handled properly for each (as this is a common real-world problem)?

I hope the feedback is useful.

Thanks-you in advance.

### Page URL

https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/web-config?view=aspnetcore-9.0

### Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/host-and-deploy/iis/web-config.md

### Document ID

f47ff3cc-cd78-d41c-af1c-ef1e752cae88

### Platform Id

9bb27c55-7125-fada-e89b-8d3f474aefdd

### Article author

@Rick-Anderson

### Metadata

* ID: 5945c30c-0dfb-040e-8bdc-a6c1f06c9931
* PlatformId: 9bb27c55-7125-fada-e89b-8d3f474aefdd
* Service: **aspnet-core**
* Sub-service: **hosting-deployment**

[Related Issues](https://github.com/dotnet/AspNetCore.Docs/issues?q=is%3Aissue+is%3Aopen+f47ff3cc-cd78-d41c-af1c-ef1e752cae88)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.