Log in to reply
 

Visual Studio Cannot build error pls help



  • So when i try to build my script its say:

    1>------ Build started: Project: TEST 1, Configuration: Debug Any CPU ------
    1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3274: The primary reference "ScriptHookVDotNet2" could not be resolved because it was built against the ".NETFramework,Version=v4.8" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.7.2".
    1>C:\Users\stefa\source\repos\TEST 1\TEST 1\Class1.cs(8,7,8,10): error CS0246: The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)
    1>C:\Users\stefa\source\repos\TEST 1\TEST 1\Class1.cs(9,7,9,10): error CS0246: The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)
    1>C:\Users\stefa\source\repos\TEST 1\TEST 1\Class1.cs(10,7,10,10): error CS0246: The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)
    1>C:\Users\stefa\source\repos\TEST 1\TEST 1\Class1.cs(11,7,11,10): error CS0246: The type or namespace name 'GTA' could not be found (are you missing a using directive or an assembly reference?)
    1>C:\Users\stefa\source\repos\TEST 1\TEST 1\Class1.cs(14,27,14,33): error CS0246: The type or namespace name 'Script' could not be found (are you missing a using directive or an assembly reference?)
    1>C:\Users\stefa\source\repos\TEST 1\TEST 1\Class1.cs(16,16,16,19): error CS0246: The type or namespace name 'Ped' could not be found (are you missing a using directive or an assembly reference?)
    1>C:\Users...\source\repos\TEST 1\TEST 1\Class1.cs(17,16,17,23): error CS0246: The type or namespace name 'Vehicle' could not be found (are you missing a using directive or an assembly reference?)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    My References are:

    scriptHookvdotnet2.dll
    System.Windows.Forms
    System.Drawing



  • did you find out...im facing the same problem ?



  • Are you adding the scripthookVdotnet classes at the top?

    using GTA;
    using GTA.Native;
    using GTA.Math;



  • I did use those. I just saved it and changed the name into .cs and it worked i just cant build it



  • Yea guys, someone really helped me, so what you need to do is to choose the 4.8 .Netframework when ur starting your project, if you already started one and don't wanna lose, than you go to Project - > Properties - > Target Framework and choose 4.8, if you don't have you will need to install it :) I hope it fixes your problems!


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.