-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
publishing a web api (net 9) is not correct #45196
Comments
@drma-tech How are you creating that (web.config?) file? It looks like a rudimentary form of what you want, so I'm wondering if it's expected that you start with that and modify it as necessary to arrive at something more similar to what you provided. |
I don't even know anymore. It generated this way right after the first official version. And it stopped generating definitively when the first Visual Studio fix came out. |
Having looked around for a while, I believe that the logic that is intended to control this mostly lives here: It appears that that part takes a web.config and adds the parts that were successfully added. It does not, however, include the aspNetCore element or the location element. There's a template here that adds the location part but not the aspNetCore element; since it appears that TransformWebConfig is executing (hence the handler) but that location element isn't added, that suggests that projectWebConfigPath existed. I don't know how exactly that's added, but I think it's added through Microsoft.NET.Sdk.Publish.TransformFiles.targets via the web sdk:
That suggests that at some point, if you specify Sdk="Microsoft.NET.Sdk.Web" then build, it should find a web.config for you and modify it to have those elements...except your base version doesn't have the right elements? I suspect that there may be an extra file near your project file that's causing trouble, but I've gotten pretty far away from things I'm confident of. Hopefully someone who knows more about the web sdk can chime in 🙂 |
Is there an existing issue for this?
Describe the bug
when publishing an api to run on IIS, this file is generated
Expected Behavior
but it should be this one
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
9
Anything else?
No response
The text was updated successfully, but these errors were encountered: