C
C#2y ago
Elmishh

✅ please help idk what to do or what i did

Severity Code Description Project File Line Suppression State Error Project "C:{file directory}\Directory.Build.targets" was not imported by "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.targets" at (51,3), due to the file being invalid. ConsoleApp5 C:{file directory}\Directory.Build.targets 51
what did i do? what should i do its an error i cant code anything
20 Replies
Elmishh
ElmishhOP2y ago
im repairing visual studio ill be be back soon and check if it worked, or even finished it didnt someone help Severity Code Description Project File Line Suppression State Error MSB4024 The imported project file "C:{directory name}\Directory.Build.targets" could not be loaded. Root element is missing. ConsoleApp5 C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.targets 51
Angius
Angius2y ago
Delete bin and obj folders and rebuild the project?
Elmishh
ElmishhOP2y ago
wdym rebulding the project how do i do that
Angius
Angius2y ago
Just build the project Compile it
Elmishh
ElmishhOP2y ago
rebuild {projectname}?
Angius
Angius2y ago
?
Elmishh
ElmishhOP2y ago
Elmishh
ElmishhOP2y ago
that?
Angius
Angius2y ago
Yeah
Elmishh
ElmishhOP2y ago
did not work
Angius
Angius2y ago
Did you remove the bin and obj folders beforehand?
Elmishh
ElmishhOP2y ago
i now have BOTH errors yes this error is cross VS i cant run anything
Angius
Angius2y ago
Does it also happen when you use the CLI?
Elmishh
ElmishhOP2y ago
CLI?
Angius
Angius2y ago
Command Line Inteface dotnet build command for example Or dotnet run That's, of course, assuming your project uses modern version of .NET and not some ancient .NET Framework 4.6 or something
Elmishh
ElmishhOP2y ago
6.0 its a completely new project all projects are voided and cannot be run, even ones that i did before
Angius
Angius2y ago
CLI should work, then
Elmishh
ElmishhOP2y ago
same errors my Directory.Build.targets is empty for some reason anyone?
Pobiega
Pobiega2y ago
My google-fu suggests complete reinstall of the SDK but its certainly no guarantees. Might try repairing first
Elmishh
ElmishhOP2y ago
i repaired didnt work how do i reinstall the SDK? PLEASE SOMEONE HELP PLEASEEE fixed it deleted the file and it SOMEHOW worked if it works dont ask questions
Want results from more Discord servers?
Add your server