# Resolving SetEnv error and unopenable source files while using Visual Studio in UE 5.7

**URL:** <https://forums.unrealengine.com/t/resolving-setenv-error-and-unopenable-source-files-while-using-visual-studio-in-ue-5-7/2682237>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, crash, question, CPP\
**Created:** [December 5, 2025, 5:54am UTC](https://forums.unrealengine.com/t/resolving-setenv-error-and-unopenable-source-files-while-using-visual-studio-in-ue-5-7/2682237 "2025-12-05T05:54:29Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![BRGEzedeRocco](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/brgezederocco/32/1216890_2.png) [@BRGEzedeRocco](https://forums.unrealengine.com/u/BRGEzedeRocco)\
**Post date:** [December 5, 2025, 7:13pm UTC](https://forums.unrealengine.com/t/resolving-setenv-error-and-unopenable-source-files-while-using-visual-studio-in-ue-5-7/2682237/2 "2025-12-05T19:13:50Z")

</div>

Hi @Seanny_D ,Welcome to the forum!  
Great to see you jumping into the world of Unreal!

I did some searching and found a few posts where other users reported the same error you’re getting ( **MSB4018 SetEnv task failed unexpectedly** ), along with some potential solutions that worked for them.

> [@The "SetEnv" task failed unexpectedly](https://forums.unrealengine.com/t/the-setenv-task-failed-unexpectedly/2675115/10):
>
> I recently encountered the same error while building my project from Visual Studio: After some investigation, I noticed that the Unreal Engine Integration Configuration inside Visual Studio now exposes a setting called Max Include Paths Length (chars). This setting corresponds to the MaxSharedIncludePaths field inside BuildConfiguration.xml (located under UnrealBuildTool/BuildConfiguration, as shown in the screenshot blow). [IMG-20251118-3] Solution: I r…

> [@Unreal Engine 4.25 source code compile error](https://forums.unrealengine.com/t/unreal-engine-4-25-source-code-compile-error/141849/2):
>
> Solved. Simply deleted the paths to the inclusions, since there were strange paths in them.

I’m also sharing some official documentation that can help you get a better grasp of how to apply your C++ knowledge inside Unreal Engine.  
[https://dev.epicgames.com/documentation/en-us/unreal-engine/coding-in-unreal-engine-blueprint-vs-cplusplus?application\_version=5.5](https://dev.epicgames.com/documentation/en-us/unreal-engine/coding-in-unreal-engine-blueprint-vs-cplusplus?application_version=5.5)

> **[Programming with C++ in Unreal Engine | Unreal Engine 5.7 Documentation |...](https://dev.epicgames.com/documentation/en-us/unreal-engine/programming-with-cplusplus-in-unreal-engine)**
>
> Information for programmers developing with Unreal Engine.

There’s also a Learning site with tutorials that could help guide you as well.

> **[Epic Developer Community Learning | Tutorials, Courses, Demos & More –...](https://dev.epicgames.com/community/unreal-engine/learning)**
>
> Epic Developer Community Learning offers tutorials, courses, demos, and more created by Epic Games and the developer community.Learn UE and start creating today.

If you have any questions, don’t hesitate to ask here in the forum , there’s always someone willing to give you a hand with whatever you need!

Hope it helps and happy coding!

---

_[View the full topic](https://forums.unrealengine.com/t/resolving-setenv-error-and-unopenable-source-files-while-using-visual-studio-in-ue-5-7/2682237)._
