简体   繁体   中英

Git-Tfs error when running in powershell. "Retrieve LoaderExceptions"

I installed git-tfs using chocolatey on a Windows Server 2012 R2. When I try to check if git tfs installed correctly by typing "git tfs --version", I get the following error:

Unable to load one or more of the requested types. Retrieve LoaderExceptions for more information

I checked the log files that were created and this is what it shows:

[Debug] System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at GitTfs.Program.DoCustomConfiguration(CustomConfigurationExpression initializer)
at GitTfs.Program.Initialize(CustomConfigurationExpression initializer)
at StrucutreMap.Container..ctor(Action`1 action)
at GitTfs.Program.Main(String[] args)

I'd really like some help here. What am I missing here?

According to the document of the git-tfs, we need .NET 4.6.2 and the 2012 or 2013 version of Team Explorer installed (or Visual Studio) depending on the version of TFS you want to target.

There are some changes in the latest version( v0.32.0 ) of git-tfs:

  • Upgrade to .NET Framework 4.7.2 and upgrade NuGet dependencies
  • Add support for Visual Studio 2017. To use it set the environment variable GIT_TFS_CLIENT to 2017. Multiple versions of VS2017 installed side by side, either as different editions like VS2017 Enterprise and Premium or different VS2017 minor versions are not offically supported yet. The current implementation will simply use the first version found.
  • Add support for Visual Studio 2019. To use it set the environment variable GIT_TFS_CLIENT to 2019. The same restrictions as for VS2017 apply, eg multiple versions of VS2019 installed side by side, either as different editions like VS2019 Enterprise and Premium or different VS2019 minor versions are not offically supported yet. The current implementation will simply use the first version found.

We can try to reinstall .NET framework, Visual Studio 2019 and Git if we have any issues when installing git-tfs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM