Coding Help Updating Stardew Config Menu

LittleRaskol

Greenhorn
Note: I have contacted the mod author about what I'll talk about in this post, but have not heard back after several days. So I figured I would throw it to the forums.

TL,DR: What's up with this error about what appears to be a normal part of the SMAPI?

Code:
The type 'IManifest' is defined in an assembly that is not referenced. You must add a reference to assembly 'StardewModdingAPI.Toolkit.CoreInterfaces, Version=2.6.0.0, Culture=neutral, PublicKeyToken=null'.
The version number will change based on what version of SMAPI is installed, and this is mysterious since IManifest is just a normal part of SMAPI. Attempting to add "using StardewModdingAPI.Toolkit.CoreInterfaces;" fails with a "directive is unneeded" error.

Longer story:

I like the way Stardew Config Menu adds a tab to the in-game menu and wanted to use it for updates to my Stardew Valley mods. Since it was open source, I figured I might be able to just follow the update guides to bring the mod up to date with the most recent SMAPI. Everything was smooth (just followed the update guide, you can see a comparison here) except for two things:
  1. I had to just comment out everything related to "HandleJunimo" because it relied on looking for something in Stardew Valley's GameMenu code that no longer exists (junimoNoteIcon). I therefore figured this was obsolete as of the most recent game version. If someone has a better idea what's going on here I am all ears!
  2. One thing I could not fix was any reference to an IManifest object in IOptionsPackage. It threw the following odd error: The type 'IManifest' is defined in an assembly that is not referenced. You must add a reference to assembly 'StardewModdingAPI.Toolkit.CoreInterfaces, Version=2.6.0.0, Culture=neutral, PublicKeyToken=null'.
My guess was that because IOptionsPackage is defined in the framework, and the framework was compiled using an older version of SMAPI, that's what this is complaining about and I'd have to download and update the framework too.

So I went to do the same thing on the StardewConfigFramework code. I didn't realize that the default page in github would be for the development branch, though. So I was able to get a working DLL out of it by just updating the SMAPI version in the project, but if you compare to the master branch (here), it has a bunch of changes the author I guess was working on and that I don't know if they work yet. (You can see just the things I changed here.)

Since I couldn't be sure the dev branch was ready to be used, I switched to master and tried the same thing... and eventually got the same strange error:
The type 'IManifest' is defined in an assembly that is not referenced. You must add a reference to assembly 'SMAPI.Toolkit.CoreInterfaces, Version=3.6.2.0, Culture=neutral, PublicKeyToken=null'. This was paired with this error on any reference to IManifest: The type or namespace name 'IManifest' could not be found (are you missing a using directive or an assembly reference?)

So I don't understand what's going on here. IManifest seems to be a part of SMAPI, so why do I need some special reference? Attempting to add "using StardewModdingAPI.Toolkit.CoreInterfaces;" fails with a "directive is unneeded" error. What's up here, does anyone know? And does anyone have any idea whether I can use the DLL that I created from the dev branch code?
 

mouse

Farmer
I'm not very familiar with SMAPI modding (or C#/VS in general), so I just have flailing "??" like "uh wrong NuGet package? did you... put the sldkfjhsleks thing in the sdlkjslek thing" but I wanted to comment anyway to ask if you'd considered using Generic Mod Config Menu instead. It doesn't have a tab in the settings menu, but it's up to date and the author is still active. Now that it will work with Content Patcher, it will be a much more common install for people that want to modify the often complex config options that CP Packs can have.

That said, if you really wanted to try fixing this one, you might get more help in the #making-mods channel of the Stardew Valley Discord server, just from the greater number of modders active there :)
 

Chililover

Planter
Note: I have contacted the mod author about what I'll talk about in this post, but have not heard back after several days. So I figured I would throw it to the forums.

TL,DR: What's up with this error about what appears to be a normal part of the SMAPI?

Code:
The type 'IManifest' is defined in an assembly that is not referenced. You must add a reference to assembly 'StardewModdingAPI.Toolkit.CoreInterfaces, Version=2.6.0.0, Culture=neutral, PublicKeyToken=null'.
The version number will change based on what version of SMAPI is installed, and this is mysterious since IManifest is just a normal part of SMAPI. Attempting to add "using StardewModdingAPI.Toolkit.CoreInterfaces;" fails with a "directive is unneeded" error.

Longer story:

I like the way Stardew Config Menu adds a tab to the in-game menu and wanted to use it for updates to my Stardew Valley mods. Since it was open source, I figured I might be able to just follow the update guides to bring the mod up to date with the most recent SMAPI. Everything was smooth (just followed the update guide, you can see a comparison here) except for two things:
  1. I had to just comment out everything related to "HandleJunimo" because it relied on looking for something in Stardew Valley's GameMenu code that no longer exists (junimoNoteIcon). I therefore figured this was obsolete as of the most recent game version. If someone has a better idea what's going on here I am all ears!
  2. One thing I could not fix was any reference to an IManifest object in IOptionsPackage. It threw the following odd error: The type 'IManifest' is defined in an assembly that is not referenced. You must add a reference to assembly 'StardewModdingAPI.Toolkit.CoreInterfaces, Version=2.6.0.0, Culture=neutral, PublicKeyToken=null'.
My guess was that because IOptionsPackage is defined in the framework, and the framework was compiled using an older version of SMAPI, that's what this is complaining about and I'd have to download and update the framework too.

So I went to do the same thing on the StardewConfigFramework code. I didn't realize that the default page in github would be for the development branch, though. So I was able to get a working DLL out of it by just updating the SMAPI version in the project, but if you compare to the master branch (here), it has a bunch of changes the author I guess was working on and that I don't know if they work yet. (You can see just the things I changed here.)

Since I couldn't be sure the dev branch was ready to be used, I switched to master and tried the same thing... and eventually got the same strange error:
The type 'IManifest' is defined in an assembly that is not referenced. You must add a reference to assembly 'SMAPI.Toolkit.CoreInterfaces, Version=3.6.2.0, Culture=neutral, PublicKeyToken=null'. This was paired with this error on any reference to IManifest: The type or namespace name 'IManifest' could not be found (are you missing a using directive or an assembly reference?)

So I don't understand what's going on here. IManifest seems to be a part of SMAPI, so why do I need some special reference? Attempting to add "using StardewModdingAPI.Toolkit.CoreInterfaces;" fails with a "directive is unneeded" error. What's up here, does anyone know? And does anyone have any idea whether I can use the DLL that I created from the dev branch code?
my brother is a 'programmer's so I have a bit of understanding but not much. So I don't know how mods use libraries but if the mods call libraries and I'm correct somewhere in the code it uses 'Imanifest' but there's no reference/librarie and you need to add it usually at the top of the code there's a.list of libraries! I would try anything anybody else suggests but I thought I might be able to help! But probably not lol! Also try what mouse said first!
I'm not very familiar with SMAPI modding (or C#/VS in general), so I just have flailing "??" like "uh wrong NuGet package? did you... put the sldkfjhsleks thing in the sdlkjslek thing" but I wanted to comment anyway to ask if you'd considered using Generic Mod Config Menu instead. It doesn't have a tab in the settings menu, but it's up to date and the author is still active. Now that it will work with Content Patcher, it will be a much more common install for people that want to modify the often complex config options that CP Packs can have.

That said, if you really wanted to try fixing this one, you might get more help in the #making-mods channel of the Stardew Valley Discord server, just from the greater number of modders active there :)
This is exactly how I feel when I look at programmer's calling out people's errors there always like ' oh, you put the potato.lpeg in the json roaming appdata manifest, it should be in libraries.oligarchy folder along side the greenhouse.keg manifest!' It's so confusing!!
 

LittleRaskol

Greenhorn
I'm not very familiar with SMAPI modding (or C#/VS in general), so I just have flailing "??" like "uh wrong NuGet package? did you... put the sldkfjhsleks thing in the sdlkjslek thing" but I wanted to comment anyway to ask if you'd considered using Generic Mod Config Menu instead. It doesn't have a tab in the settings menu, but it's up to date and the author is still active. Now that it will work with Content Patcher, it will be a much more common install for people that want to modify the often complex config options that CP Packs can have.

That said, if you really wanted to try fixing this one, you might get more help in the #making-mods channel of the Stardew Valley Discord server, just from the greater number of modders active there :)
The immediate development goal is going to be making my mods compatible with Generic Mod Config Menu, because that does seem to be in more common use. In the long run though I hope to be able to rehabilitate Stardew Config Menu while maintaining compatibility with Generic (so that users of either can have the benefit of in-game menus).

Thanks for telling me about the discord, I'll check it out when I can commit to having discord installed again, haha.
 

LittleRaskol

Greenhorn
my brother is a 'programmer's so I have a bit of understanding but not much. So I don't know how mods use libraries but if the mods call libraries and I'm correct somewhere in the code it uses 'Imanifest' but there's no reference/librarie and you need to add it usually at the top of the code there's a.list of libraries! I would try anything anybody else suggests but I thought I might be able to help! But probably not lol! Also try what mouse said first!
I think that you can add an explicit reference to SMAPI.Toolkit.CoreInterfaces in, like, the side panel of Visual Studio, under "References." I will probably eventually try that even though it still doesn't make sense because I already have a reference to SMAPI.
 
Top