C
C#2w ago
Joran

System.TypeLoadException

can anyone help me with this? I'm kinda new to this. 🙂
No description
68 Replies
Angius
Angius2w ago
Close VS, delete .bin and .obj folders in the project, open VS, rebuild
Joran
Joran2w ago
still the same
Angius
Angius2w ago
Show some more code then, I guess
Joran
Joran2w ago
this good?
333fred
333fred2w ago
That error usually a sign that you have your nuget references messed up. Can you show your csproj?
Angius
Angius2w ago
I guess it could also be related to this issue, but it's marked as solved: https://github.com/DSharpPlus/DSharpPlus/issues/1547
Angius
Angius2w ago
$code
MODiX
MODiX2w ago
To post C# code type the following: ```cs // code here ``` Get an example by typing $codegif in chat For longer snippets, use: https://paste.mod.gg/
333fred
333fred2w ago
Oh no old-style csproj
Angius
Angius2w ago
Ooof Is it a .NET Framework project?
333fred
333fred2w ago
Very much so
Angius
Angius2w ago
Microsoft, for fuck's sake, remove those templates already... So You will want to start a new project $newproject
MODiX
MODiX2w ago
When creating a new project, prefer using .NET over .NET Framework, unless you have a very specific reason to be using .NET Framework. .NET Framework is now legacy code and only get security fix updates, it no longer gets new features and is not recommended. https://cdn.discordapp.com/attachments/569261465463160900/899381236617855016/unknown.png
Angius
Angius2w ago
Install all the nuggets there And copy-paste your code there This will be the simplest way to make up for Microsoft's mistake
Joran
Joran2w ago
can i just use my old code i already have?
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
333fred
333fred2w ago
Also, and this is the likely cause of your actual error: you depend on at least 2 different versions of DSharpPlus Both 4.4.6.0 and 3.0.198.0
Angius
Angius2w ago
You technically can upgrade to modern .NET, sure But just making a new project and copying the code over will be the easiest, IMO
Joran
Joran2w ago
aight can you guys help me with creating a new project?
Angius
Angius2w ago
Here
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
333fred
333fred2w ago
I'm not sure what the HSNXT.* references are, but it looks abandoned
Joran
Joran2w ago
so WPF App is best?
Angius
Angius2w ago
No
333fred
333fred2w ago
For a discord app? Probably not
Angius
Angius2w ago
Your current project is a console app So just use a console app As long as it does not have the (.NET Framework) suffix it's fine
Joran
Joran2w ago
owh
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
Joran
Joran2w ago
yea my previous one had
333fred
333fred2w ago
This is the web sdk
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
Joran
Joran2w ago
this one good?
No description
MODiX
MODiX2w ago
TeBeCo
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DSharpPlus" Version="4.4.6" />
<PackageReference Include="DSharpPlus.CommandsNext" Version="4.4.6" />
<PackageReference Include="DSharpPlus.Interactivity" Version="4.1.0" />
<PackageReference Include="DSharpPlus.Rest" Version="4.4.6" />
<PackageReference Include="DSharpPlus.SlashCommands" Version="4.4.6" />
<PackageReference Include="DSharpPlus.VoiceNext" Version="4.4.6" />
</ItemGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DSharpPlus" Version="4.4.6" />
<PackageReference Include="DSharpPlus.CommandsNext" Version="4.4.6" />
<PackageReference Include="DSharpPlus.Interactivity" Version="4.1.0" />
<PackageReference Include="DSharpPlus.Rest" Version="4.4.6" />
<PackageReference Include="DSharpPlus.SlashCommands" Version="4.4.6" />
<PackageReference Include="DSharpPlus.VoiceNext" Version="4.4.6" />
</ItemGroup>

</Project>
Quoted by
<@689473681302224947> from #System.TypeLoadException (click here)
React with ❌ to remove this embed.
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
Joran
Joran2w ago
yea thats this one
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
Joran
Joran2w ago
aight thx
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
Joran
Joran2w ago
and how i do that
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
Joran
Joran2w ago
where do i see it (this is my first D#+ project)
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
Angius
Angius2w ago
TeBe is talking about the old, .NET Framework project If you already made a new one, none of that will be there
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
Joran
Joran2w ago
i already made a new one
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
Joran
Joran2w ago
np
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
Joran
Joran2w ago
? dont know if ther is a api key in it
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
Joran
Joran2w ago
ill just delete all my old stuff
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
Joran
Joran2w ago
but now i got a lil problem with my old commands and code, they got a lot of errors
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
Joran
Joran2w ago
i could do that or i could let chatgpt do it for me ill try that first this all kinda happened because i got mad. I wanted to make a command that gives the user a Modal that he/she can fill in and when submitted it shows the results as an embed
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
Joran
Joran2w ago
how do i commit?
Angius
Angius2w ago
$gitstarted
MODiX
MODiX2w ago
moved to $git
Angius
Angius2w ago
$git
MODiX
MODiX2w ago
interactive teaching: https://learngitbranching.js.org/ msft learn course: https://learn.microsoft.com/en-us/training/modules/intro-to-git/ git init initializes the repository dotnet new gitignore adds a .gitignore file git add . starts tracking all files git commit -m "[message]" creates a commit git remote add origin [url] adds a remote repository git push -u origin main first push, sets the remote as upstream git push all pushes after that can be just this Git cheat sheet
Angius
Angius2w ago
404, the repo is private probably
Joran
Joran2w ago
Probably Ill take a look for u tomorrow gonna go to bed now, gotta get up early.
Joran
Joran2w ago
GitHub
GitHub - jatochjoran/CBSBot
Contribute to jatochjoran/CBSBot development by creating an account on GitHub.
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
Joran
Joran2w ago
Np
Want results from more Discord servers?
Add your server
More Posts