Compile Source into DLL

Discussion in 'General Discussion' started by LouisAlexandreP, Feb 19, 2018.

  1. LouisAlexandreP

    LouisAlexandreP Level 4

    Joined:
    Oct 7, 2013
    Messages:
    52
    I wish to compile an old source, but I just don't know how to turn it into a DLL?

    Any tutorial already existing on this forum?
     
  2. Zaicon

    Zaicon Spam Cleaner 9000
    TShock Mod Plugin Developer

    Joined:
    Feb 15, 2014
    Messages:
    811
    Hey there,

    I would greatly suggest using Google to learn a bit about developing with C# and Visual Studio.

    We have a guide to get you started on plugin development with tShock, but we don't have any guides on how to update old plugins.

    Feel free to ask for help if you have any specific questions about the process or get stuck, just don't be a help vampire!

    Thanks,
    Zaicon
     
  3. LouisAlexandreP

    LouisAlexandreP Level 4

    Joined:
    Oct 7, 2013
    Messages:
    52
    I actually already Used google , to look it up, however I am trying to update Autoboss+ and while I figured where to go to Tick the Tshock version or w/e people say I am now stuck in building "structure" references error however the reference are in the right folder and such so i took a break that's where i'm at now.
     
    #3 LouisAlexandreP, Feb 19, 2018
    Last edited: Feb 19, 2018
  4. Zaicon

    Zaicon Spam Cleaner 9000
    TShock Mod Plugin Developer

    Joined:
    Feb 15, 2014
    Messages:
    811
    If you're having issues with references, you should probably just delete the existing ones (that are marked as not found in Visual Studio) and re-add them according to the instructions in the tshock readme that I linked above.
     
    • Useful Useful x 1
  5. LouisAlexandreP

    LouisAlexandreP Level 4

    Joined:
    Oct 7, 2013
    Messages:
    52
    I haven't got around to read that, as I said im not into it, but i'll make sure to look it up before working or replying here.

    And thank you for your help
     
    • Friendly Friendly x 1
  6. LouisAlexandreP

    LouisAlexandreP Level 4

    Joined:
    Oct 7, 2013
    Messages:
    52
    So I've played with the error a bit, replaced the references but now the new errors are something about I'm using .NET 4.0 while these reference requires 4.5, I've had to load the whole source as .net 4.0 because Visual don't see I have an in-place 4.7.1 Framework for 4.5? and I can't install 4.5 because 4.7 is already installed. wdf do I do? is there settings i need to change there? or visual 2010 is crap now.

    Also I can't load the .sln that came with the source, because it was built with a newer version of Visual. so I'm running the csproj instead
     
  7. Zaicon

    Zaicon Spam Cleaner 9000
    TShock Mod Plugin Developer

    Joined:
    Feb 15, 2014
    Messages:
    811
    Yes, tShock runs with .NET Framework 4.5 at minimum, so you will have to reference that in your plugin.

    Visual Studio 2010 does not support 4.5 at all, so you will have to upgrade Visual Studio versions.

    However, you can, in fact, use anything higher than 4.5 (4.6.x, 4.7.x)... but you'll still need to upgrade Visual Studio.
     
  8. LouisAlexandreP

    LouisAlexandreP Level 4

    Joined:
    Oct 7, 2013
    Messages:
    52
    Anything free you'd recommend as a plugin developer?
     
  9. Zaicon

    Zaicon Spam Cleaner 9000
    TShock Mod Plugin Developer

    Joined:
    Feb 15, 2014
    Messages:
    811
    Visual Studio 2017 (Community Edition)
     
  10. LouisAlexandreP

    LouisAlexandreP Level 4

    Joined:
    Oct 7, 2013
    Messages:
    52
    Thank you for the help now I can properly Rebuild DLLs so that's an upgrade now, I got certain errors from the terraria server when loading the plugin, but I'd probably be better being able what cause those error from the Plugin itself? is there a way i can get the plugin errors and not the TerrariaAPI or server errors that the plugin causes?
     
    #10 LouisAlexandreP, Feb 20, 2018
    Last edited: Feb 20, 2018
  11. Zaicon

    Zaicon Spam Cleaner 9000
    TShock Mod Plugin Developer

    Joined:
    Feb 15, 2014
    Messages:
    811
    I'm honestly not entirely sure what you're talking about. If you could share some examples about what kind of errors you're getting, I might be able to help you better.

    I also invite you to join tShock's Discord server (invite link can be found on the front page of this website) where you can get more help and I'll be able to respond faster there.
     
  12. Dylanswaggerino

    Plugin Developer

    Joined:
    May 2, 2015
    Messages:
    55
    He probably gets errors cause he doesn't use new references. Atleast i think that might be the problem why he is causin errors
     
  13. LouisAlexandreP

    LouisAlexandreP Level 4

    Joined:
    Oct 7, 2013
    Messages:
    52
    that's actually what I thought of doing, I'll try that, also I've join the discord chat.
     
  14. Dylanswaggerino

    Plugin Developer

    Joined:
    May 2, 2015
    Messages:
    55
    You could actually try to delete the old references and add the newest version of it and change the Api Id to 2, 1
     
  15. LouisAlexandreP

    LouisAlexandreP Level 4

    Joined:
    Oct 7, 2013
    Messages:
    52
    I did change the API Id to 2,1 before when it lead to errors, I'm currently trying to add the new refs

    what's the ref to base? I had to add a "Terraria.exe" ref since there was none
     
  16. Dylanswaggerino

    Plugin Developer

    Joined:
    May 2, 2015
    Messages:
    55
    OPTAPI.DLL is the Terraria.exe
     
  17. LouisAlexandreP

    LouisAlexandreP Level 4

    Joined:
    Oct 7, 2013
    Messages:
    52
    yup figured that one, thanks tho
     
    • Like Like x 1
  18. Dylanswaggerino

    Plugin Developer

    Joined:
    May 2, 2015
    Messages:
    55
    Well you still gettin errors right now?

    so ye could you send an screenshot
     
  19. LouisAlexandreP

    LouisAlexandreP Level 4

    Joined:
    Oct 7, 2013
    Messages:
    52
    Some about the name Color not existing in the current Context and NPC not being a definition for name, but i think changing it to "FullName" might fix it idk, I'm not a coding expert but it's the Color part that's mind bogling me
     
  20. Dylanswaggerino

    Plugin Developer

    Joined:
    May 2, 2015
    Messages:
    55
    Just wonderin what plugin are you tryin to update?