-
Notifications
You must be signed in to change notification settings - Fork 10.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
Create new Web API using dotnet new webapi
with use-minimal-apis and use-program-main options set, you get a warning on build
#41491
Comments
Taking a look at the source it seems the Web API template isn't intended to support both At any rate, it seems odd now that those two options shouldn't be supported together (i.e. use a full |
- Updated test cases to cover more options combinations - Fixed route pattern typo in minimal APIs case - Added missing UseAuthorization call in minimal APIs + Windows Auth case - Fail template tests if a compiler warning is output on build or publish Fixes #41491
- Updated test cases to cover more options combinations - Fixed route pattern typo in minimal APIs case - Added missing UseAuthorization call in minimal APIs + Windows Auth case - Fail template tests if a compiler warning is output on build or publish - Fix Web API template when call graph option is true - Add arg constants & fix formatting Fixes #41491
- Updated test cases to cover more options combinations - Fixed route pattern typo in minimal APIs case - Added missing UseAuthorization call in minimal APIs + Windows Auth case - Fail template tests if a compiler warning is output on build or publish - Fix Web API template when call graph option is true - Add arg constants & fix formatting Fixes #41491
- Updated test cases to cover more options combinations - Fixed route pattern typo in minimal APIs case - Added missing UseAuthorization call in minimal APIs + Windows Auth case - Fail template tests if a compiler warning is output on build or publish - Fix Web API template when call graph option is true - Add arg constants & fix formatting Fixes #41491
* Fix templates sourceName * Support minimal APIs & program/main together in Web API template - Updated test cases to cover more options combinations - Fixed route pattern typo in minimal APIs case - Added missing UseAuthorization call in minimal APIs + Windows Auth case - Fail template tests if a compiler warning is output on build or publish - Fix Web API template when call graph option is true - Add arg constants & fix formatting Fixes #41491 * Clean-up from template fix port - Update template scripts to use correct package version when using locally - Update template-baselines.json to cover new template options * Update for VS compiler changes to nullability & u8 string literals * Template baselines test fix * Make template baseline test check namespaces match project name * Comment for clarity * Port extra template tests from main * Port template test change that fails if warnings present on build or publish * Use original file name in template baseline test * Fix single file exe test Now that we fail if "warning" appears in the command output, we have to be sure to now issue and dotnet CLI commands that result in SDK warnings (in this case the change in net6.0 that -r must be accompanied with --self-contained or --no-self-contained). * Comment out tenmplate baseline test namespace declaration * Comment out template warning checks * Apply test fixes from failures investigation * Set project name * Bump Helix test runner timeout to 60 mins * Collect test host dumps on Helix test runner crashes * Print message when test job times out Bump helix timeout to match main (45 mins) * Make helix runner print timestamps with console logs * Ported more test changes from main * Revert failing project test if new/build/publish emit restore errors or other warnings. * Fix typos * Port TestRunner.cs changes
Is there an existing issue for this?
Describe the bug
Create new Web API using
dotnet new webapi
with use-minimal-apis and use-program-main options set, you get a warning on build.This seems to be happening because it creates both a Program.Main.cs and a Program.cs.
Expected Behavior
No warnings or errors on build
Steps To Reproduce
INSTALL STEPS
REPRO STEPS
dotnet new
with use-minimal-apis and use-program-main options setdotnet build
Exceptions (if any)
No response
.NET Version
6.0.300
Anything else?
I'm also able to reproduce this with SDK 6.0.203.
The text was updated successfully, but these errors were encountered: