What to install in Visual Studio?

Edit: Creating and running a new Flax 1.5 project works just fine. I couldn’t find any info about how to create and launch projects for specific engine versions. I can only set a default engine version. I have Flax 1.3, 1.4 and 1.5 installed.

I had to reinstall Windows and am struggling to get VS to cooperate with Flax again. I followed what info I could find in the documentation.

I have selected Visual Studio 2022 in the options as my Source code editor.

For now I installed the following components without a workload.

  • Microsoft Visual C++ Redistributable (latest)
  • Microsoft .NET Framework (latest)
  • Visual Studio 2022 Community (17.4.5)
    • Windows 10 SDK (10.0.20348.0)
    • MSVC v143 - VS 2022 C++ x64/x86 Buildtools (v14.34-17.4)
    • .Net Framework 4.8.1 Targeting Pack
    • C# and Visual Basic
    • C# and Visual Basic Roslyn-Compiler

Trying to “Recompile scripts” in Flax yields the following result:

[ 00:28:59.436 ]: [Info] Starting scripts compilation...
[ 00:28:59.436 ]: [Info] Command: "D:\Programme/Flax/Flax_1.3/Binaries/Tools/Flax.Build.exe" -log -logfile= -build -mutex -buildtargets=BasicTemplateEditorTarget -skiptargets=FlaxEditor -platform=Windows -arch=x64 -configuration=Development
[ 00:28:59.481 ]: [Info] Flax.Build 1.0.8096
[ 00:29:00.086 ]: [Info] Building targets...
[ 00:29:00.100 ]: [Info] Missing Android SDK. Cannot build for Android platform.
[ 00:29:00.103 ]: [Info] Missing Linux Toolchain. Cannot build for Linux platform.
[ 00:29:00.109 ]: [Info] Unknown Windows 10 SDK version 10.0.20348.0 at C:\Program Files (x86)\Windows Kits\10\
[ 00:29:00.124 ]: [Info] Missing Windows SDK. Cannot build for Windows platform.
[ 00:29:00.125 ]: [Info] Building C# only
Building target BasicTemplateEditorTarget in Development for Windows x64
[ 00:29:00.137 ]: [Info] Building referenced target Flax
[ 00:29:00.917 ]: [Info] Building for Windows without Vulkan rendering backend (Vulkan SDK is missing)
[ 00:29:01.638 ]: [Info] Found 2 valid and 0 invalid actions in Task Graph cache
[ 00:29:01.641 ]: [Info] Executing 1 task using 1 thread
[ 00:29:01.644 ]: [Info] Compiling C:\Users\Temp\Documents\Flax Projects\FlaxSamples\BasicTemplate\Binaries\BasicTemplateEditorTarget\Windows\x64\Development\BasicTemplate.CSharp.dll
[ 00:29:01.720 ]: [Info] C:\Users\Temp\Documents\Flax Projects\FlaxSamples\BasicTemplate\Source\BasicTemplate\VirtualThumbStick.cs(30,12,30,18): error CS0246: The type or namespace name 'Float2' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\Temp\Documents\Flax Projects\FlaxSamples\BasicTemplate\Source\BasicTemplate\VirtualThumbStick.cs(43,41,43,47): error CS0246: The type or namespace name 'Float2' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\Temp\Documents\Flax Projects\FlaxSamples\BasicTemplate\Source\BasicTemplate\VirtualThumbStick.cs(55,40,55,46): error CS0246: The type or namespace name 'Float2' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\Temp\Documents\Flax Projects\FlaxSamples\BasicTemplate\Source\BasicTemplate\VirtualThumbStick.cs(113,38,113,44): error CS0246: The type or namespace name 'Float2' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\Temp\Documents\Flax Projects\FlaxSamples\BasicTemplate\Source\BasicTemplate\VirtualThumbStick.cs(125,38,125,44): error CS0246: The type or namespace name 'Float2' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\Temp\Documents\Flax Projects\FlaxSamples\BasicTemplate\Source\BasicTemplate\VirtualThumbStick.cs(136,36,136,42): error CS0246: The type or namespace name 'Float2' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\Temp\Documents\Flax Projects\FlaxSamples\BasicTemplate\Source\BasicTemplate\VirtualThumbStick.cs(148,38,148,44): error CS0246: The type or namespace name 'Float2' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\Temp\Documents\Flax Projects\FlaxSamples\BasicTemplate\Source\BasicTemplate\VirtualThumbStick.cs(160,38,160,44): error CS0246: The type or namespace name 'Float2' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\Temp\Documents\Flax Projects\FlaxSamples\BasicTemplate\Source\BasicTemplate\VirtualThumbStick.cs(171,36,171,42): error CS0246: The type or namespace name 'Float2' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\Temp\Documents\Flax Projects\FlaxSamples\BasicTemplate\Source\BasicTemplate\VirtualThumbStick.cs(7,13,7,19): error CS0246: The type or namespace name 'Float2' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\Temp\Documents\Flax Projects\FlaxSamples\BasicTemplate\Source\BasicTemplate\VirtualThumbStick.cs(8,13,8,19): error CS0246: The type or namespace name 'Float2' could not be found (are you missing a using directive or an assembly reference?)
[ 00:29:01.724 ]: [Info] Task C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\Roslyn\csc.exe /noconfig /shared @"C:\Users\Temp\Documents\Flax Projects\FlaxSamples\BasicTemplate\Cache/Intermediate\BasicTemplateEditorTarget\Windows\x64\Development\BasicTemplate.CSharp.response" failed with exit code 1

1 task faile

When opening the solution in Visual Studio I have to update the .NET Framework from 4.5 to 4.8. Trying to Build the solution I get

Error CS0246 The type or namespace name 'FlaxEngine' could not be found (are you missing a using directive or an assembly reference?)

I’m trying to run a Flax 1.3.6228 project btw.

Any help would be welcome :sweat_smile:

1 Like

Did you try installing this plugin? not sure if that is the problem but it’s worth trying

1 Like

Thanks. Yes I installed it too, but it doesn’t help.

Since my 1.3 project is only for testing I think that I will let it die and migrate the content over to a fresh 1.5 project. Still annoying.

1 Like

Have you tried regenerating script project files? (menu File → Generate script project files) It looks like, for some reason the 1.3 version is used to build a project that uses the latest 1.5 version (eg. Float2 is type added in 1.4 update)

1 Like

I guess it’s not meant to build on VS2022. But I think the game should be played and built from Flax Engine editor. That’s what I do everyday on my own.
If that isn’t the case, I may have no more solutions on this. Only one clue :frowning:

1 Like