Error compiling C ++ in editor

I created a project in C ++ and added it to visual studio and recompile it right there, but when I opened the project again I tried to compile by the ue4 editor and gave this error:

ERROR: Couldn’t find target rules file for target ‘MyProject33’ in rules assembly ‘UE4Rules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’.
Location: C:\Program Files\Epic Games\UE_4.17\Engine\Intermediate\Build\BuildRules\UE4Rules.dll
Target rules found:
UE4Editor - C:\Program Files\Epic Games\UE_4.17\Engine\Source\UE4Editor.Target.cs
UE4Game - C:\Program Files\Epic Games\UE_4.17\Engine\Source\UE4Game.Target.cs
UnrealHeaderTool - C:\Program Files\Epic Games\UE_4.17\Engine\Source\Programs\UnrealHeaderTool\UnrealHeaderTool.Target.cs

Also I tried to create a new project in c ++ and without adding to visual studio and trying to compile by the editor but it gives the same error always and in both projects I can not create a C ++ class

When you mention you “I created a project in C ++ and added it to visual studio and recompile it right there”. Do you mean you created a basic code project in the engine under the C++ tab?

If you did, have you tired opening the Editor and clicking " File → Refresh visual studio projects"?

If you didn’t, I would recommend backing up your C++ classes that you created and then generating a new Visual Studio Project. This can be done by navigating to the project directory from your OS’s file browser. You’ll see round blue icon, with the white letter “U”, representing thee Unreal Engine, inside that folder. The type should read “Unreal Engine Project File.”. Right-click on that icon, then left-click the “Generate Visual Studio Files” option. (This might be possible in the editor as well I don’t recall).

From there try to build the project without your C++ classes, and if it works, then add your C++ classes that you defined.

I hope that helps!

Yes, I’ve tried but it does not work,I’ve actually uninstalled unreal 4.17 and epic games and all subfolders of% appdata% documents and x86 program files and program files from both and downloaded the Epic Games installer again, then installed Unreal Engine 4.18.3 and I added my project to the documents folder again so when I opened it it asked to compile and recompile, I clicked on yes for both and it opened my project correctly but still giving the same error to add C ++ class, compile C ++ code inside the unreal engine and create projects of the category C ++, then the problem would not be in the case my project and yes my pc that could miss files DLL rules in system 32, but I reinstalled everything, I do not want to format my pc.

Ah this is unforntune.

Are your projects being creating in the default location? I Noticed someone with a similar problem on here, have you tired the answer found here