As suggested in comments by SurferOnWww, the rewrite module looks to be a rather nice solution (and is one I use, and in fact I use it to force all URL's on the site to ALWAYS use HTTPS.
Thus, the choice, the settings, and the re-write rules are NOT part of Visual Studio 2010, or even the 2022 (so version of Visual Studio does not matter).
What will matter then is the version of IIS your using/deploying to. The re-write module can be found here:
https://iis-umbraco.azurewebsites.net/downloads/microsoft/url-rewrite
So, a rule to rewrite (force) the site to always use https, then you could have this rule:
<system.webServer>
<rewrite xdt:Transform="Insert">
<rules>
<rule name="SSLJUMP" stopProcessing="true" >
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" />
</rule>
</rules>
</rewrite>
</system.webServer>
Do note that after you install the re-write module, then from IIS manager, you should see a new option that allows editing, and creating rules from a nice GUI like this:
So, in the URL Rewrite, then I entered this:
After doing the above, then the web.config changes above was the result.
Note that I ONLY use/place/have/enjoy the URL writing rules on the production server, since in most cases, one not going to have a valid security certificate during development. So, I ONLY suggest that you use URL rewriting module on the production server, and not say with IIS express during development on your developer computer/setup.
So, the rewriting rules are setup in IIS, and not really to be setup in Visual Studio. As a result, then using vs2010, or vs2022 should not matter when using the above URL re-writing module.