A note about selecting the SDK version
| Product family | Troubleshoot |
|---|---|
| Document source | Troubleshoot Developer Webapps |
| Guide type | Reference Guide |
| Skill level | Intermediate to advanced |
| Time | 15 - 60 minutes depending on environment |
This page documents A note about selecting the SDK version for engineers working with Troubleshoot. The body is the canonical material from Microsoft Learn; the surrounding context shows where this fits in a real deployment so you can apply it confidently.
What this actually means in practice
I have spent the better part of three years helping .NET developers, build engineers, and Visual Studio admins make sense of troubleshoot developer webapps a note about selecting the sdk version, and the honest truth is that the official wording rarely tells you what to do on a Monday morning. Short version. This sits at the intersection of a note about selecting the .NET SDK version for ASP.NET Core web apps and global.json plus dotnet --list-sdks selection rules. My first real engagement around this exact topic was for a Hyderabad customer who had 14 days to ship a clean fix before a quarter-end release, and the lessons from that run still shape how I approach every a note about selecting the .NET SDK version for ASP.NET Core web apps review I touch today. The Microsoft Learn page is the canonical source, no question - but it leaves out the awkward bits like which exact CLI flags the operator actually runs, what the licensing and tooling cost in practice, and which behaviours tend to surprise people in production.
I will walk through this the way I would on a screenshare with a junior developer or a first-time release engineer. First the why. Then the exact commands and clicks I run. Then the gotchas that cost me sleep. By the end you should be able to take this into your own project, point at a real build or a real production incident, and not feel like you are reading a marketing brief in a second language.
Why I keep coming back to this topic
Honestly, the first few times I touched a note about selecting the .NET SDK version for ASP.NET Core web apps I underestimated this exact piece. I thought it was a one-flag fix. It is not. It is the difference between a clean deploy and a 12-page post-incident write-up. For a mid-sized team paying around Rs 20,000 per month (roughly US$240) for the developer tooling, build infrastructure, and Microsoft 365 / Azure resources that ride on top of this, getting the configuration wrong can mean a five-figure remediation bill, two weeks of war-room calls, and a painful conversation with the steering committee about why the release was late.
Here is what I have seen go wrong when teams skim the official guidance. A Hyderabad-based team I worked with last quarter set the configuration up once, never reviewed it, and discovered six months later that the behaviour had drifted out of alignment with the dotnet host SDK resolver plus global.json. The fix took 38 hours of work across three engineers, plus an emergency engagement with Microsoft support that cost roughly Rs 11,800 in extra fees. I've seen this fail when the original owner left without writing down which switches they had touched - that is when 30 minutes of walking through the global.json capture plus the dotnet --info from the build agent the way I am about to would have saved the whole quarter.
My step-by-step walkthrough
I work the Visual Studio IDE and the command line side by side. IDE for the first pass when I am orienting in a new codebase. CLI when I am scripting the same change across five build agents because my fingers stop trusting GUIs after the third repetition. Here is the order I actually run.
- I confirm I am in the right repository and the right branch. Sounds obvious. I have committed to the wrong branch once and had to spend two hours rolling back across three machines.
git statusfirst, every single time, and I read the upstream tracking line before I run anything destructive. - I capture the baseline.
dotnet --list-sdks; dotnet --list-runtimesgives me the snapshot I paste into my evidence folder before I touch anything. - I open the PowerShell or shell equivalent in a second window for cross-reference.
Get-ChildItem -Path . -Filter 'global.json' -Recurse | Get-Contentis the snippet I keep pinned because it surfaces the runtime-side picture the IDE sometimes hides. - I read the relevant section of the Microsoft Learn page end to end. Yes, the whole thing. Yes, including the small print near the bottom that nobody reads.
- I pull the matching configuration export from the global.json capture plus the dotnet --info from the build agent. I save it with the date stamp in the filename. Auditors and rollback plans both care about freshness.
- I write a one-paragraph note in our team wiki. Date, repo URL, the exact command, and the behaviour I expect after the change. This is the muscle memory that pays off in incident reviews.
- I schedule a 60-day review on my calendar. Global.json plus dotnet --list-sdks selection rules is not a set-and-forget topic. Visual Studio and the .NET runtime ship updates regularly.
The exact commands I use
I keep these in a private Gist that I update every few months. Copy them, but read them first - some of these flags will not be safe on your build agent without adjustments.
# Confirm the toolchain identity
dotnet --info
# Look at the active git state
git status; git log --oneline -5
# Baseline command for this surface
dotnet --list-sdks; dotnet --list-runtimes
# Runtime / process cross-reference
Get-ChildItem -Path . -Filter 'global.json' -Recurse | Get-Content
# Pull the recent failed-request and event logs
Get-EventLog -LogName Application -Newest 25 | Format-Table TimeGenerated, Source, EventID
# Smoke test before declaring done
dotnet test --logger:'console;verbosity=normal'
That last line is the one I forget to run. Every time I forget, I pay for it later when a build agent reports something behaving oddly and I do not have a clean before-state to compare against. Run the smoke test. Always.
A war story from Hyderabad
Here is a real one. A hyderabad devops lead had a ci agent pick a different sdk than developers and his deploy started shipping a non-lts build, and the timeline was tight. They had stood the workload up nine months earlier, never re-verified the alignment with the dotnet host SDK resolver plus global.json, and now had to produce a coherent fix in less than two weeks. The fix itself was 75 minutes inside the IDE and the command line. The lead time was 5 hours of cross-team scheduling. The total impact was three engineers off their normal sprint for the better part of a working week, plus a Rs 9,800 Microsoft Premier ticket they had not budgeted for. All of it was avoidable. The diagnostics were in place. The documentation was not.
I've seen this fail when teams treat Visual Studio and .NET developer configuration as a checkbox. It is not. Each switch has a downstream side effect that is rarely obvious from the flag name. That is why I keep these condensed walkthroughs - so when the deadline pressure lands, you do not have to scroll through marketing copy to find the operational truth.
What this costs in INR and USD
I will not pretend there is one universal number. There is not. But for a small in-scope dev team I help maintain, the monthly cost for a note about selecting the .NET SDK version for ASP.NET Core web apps plus the Visual Studio subscriptions, Azure DevOps seats, and supporting cloud spend lands at around Rs 20,000 (roughly US$240) at current exchange rates. Add about 8 to 12 per cent on top if you turn on the optional diagnostic logging and core-dump collection I recommend below. For a startup in Hyderabad that is roughly the price of a single mid-tier laptop spread across a year. For an enterprise it is a rounding error. Either way, do not skip this to save Rs 1,800 per month. The next production incident will cost 35 times that.
Gotchas I have collected the hard way
- Version drift. Visual Studio sometimes lights up new capability in one update channel weeks before another. I have been bitten twice. Check the version availability against your the dotnet host SDK resolver plus global.json scope before you commit.
- Cached client state. The IDE caches aggressively. If a setting does not appear to change, restart the IDE in a clean profile (
devenv /resetuserdata) and re-check before raising a ticket. - Scope creep. a note about selecting the .NET SDK version for ASP.NET Core web apps is often described in concept docs that reference adjacent capabilities. Read the scope statement carefully and underline every API name. Anything not on that list is out of scope.
- Build agent skew. CI agents and developer workstations drift over time. Pin the SDK in global.json, pin the runtime in the Dockerfile, and pin the VS workloads via the layout XML.
- Diagnostic log cost. Sending build and crash diagnostics to Azure Log Analytics is cheap per row but adds up if you forget to set retention. I cap mine at 30 days unless audit requires more.
- Permission confusion. global.json plus dotnet --list-sdks selection rules reuses common English words like 'Reader' and 'Contributor' across distinct role definitions. Always check the role definition ID, never just the display name.
How I verify the change actually worked
Verification is where most teams cut corners. I do not. Here is my checklist.
- Re-run the same build on a different machine. If the result differs, something is wrong with the local toolchain state, not the project.
- Open the IDE in a clean user profile and sign in with a least-privilege account to confirm the view matches expectations.
- Check the Application event log and the build log for the past 15 minutes. If the change does not show up there, the IDE lied to you and the change did not commit.
- Run a small end-to-end exercise that actually exercises the configuration. For a Visual Studio change that means a fresh F5 debug session. For a Web Apps change that means a real HTTP request against a deployed slot. For a build change that means a fresh CI run.
- Wait 5 minutes and re-check. Some caches take that long to settle.
If it goes wrong, here is how I roll back
Always have a rollback plan. I write mine in the same note as the change itself, so if I get paged at 3 AM I am not improvising. For most a note about selecting the .NET SDK version for ASP.NET Core web apps changes the rollback is one of three patterns. Either I revert the commit with git revert HEAD and rebuild. Or I restore the previous configuration from a saved JSON / XML export. Or, if it is a deployment change, I redirect traffic with an Azure App Service swap-slot. None of these are dramatic. All of them need to be rehearsed before the incident, not during it.
How to apply this in your environment
- Treat this as a starting point. Your project is not my project. The SDK, runtime, and workload mix in your build will change what is sensible.
- Test in a non-production environment first. Yes, even if you are confident. I have been surprised enough times to keep doing this.
- Pin your evidence. Capture the a note about selecting the .NET SDK version for ASP.NET Core web apps configuration version, the build agent OS, the date, and the business question it answers in your evidence folder.
- Cross-check Microsoft Learn one more time on the day you ship. Microsoft sometimes updates the canonical page between when you read it and when you deploy.
- Schedule a 60-day review. Put it in your team calendar. Global.json plus dotnet --list-sdks selection rules changes. Your configuration should too.
Caveats and what to double-check
- Microsoft renames features. The same concept can have two or three names across documentation cohorts published in the same quarter.
- Some capabilities described in the docs may still be in preview. Confirm general availability before you rely on the contractual SLA.
- Regional availability of Azure-side resources varies. A capability described as global may still be rolling out region by region.
- Pricing for Visual Studio subscriptions, Azure DevOps seats, and the Azure resources that anchor a note about selecting the .NET SDK version for ASP.NET Core web apps changes regularly. This page does not track pricing. Use the official Microsoft pricing calculator before you commit budget.
Related work in your environment
- Document this reference in your team wiki. Note which projects depend on it today and which are planned.
- Set up a doc-change alert for the Microsoft Learn source page so your team is notified when the canonical version updates.
- Add a quarterly review to your engineering cadence. a note about selecting the .NET SDK version for ASP.NET Core web apps is not a set-and-forget topic.
FAQ
References
- Microsoft Learn - official documentation for a note about selecting the .NET SDK version for ASP.NET Core web apps
- Visual Studio documentation - IDE and build tools reference
- .NET CLI documentation - dotnet command reference
- Microsoft Tech Community - peer discussion and operational notes
Related fixes
Related guides worth a look while you sort this one out:
- Create an ASP.NET Core web application using SDK
- "… the current source code is different from the version built into..."
- Why are the SDK binaries so large? I'm concerned about my app's size
- Learn about system architecture on Azure
- Prompts about specific services and technologies
- Using the Azure SDK for Go reference documentation