C
C#7mo ago
Joran

System.TypeLoadException

can anyone help me with this? I'm kinda new to this. 🙂
No description
68 Replies
Angius
Angius7mo ago
Close VS, delete .bin and .obj folders in the project, open VS, rebuild
Joran
JoranOP7mo ago
still the same
Angius
Angius7mo ago
Show some more code then, I guess
Joran
JoranOP7mo ago
this good?
333fred
333fred7mo ago
That error usually a sign that you have your nuget references messed up. Can you show your csproj?
Angius
Angius7mo 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
Angius7mo ago
$code
MODiX
MODiX7mo 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
333fred7mo ago
Oh no old-style csproj
Angius
Angius7mo ago
Ooof Is it a .NET Framework project?
333fred
333fred7mo ago
Very much so
Angius
Angius7mo ago
Microsoft, for fuck's sake, remove those templates already... So You will want to start a new project $newproject
MODiX
MODiX7mo 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
Angius7mo 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
JoranOP7mo ago
can i just use my old code i already have?
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
333fred
333fred7mo 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
Angius7mo 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
JoranOP7mo ago
aight can you guys help me with creating a new project?
Angius
Angius7mo ago
Here
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
333fred
333fred7mo ago
I'm not sure what the HSNXT.* references are, but it looks abandoned
Joran
JoranOP7mo ago
so WPF App is best?
Angius
Angius7mo ago
No
333fred
333fred7mo ago
For a discord app? Probably not
Angius
Angius7mo 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
JoranOP7mo ago
owh
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Joran
JoranOP7mo ago
yea my previous one had
333fred
333fred7mo ago
This is the web sdk
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Joran
JoranOP7mo ago
this one good?
No description
MODiX
MODiX7mo 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 User7mo ago
Message Not Public
Sign In & Join Server To View
Joran
JoranOP7mo ago
yea thats this one
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Joran
JoranOP7mo ago
aight thx
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Joran
JoranOP7mo ago
and how i do that
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Joran
JoranOP7mo ago
where do i see it (this is my first D#+ project)
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Angius
Angius7mo 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 User7mo ago
Message Not Public
Sign In & Join Server To View
Joran
JoranOP7mo ago
i already made a new one
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Joran
JoranOP7mo ago
np
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Joran
JoranOP7mo ago
? dont know if ther is a api key in it
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Joran
JoranOP7mo ago
ill just delete all my old stuff
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Joran
JoranOP7mo ago
but now i got a lil problem with my old commands and code, they got a lot of errors
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Joran
JoranOP7mo 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 User7mo ago
Message Not Public
Sign In & Join Server To View
Joran
JoranOP7mo ago
how do i commit?
Angius
Angius7mo ago
$gitstarted
MODiX
MODiX7mo ago
moved to $git
Angius
Angius7mo ago
$git
MODiX
MODiX7mo 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
Angius7mo ago
404, the repo is private probably
Joran
JoranOP7mo ago
Probably Ill take a look for u tomorrow gonna go to bed now, gotta get up early.
Joran
JoranOP7mo ago
GitHub
GitHub - jatochjoran/CBSBot
Contribute to jatochjoran/CBSBot development by creating an account on GitHub.
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Joran
JoranOP7mo ago
Np
Want results from more Discord servers?
Add your server