microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
192 stars 6 forks source link

Hot Reload not effective on .NET Web API template #1034

Open PeterDraex opened 1 month ago

PeterDraex commented 1 month ago

Type: Bug

  1. Run dotnet new webapi --use-controllers -o DebugHotReload to create a new project
  2. Open your File -> Preferences, make sure hot reload is enabled
  3. Open WeatherForecastController.cs, add new method:
        [HttpGet("TryThis")]
        public IActionResult TryThis()
        {
            return Ok("trythis");
        }
  4. Start debugging using F5, use default C# debugging config.
  5. Wait until the app starts. Open /WeatherForecast/TryThis in your browser
  6. You should see trythis.
  7. Change [HttpGet("TryThis")] to [HttpGet("TryThis2")] and rename the method to TryThis2.
  8. Open /WeatherForecast/TryThis2 in your browser
  9. EXPECTED is that you see trythis. ACTUAL result is a 404 error.

Posting this here, because it works as expected in Visual Studio 2022 preview.

Extension version: 1.5.8 VS Code version: Code - Insiders 1.88.0-insider (46b756b8434730593b3c911fd1ca43366b29eb03, 2024-03-28T10:54:31.414Z) OS version: Windows_NT x64 10.0.22631 Modes: Remote OS version: Linux x64 5.15.146.1-microsoft-standard-WSL2

System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (8 x 2803)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|31.73GB (8.82GB free)| |Process Argv|--crash-reporter-id 1c05e606-ec37-4823-bc38-c9bc58d9247a| |Screen Reader|yes| |VM|0%| |Item|Value| |---|---| |Remote|WSL: Ubuntu| |OS|Linux x64 5.15.146.1-microsoft-standard-WSL2| |CPUs|11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (8 x 2803)| |Memory (System)|15.49GB (12.95GB free)| |VM|0%|
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes627:30244334 vscod805cf:30301675 vsaa593:30376534 py29gd2263:30784851 c4g48928:30535728 a9j8j154:30646983 962ge761:30841072 pythongtdpath:30726887 welcomedialogc:30812479 pythonidxpt:30768918 pythonnoceb:30776497 asynctok:30898717 dsvsc013:30777762 dsvsc014:30777825 dsvsc015:30821418 pythontestfixt:30866404 pythonregdiag2:30926734 pyreplss1:30879911 pythonmypyd1:30859725 pythoncet0:30859736 h48ei257:31000450 pythontbext0:30879054 accentitlementst:30870582 dsvsc016:30879898 dsvsc017:30880771 dsvsc018:30880772 bf62j303:30968145 cppperfnew:30980852 8082a590:30961435 fegfb526:30952798 bg6jg535:30979844 ccp2r3:30958153 pythonait:30973460 gee8j676:30988845 gd77d436:30999572 ```