# Toolchain Error Generating Project Files for VS 2022 (UE 5.1)

**URL:** <https://forums.unrealengine.com/t/toolchain-error-generating-project-files-for-vs-2022-ue-5-1/750069>\
**Category:** C++\
**Tags:** UE-5, build, unreal-engine, build-failed, question\
**Created:** [January 15, 2023, 9:10pm UTC](https://forums.unrealengine.com/t/toolchain-error-generating-project-files-for-vs-2022-ue-5-1/750069 "2023-01-15T21:10:44Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![TheGoldenProof](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheGoldenProof](https://forums.unrealengine.com/u/TheGoldenProof)\
**Post date:** [January 17, 2023, 5:04am UTC](https://forums.unrealengine.com/t/toolchain-error-generating-project-files-for-vs-2022-ue-5-1/750069/3 "2023-01-17T05:04:14Z")

</div>

I found what was causing it and found a work around, but it feels like a bug and I’m not sure what the side effects of the work around might be.

The issue is that I don’t have any non-preview toolchains. I tried to install one that was non-preview, but they all said preview after I installed them.  
What was happening is this one line in the UnrealBuildTool source code in `Engine\Platforms\Hololens\Source\Programs\UnrealBuildTool\HoloLensProjectGenerator.cs` line 87:

```auto
DirectoryReference? PlatformWinMDLocation = HoloLensPlatform.GetCppCXMetadataLocation(Compiler, "Latest", WindowsArchitecture.x64, Logger);

```

The `"Latest"` argument does the same as using Latest for the CompilerVersion: it excludes preview toolchains. Because it was hardcoded, it would always fail if only preview toolchains are available.

So to “fix” it, I simply changed that `"Latest"` to `"Preview"`.

---

_[View the full topic](https://forums.unrealengine.com/t/toolchain-error-generating-project-files-for-vs-2022-ue-5-1/750069)._
