visual studio 2017 stuck building ue4

Hmm I cloned the “release” branch. Maybe i should try master.

OK I deleted my repo for “release”, cloned “master” and ran Setup.bat and then GenerateProjectFiles.bat, and I got the exact same error. It still expects 4.6.2, which is not possible for me to install (I did try uninstalling ALL versions and running GenerateProjectFiles before running the exe to install 4.6.2 and it still said I already had it or a newer installed. Doesn’t make sense)

What else can I do?

@anonymous_user_f5a50610, you know the engine really well. What do you think is going wrong here?

In the VS Installer, under the .NET Desktop Development Section, have you tried selecting the 4.7.2 .NET Framework development tools? I pick that one because that is the version running on my system and the compiler works.

It may not be 4.6.2 but perhaps because it is a subsequent version, it might work. I’m shooting in the dark here but I don’t see how it can cause any harm…

If this works, I will let you know where to send the case of beer…

If it works I just might send you something nice :slight_smile:

Here’s how my screen looks just before I hit the “Modify” button:

Sadly, it looks very familiar when I run GenerateProjectFiles.bat afterward:

286015-462failevenafterinstall472.jpg

It says “or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed.” Maybe I could do that if I knew how.

Brutal…

If you’re ready to live dangerously:

I pulled this from the following comment:

Hey,
I had this issue and could not work it out, it turns out it's a bit of a pain. You've got to go the file that the error lists right at the end, in this case UnrealBuildTool.csproj, open it in VS, and then go to the properties and change it's target to the correct dot net framework. You'll have to do this twice, there's a second file that needs to be changed too (once you fix the first one the error will guide you to the second .csproj file needed to be changed.) After this it should work correctly, the issue wasn't that the dot net framework wasn't installed, but that the unreal source is pointing to ".NETFramework,Version=v4.5" instead of ".NETFramework 4.5" the string value is incorrect, not entirely sure how this got published, but sure. 

[AnswerHub Retargeting Suggestion][2]

If you peek into the CSPROJ file suggested, I see this:

Hi mightyenigma,
I don’t know if it’s something you’ve overlooked during a VS re-install or something, but you need to have “Desktop development with C++” selected in the VS installer “workloads”.

Your screenshot shows this unselected.

You also need to select “Game development with C++” (scroll down in the workloads section)

I think the .Net version error is a red herring caused by these 2 workloads not being installed.
HTH

That is correct - it is first step in setting up VS2017 for Unreal:

Before Setting-up your Unreal Engine-to-Visual Studio Workflow

In Visual Studio 2017 (VS2017), support for C++ is now part of optional workloads that aren’t installed by default. For detailed instructions on adding C++ tools to your existing Visual Studio installation, see Install C++ support in Visual Studio on the Microsoft support page. If you have not yet installed Visual Studio or the Unreal Engine, see the Options for a New Visual Studio Installation section on this page.

Looks like you missed it in the reinstall since I can see it was selected in your original screenshot post.

Cool. I’ll try that before “living dangerously” :slight_smile: I got the Game dev one turned on but I left the other one off since I didn’t see it in the Unreal VS startup guide and I’m trying to narrow down what I did wrong.

It is in the guide - in the “Before Setting-up your Unreal Engine-to-Visual Studio Workflow” but you have to following the link in the highlighted area. A bit subtle if you ask me.

Okay I’m trying it now. Hopefully that 4.6 includes 4.6.2 targeting:

Result is still:

286097-ohpoo.jpg

So, when I downloaded the 4.6.2 standalone installer from Microsoft, I got the runtime one, not the developer pack. I think that’s why it wasn’t letting me install - I had a newer runtime pack but I guess GenerateProjectFiles.bat needs the dev pack.

So I got the dev pack here: Download .NET Framework 4.6.2 Developer Pack Offline Installer

and re-ran GenerateProjectFiles.bat – and it worked!

Still doesn’t show 4.6.2 in my vs installer but the standalone thing worked.

Thank you all for all your help. I think I found my own answer, but I need to give you as many Karma pts possible. Will thumbs-ups give karma?

But wait a minute - this started out as a problem building the engine. I still need to see if THAT’s resolved.

So, when I go into ue4.sln then should I build or rebuild all, and should I do it to the ue4 solution, or just the engine folder, or do the other folders first?

Should work now.

I think it depends on what you have done since you last did a clean clone->setup->generateproject files.

You should at least run setup and generateprojectfiles once before you try to compile (to get everything re-synched)

I would just double click on ue4.sln to open it in Visual Studio
Set it as the startup project as described in the UE VS instructions
Then run it (green triangle).

Let the UnrealBuildTool figure out what it needs to rebuild on its own.