Replies: 2 comments 1 reply
-
In future please use Discussions to ask support related questions.
Did you set a RuntimeIdentifier?
I've never even heard of
As per dotnet/runtime#31743 (comment) the .Net Runtime will throw a
As above, for
If setting a
What makes this a |
Beta Was this translation helpful? Give feedback.
-
@emelrad12 did you get offscreen working with godot4? im running into this same issue. |
Beta Was this translation helpful? Give feedback.
-
What version of the product are you using?
Version=112.2.70.0
CefSharp.OffScreen.NETCore
What architecture x86 or x64?
x64
What version of .Net?
6.0
But it is using actually Godot.NET.Sdk/4.0.2
Which seems to be a fork of Microsoft.NET.Sdk
On what operating system?
Win11
Are you using
WinForms
,WPF
orOffScreen
?OffScreen
What steps will reproduce the problem?
Make a new Godot c# project and import Cef sharp into it
Try to load a new ChromiumWebBrowser()
What is the expected output? What do you see instead?
I get this exception
ERROR: System.BadImageFormatException: Could not load file or assembly 'CefSharp.Core.Runtime, Version=112.2.70.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138'. An attempt was made to load a program with an incorrect format.
File name: 'CefSharp.Core.Runtime, Version=112.2.70.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138' ---> System.BadImageFormatException: Could not load file or assembly ''. An attempt was made to load a program with an incorrect format.
File name: ''
at System.Runtime.Loader.AssemblyLoadContext.InternalLoad(ReadOnlySpan
1 arrAssembly, ReadOnlySpan
1 arrSymbols)at System.Runtime.Loader.AssemblyLoadContext.LoadFromStream(Stream assembly, Stream assemblySymbols)
at GodotPlugins.PluginLoadContext.Load(AssemblyName assemblyName) in /root/godot/modules/mono/glue/GodotSharp/GodotPlugins/PluginLoadContext.cs:line 69
at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingLoad(AssemblyName assemblyName)
at System.Runtime.Loader.AssemblyLoadContext.Resolve(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName)
at CefSharp.Cef.get_IsInitialized()
at CefSharp.OffScreen.ChromiumWebBrowser..ctor(String address, IBrowserSettings browserSettings, IRequestContext requestContext, Boolean automaticallyCreateBrowser, Action`1 onAfterBrowserCreated, Boolean useLegacyRenderHandler) in C:\projects\cefsharp\CefSharp.OffScreen\ChromiumWebBrowser.cs:line 213
at WeirdGame.UI.CefMain.Init() in D:\Projects\WeirdGame\Src\UI\CefMain.cs:line 11
at WeirdGame.GameMain._Ready() in D:\Projects\WeirdGame\GameMain.cs:line 28
at Godot.Node.InvokeGodotClassMethod(godot_string_name& method, NativeVariantPtrArgs args, godot_variant& ret) in /root/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/Node.cs:line 1801
at WeirdGame.GameMain.InvokeGodotClassMethod(godot_string_name& method, NativeVariantPtrArgs args, godot_variant& ret) in D:\Projects\WeirdGame\Godot.SourceGenerators\Godot.SourceGenerators.ScriptMethodsGenerator\WeirdGame.GameMain_ScriptMethods.generated.cs:line 40
at Godot.Bridge.CSharpInstanceBridge.Call(IntPtr godotObjectGCHandle, godot_string_name* method, godot_variant** args, Int32 argCount, godot_variant_call_error* refCallError, godot_variant* ret) in /root/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/CSharpInstanceBridge.cs:line 24
Does this problem also occur in the
CEF
Sample ApplicationNo, it is only related to using godot
Note that Godot switched to net 6.0(not using mono anymore) recently and is using a fork of the net sdk, so most likely CefSharp is having an issue with that.
Beta Was this translation helpful? Give feedback.
All reactions