Log in to reply
 

Simple question- how do I compile a C# script into a .dll file?



  • I've downloaded Visual Studio, but can't figure out how to compile my C# mod (.cs) into a .dll file... Can anyone help?


  • MODERATOR

    @FelixTheBlackCat you can look up GTAV C# tutorials on YouTube for a visual explanation. Since you already have the .cs, you can create a new C# project (any template I guess, I'd go with Class Library), replace the code in the generated .cs with your own (or delete it and add your .cs through the Project tab -> Add Existing Item).

    Then right-click References -> Add References -> Browse -> Select the scripthookvdotnet.dll file and click Okay.

    Optionally, you can go to Project -> Properties -> Build Events -> Post-Build event command line and enter a directory that you would like to send a copy of the dll to, like so:

    COPY "$(TargetDir)$(TargetFileName)" "C:\Program Files\Rockstar Games\Grand Theft Auto V\scripts"

    Finally, you can go to the Build tab and click Build Solution or Build [Project name] to build the dll and have a copy of it sent to the directory you indicated above.


Log in to reply
 

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