I'm using Teamcity on premise for building dotnet project with dotnet core 3.1. Since we have multiple projects, we are using 3 agents for these build.
These days we are planning to migrate our applications from dotnet 3.1 to dotnet core 6. So, Now there are few applications on dotnet 3.1 and few on dotnet 6.
I'd like to know if there is any way we can have multiple dotnet version on a single agent and can specify it as part of the build configuration. For now, I have made one agent specific to dotnet6 and the other 2 works with dotnet3.1.
I have tried installing both the versions on my agent and specifying env.MSBuildSDKsPath in build configurations of the projects but it doesn't work.