Is there any way to determine if the developer pack is installed or the runtime version alone is present in the server?
When I check the registry, I can see that .Net 4.7.2 is present in the system but while building the pipeline, I receive the following error.
That error means that your build agent does not have .NET 4.7.2 SDK and Targeting Pack.
Since the .NET Framework 4.7, Microsoft has combined the SDK and targeting pack into one "Developer Pack".
The official landing page to get these Developer Pack (including previous version of .NET Framework before 4.7), is this: https://dotnet.microsoft.com/download/visual-studio-sdks
Before installing these Developer Pack, you must ensure that the machine that host your build agents must have the .NET Framework related runtime installed. For example, the .NET 4.7.2 Developer Pack requires .NET Framework 4.7.2 runtime installed before.
On some later Windows releases, you have to pay attention that minimum .NET Framework runtime version will always be in sync with the Windows used. This fact may save you some time for checking the available .NET Framework runtime installed.
For example, Windows Server 2019 has already .NET Framework 4.7.2 runtime installed. This is the official complete list of available versions of .NET Framework, please visit: https://learn.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed