Hello @Egoitz Aurrekoetxea ,
Thank you for sharing the details of your project configuration.
Regarding your question about matching SDKs to specific Windows versions, Microsoft Windows SDKs are cumulative, meaning you typically do not need to hunt for an SDK that matches a specific OS. A common approach involves using a recent SDK and setting the _WIN32_WINNT and WINVER macros to your oldest intended platform. You can read more about this mechanism in the Update WINVER and _WIN32_WINNT documentation.
Furthermore, using the /MT flag is a way to statically link the C runtime and avoid installing Visual C++ Redistributables. As outlined in the /MD, /MT, /LD compiler options guide, this is a valid configuration for standalone utilities. However, it might be worth keeping in mind that you would need to manually recompile and redeploy your services if future security updates for the C runtime library are released.
Consequently, building separate executables for different operating systems is generally not required. The Win32 API natively preserves backward compatibility, so a single binary targeting Windows Server 2008 R2 APIs could normally run on Windows Server 2025, provided it does not call newly introduced APIs.
Additionally, if supporting an older system like Windows Server 2008 R2 remains a priority, keeping your current Visual Studio 2019 toolset (v142) might be advisable. Newer Visual Studio iterations slowly phase out structural support for older OS environments, making your current setup a reasonable baseline to stay with.
I hope this perspective, alongside the official reference materials, provides a helpful viewpoint for organizing your builds. If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation.
Thank you.