anegostudios/vsmodtemplate

Missing dll file in release

Closed this issue · 1 comments

During the creation of my release, I encountered an issue where the release file only contained the following items:

  • assets/
  • modicon.png
  • modinfo.json

The DLL and other necessary files were missing from the release.

Solution:
To resolve this issue, I had to modify the "Package" task in the Program.cs file to include the following lines of code:

// Copy DLL and others
context.CopyFiles($"../{BuildContext.ProjectName}/bin/{context.BuildConfiguration}/Mods/mod/{context.Name}.dll",
    $"../Releases/{context.Name}/");

context.CopyFiles($"../{BuildContext.ProjectName}/bin/{context.BuildConfiguration}/Mods/mod/{context.Name}.deps.json",
    $"../Releases/{context.Name}/");

context.CopyFiles($"../{BuildContext.ProjectName}/bin/{context.BuildConfiguration}/Mods/mod/{context.Name}.pdb",
    $"../Releases/{context.Name}/");

These lines of code ensure that the DLL, dependencies JSON, and PDB files are copied to the release directory. After making these changes, the release file now contains all the necessary files.

Nevermind, while developing a new mod the template worked without issue. Not sure what was causing the problem that I had to use this ad-hoc fix.