[solved] C# visual studio errors

Hi all,

After making a few scripts using lua, I wanted to swtich to c# using Visual Studio 2017 (which I use to developp Unity programs at work).
I added all the dependencies from the \citizen\clr2\lib\mono\4.5 folder but I still get errors saying that “System.String” or “System.Void” are either not defined or not imported. I think there’s a conflit with my mscorlib.dll but I don’t find a solution anywhere.

Any help would be appreciated !

Quentin

You should only have to add CitizenFX.Core.dll if you don’t mind accidentally using unavailable types, however setting NoStdLib in the .csproj and adding each of the assemblies should work too - did you make sure to remove the standard corlib reference?

First of all, thanks for your answer.

I tried to add True in my csproj but I still have a conflict between mscor.lib v5.0 and v4.0. In VS2017 (same for Sytem and Sytem.core), the Do not reference mscorlib.dll property is hidden, I can’t find it…

EDIT : Okay, now I added the three files from my FiveM folder but I have plenty of errors saying that some types like ‘AssemblyTitleAttribute’ exist in System.Runtime and mscorlib.dll or that predefined type ‘System.String’ is not defined or imported.

Did you accidentally make a ‘.NET Core’ project, and not a regular .NET project?

Add <NoStdLib>true</NoStdLib> to your .csproj’s PropertyGroup by hand, it does the exact same.

Oh god. Thanks Microsoft haha. I didn’t see I had the choice between .NET Standard and .NET Framework. That might explain that.

About the corlib ref, that’s indeed what I did

Thank you very much !