error while generating project file can't load hostpolicy.dll library

Hi,
While trying to create a new project in C++ an error message pops (there is no issue with Blueprint).
Here is the error message :

An error occurred while trying to generate project files.

Running C:/Program Files/Epic Games/UE_5.1/Engine/Build/BatchFiles/Build.bat -projectfiles -project=“D:/FICHIERS 3D/UnrealEngine5/MyProject2/MyProject2.uproject” -game -rocket -progress
Running UnrealBuildTool: dotnet “…..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll” -projectfiles -project=“D:/FICHIERS 3D/UnrealEngine5/MyProject2/MyProject2.uproject” -game -rocket -progress
Failed to load the dll from [C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.12\hostpolicy.dll], HRESULT: 0x800700C1
An error occurred while loading required library hostpolicy.dll from [C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.12]

Does someone encounter the same issue or could help me to fix this?
thanks

I’ve finally make it work ! So in case someone faces the same problem, here is the solution :
you have to install the SDK version asked by UE5 (X64) and then follow the steps shown in this tutorial : UE5 Packaging error Fixed and hostfxr.dll, dotnet - Unreal Engine 5 - YouTube