The TFS build agent should be installed on a dedicated server. There are a several reasons for this.
- Performance:- A build may need a lot of resources to run (RAM and CPU, plus Disk space and IO) a build running may affect the performance of the rest of the server.
- Security:- Build agents often require a high level of permissions to work. If you have this running on the TFS server a script could do a lot of damage to the server, especially if the TFS database is on that server.
- Correctness:- Your laptop contains a bunch of stuff that you use for development and may not be available in production. Having a dedicated server allows you to validate the build in a "clean" environment.
- Scaleability:- Once you have a build server specified, adding additional build servers is easy and will allow you to run multiple types of build at the same time.
"No agent found in pool Default which satisfies the specified demands: msbuild visualstudio vstest Agent.Version -gtVersion 2.115.0"
This is likely because the tools required to build the software are not installed on the TFS server, this is similar to point 3 above. In order to compile the code and run unit tests a number of additional tools need to be installed on the same server as the build agent. Installing Visual Studio 2017 with the appropriate modules (WPF development) should solve this problem. You should not install these tools on the TFS server itself, but use a dedicated build server.