ImGui.NET icon indicating copy to clipboard operation
ImGui.NET copied to clipboard

Can I use this on a .NET Framework 4.7.2 project?

Open EricPlayZ opened this issue 5 years ago • 4 comments

Not sure if it's related to that, but I keep getting this error when i try using any of the ImGui.NET's functions: [Error] System.TypeLoadException: Could not find method due to a type load error I was thinking maybe it's because I'm using .NET Framework 4.7.2, and ImGui.NET uses .NET Standard 2.0. What is the actual cause of this error?

EricPlayZ avatar Aug 22 '20 18:08 EricPlayZ

.NET Standard 2.0 is compatible with .NET Framework 4.6.1 or superior by definition: https://docs.microsoft.com/en-us/dotnet/standard/net-standard

Xeeynamo avatar Aug 27 '20 06:08 Xeeynamo

Hm. What could be causing my error then?

EricPlayZ avatar Aug 29 '20 09:08 EricPlayZ

It is probably missing a DLL. Do you see the cimgui.dll and ImGui.Net.dll are copied to your output directory? The project definitely does work with .NET Framework 4.7.2. As the XNA example uses that exact version https://github.com/mellinoe/ImGui.NET/blob/master/src/ImGui.NET.SampleProgram.XNA/ImGui.NET.SampleProgram.XNA.csproj (and runs for me).

If all else fails you can use the fusion log viewer to determine what dll could not be loaded: https://docs.microsoft.com/en-us/dotnet/framework/tools/fuslogvw-exe-assembly-binding-log-viewer?redirectedfrom=MSDN. Maybe that gives you a hint?

roy-t avatar Sep 09 '20 21:09 roy-t

Yeah, they're both copied to my output directory. I'm using MelonLoader btw to be able to use ImGui.NET in a .NET game. I'm not sure if that affects anything.

EricPlayZ avatar Oct 08 '20 17:10 EricPlayZ