Reputation: 93
Its a simple Hello World Web application. It works fine when i run with an Agent where Visual Studio is not installed. But if i run build with another agent where Visual Studio 2017 is installed, it starts giving this error. To check, i installed VS2017 where Build was working perfectly fine, after VS2017 installation, it started giving this error. Not able to find what could be the issue.
Error:
Exception calling "Invoke" with "2" argument(s): "The type initializer for 'Microsoft.Build.Shared.FrameworkLocationHelper' threw an exception."
Any help?
It is working fine, if i uninstall VS 2017 and install VS 2013 or 2015. Thanks Sameer
Upvotes: 1
Views: 461
Reputation: 51093
Suggest you give a test with local build through VS2017.
Guess the issue maybe you are creating the application through old VS version. And the build server haven't detect the right VS version.
For the error info xxx\MSBuildHelpers\vswhere.exe
. Because that is not a VS path. MSBuild was located under Visual Studio starting with 2017. It was in the same place under %ProgramFiles(x86)%\MSBuild before that. There are other ways to find MSBuild prior to 2017 that are outside the scope and purpose of vswhere.
If the build is successful locally with VS2017, suggest you reconfigure or reinstall the TFS build agents. The build agent will not detect the environment changes after you installed it. It will only detect during the installation. You could also try to manually add some capabilities in Settings- Agent Queues- Agent Pool - Agent- Capabilities. After this trigger the build again.
Upvotes: 1