#4.3.0

1 messages · Page 1 of 1 (latest)

orchid ivy
#

last testing before 4.3.0

tranquil charm
#

added myself to the thread.

#

I'll update ModCore to the latest nightly as well. Issues stemming from the library will be relayed here, if any.

tranquil charm
#

@orchid ivy should we close this, or keep it open?

orchid ivy
#

close

covert forum
halcyon depot
#

@restive wraith says 4.3.0 CNext is depending on a nightly version of the lib (which, is strange because it's a project reference, but, sure)

#

Have fun when

tranquil charm
#

how does that work

#

what even

restive wraith
#

yeah idk

tranquil charm
#

Doesn't appear to be

restive wraith
#

This is the exception stack trace I get:

System.IO.FileNotFoundException: Could not load file or assembly 'DSharpPlus, Version=4.3.0.1155, Culture=neutral, PublicKeyToken=null'. Le fichier spécifié est introuvable.
File name: 'DSharpPlus, Version=4.3.0.1155, Culture=neutral, PublicKeyToken=null'
   at Hammer.Commands.InfoCommand.InfoAsync(InteractionContext context)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at Hammer.Commands.InfoCommand.InfoAsync(InteractionContext context)
#

@halcyon depot said "use stable version" which...

<PackageReference Include="DSharpPlus" Version="4.3.0"/>
<PackageReference Include="DSharpPlus.Interactivity" Version="4.3.0"/>
<PackageReference Include="DSharpPlus.SlashCommands" Version="4.3.0"/>

I am kek

tranquil charm
#

cnext as well?

restive wraith
#

I'm not using cnext

#

I never use it

#

But that's not the library it's failing to find

restive wraith
#

smh misconvey of my problem

tranquil charm
#

lol

halcyon depot
#

the point stands

restive wraith
#

I did say "command" in DM

#

but I mean slash command

halcyon depot
#

I saw command, I assume CNext

#

becasue nobody likes slash commands

restive wraith
#

I mean I do but that's besides the point lol

restive wraith
tranquil charm
#

seems right on nuget

#

have you tried clean & rebuild?

orchid ivy
#

preferably restoring with disabling nuget cache

restive wraith
#

Irrelevant, this is a fresh build locally and the same thing also happens in a docker container where it's always a clean build anyway

tranquil charm
#

strange. @grand silo doesn't have this issue despite using the same version

restive wraith
#

Logs on my VPS show the same thing:

[19:40:41 INFO] [Hammer.Services.BotService] Member 94248427663130624; Yasahiro#0001 (🔨 Haiku enthusiast) ran slash command /info
[19:40:41 ERROR] [Hammer.Services.BotService] An exception was thrown when executing slash command 'info': System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.IO.FileLoadException: Could not load file or assembly 'DSharpPlus, Version=4.3.0.1155, Culture=neutral, PublicKeyToken=null'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)
File name: 'DSharpPlus, Version=4.3.0.1155, Culture=neutral, PublicKeyToken=null'
   at Hammer.Commands.InfoCommand.InfoAsync(InteractionContext context)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at Hammer.Commands.InfoCommand.InfoAsync(InteractionContext context)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at DSharpPlus.SlashCommands.SlashCommandsExtension.RunCommandAsync(BaseContext context, MethodInfo method, IEnumerable`1 args)
   at DSharpPlus.SlashCommands.SlashCommandsExtension.<>c__DisplayClass47_0.<<InteractionHandler>b__0>d.MoveNext()
#

For reference, this is the command method. This worked perfectly fine until I updated to 4.3.0 stable, so the command method should be fine

[SlashCommand("info", "Displays information about the bot.")]
[SlashRequireGuild]
public async Task InfoAsync(InteractionContext context)
{
    DiscordClient client = context.Client;
    DiscordMember member = (await client.CurrentUser.GetAsMemberOfAsync(context.Guild).ConfigureAwait(false))!;
    string hammerVersion = _botService.Version;

    var embed = new DiscordEmbedBuilder();
    embed.WithAuthor(member);
    embed.WithColor(member.Color);
    embed.WithThumbnail(member.AvatarUrl);
    embed.WithTitle($"Hammer v{hammerVersion}");
    embed.AddField("Ping", client.Ping, true);
    embed.AddField("Uptime", (DateTimeOffset.UtcNow - _botService.StartedAt).Humanize(), true);

    var builder = new StringBuilder();
    builder.AppendLine($"Hammer: {hammerVersion}");
    builder.AppendLine($"D#+: {client.VersionString}");
    builder.AppendLine($"Gateway: {client.GatewayVersion}");
    builder.AppendLine($"CLR: {Environment.Version.ToString(3)}");
    builder.AppendLine($"Host: {Environment.OSVersion}");

    embed.AddField("Version", Formatter.BlockCode(builder.ToString()));

    await context.CreateResponseAsync(embed, true).ConfigureAwait(false);
}
#

GetAsMemberOfAsync is just an extension method

tranquil charm
#

mind sharing the full csproj?

restive wraith
tranquil charm
#

thanks

#

does your extension library (X10D.DSharpPlus) reference 4.3.0?

orchid ivy
#

given the fact the last release is from 16 days ago, no, it probably doesn't

restive wraith
#

It does but it references a different version that the exception message is reporting, plus it references as PrivateAssets so clients don't use that version anyway

#
<PackageReference Include="DSharpPlus" Version="4.3.0-nightly-01189" PrivateAssets="All"/>

X10D.DSharpPlus csproj ^

orchid ivy
#

you'd still potentially get an error, privateassets or not

tranquil charm
#

yeah I looked it up

orchid ivy
#

but yeah that is the wrong version

restive wraith
#

But this is 01189, and the exception reports 01155

tranquil charm
#

interesting how it asks for a different version still

restive wraith
#

I can push an update for my extension lib so it references stable 🤔 maybe that would fix it, but I doubt it. Worth a shot though

tranquil charm
#

better safe than sorry :)

#

lmk whether that makes any difference

halcyon depot
restive wraith
#

Yep just pushed an update. Will upgrade the package in the bot once nuget.org does it validation crap so gimme a few

#

Yay CI failure!

tranquil charm
#

pretty cool that it's the official bot for brackeys' server

#

I sometimes watch their videos lol

restive wraith
#

Yee I decided to rewrite the bot(s) in the server because there used to be just one bot that handled everything. The codebase was abhorrent and just such a pain to work with

#

So now we have multiple single-purpose bots LUL

tranquil charm
#

I mean that's to be expected when Unity devs need to write regular .NET code :^):^):^)

#

don't take that too hard, I work with Unity professionally as well

restive wraith
#

Oh it's fine kekw I try to avoid Unity at all costs. I hate it so much

tranquil charm
#

understandable lol

restive wraith
#

Fun weird little thing: Rider reports the latest version of my package being nightly 139 when the latest that I just published is 137 lolwutvelma

orchid ivy
#

cache

restive wraith
#
System.IO.FileNotFoundException: Could not load file or assembly 'DSharpPlus, Version=4.3.0.1189, Culture=neutral, PublicKeyToken=null'. Le fichier spécifié est introuvable.
File name: 'DSharpPlus, Version=4.3.0.1189, Culture=neutral, PublicKeyToken=null'
   at Hammer.Commands.InfoCommand.InfoAsync(InteractionContext context)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at Hammer.Commands.InfoCommand.InfoAsync(InteractionContext context)

Alright. Actual update: Now it... reports it wants 1189 what

halcyon depot
#

hi op

restive wraith
#

And yes I dotnet clean'd

#

oh wait I typed 137 woops

#

meant to be 147

#

disregard, trying again kekw

#

But this does hint that maybe the issue was my package

#

Okay yep confirmed. The issue was indeed X10D.DSharpPlus referencing the nightly Facepalm

#

Thank you @tranquil charm and @orchid ivy this was a rookie mistake kek, albeit a subtle one

#

And velvet, make forums now thx