SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

Mods built on windows are rewritten when running on windows, preventing debugging

danvolchek opened this issue ยท 1 comments

commented

Due to a recent SMAPI change to fix #514, the Netcode assembly is rewritten on when running on windows, regardless if the mod was built on windows or not.

This causes mods built on windows that reference Netcode to be rewritten in memory, making them unable to be debugged through VS.

Here's a sample mod that exhibits this behavior. It was built on windows:
NetcodeReferencer.zip

The source code is:

using Netcode;
using StardewModdingAPI;

namespace NetcodeReferencer
{
    public class ModEntry : Mod
    {
        public override void Entry(IModHelper helper)
        {
            NetEvent0 dummy = new NetEvent0();
        }
    }
}

And the output from SMAPI v.2.6-beta.14 when loading it on windows is:

[01:08:43 TRACE SMAPI]    Netcode Referencer (NetcodeReferencer\NetcodeReferencer.dll)...
[01:08:43 TRACE SMAPI]       Rewriting NetcodeReferencer.dll for OS...

I would guess that the same problem would occur when building and running on the same platform, regardless of whether that is windows or not.

commented

Fixed in develop for the upcoming SMAPI 2.6-beta.15.