How to report a dependency issue with CefSharp.Core.Runtime? #4468
Replies: 4 comments 4 replies
-
Please use Discussions to ask support related questions.
This is a common exception and unlikely a bug in
Reported what problem exactly?
Are you upgrading from a previous version? No new dependencies have been added in quite some time. Are you seeing this problem on your development machine or when you deploy to machine? Please answer the questions at https://github.com/cefsharp/CefSharp/wiki/Questions-&-Support#when-asking-a-question-please-include-the-following Need more information to provide any sort of guidance here. The MinimalExample is kept up to date for testing purposes. |
Beta Was this translation helpful? Give feedback.
-
Alex,
I did use ‘DependanceWalker.net’ (DependencyWalker.exe) on the CefSharp.Cor.Runtime.dll and this is what is reported as an error:
F:\_OneDriveBusiness\Intent Digital L.L.C\GUS CEF - Source Code - Copy\VoteLynx_VP_CEF\bin\Debug\CefSharp.Core.Runtime.dll - Error loading
System.BadImageFormatException: Could not load file or assembly 'file:///F:\_OneDriveBusiness\Intent Digital L.L.C\GUS CEF - Source Code - Copy\VoteLynx_VP_CEF\bin\Debug\CefSharp.Core.Runtime.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: 'file:///F:\_OneDriveBusiness\Intent Digital L.L.C\GUS CEF - Source Code - Copy\VoteLynx_VP_CEF\bin\Debug\CefSharp.Core.Runtime.dll'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at SindaSoft.DependencyWalker.Walker.inspectAssembly(String name)
SEE BELOW: My responses highlighted in yellow.
Thank You,
Richard B. Oberholz
Engineer
Intent Digital
602-404-0100 Ext: 25
Email: ***@***.******@***.***>
Web: www.intentdigital.com<http://www.intentdigital.com/>
www.votelynx.com<http://www.votelynx.com/>
From: Alex Maitland ***@***.***>
Sent: Monday, April 17, 2023 1:26 PM
To: cefsharp/CefSharp ***@***.***>
Cc: Richard B. Oberholz ***@***.***>; Author ***@***.***>
Subject: Re: [cefsharp/CefSharp] How to report a dependency issue with CefSharp.Core.Runtime? (Discussion #4468)
Please use Discussions<https://github.com/cefsharp/CefSharp/discussions> to ask support related questions.
System.BadImageFormatException: Could not load file or assembly 'CefSharp.Core.Runtime, Version=112.2.70.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Based on the System.BadImageFormatException; What dependencies does the CefSharp.Core.Runtime rely on and what is the correct format? I have not been able to find this out.
This is a common exception and unlikely a bug in CefSharp.
An attempt was made to load a program with an incorrect format. usually means you are loading the incorrect architecture dll. The app architecture using CefSharp is set for 64bit. It also uses .net framwork version 4.7.2. Is there a different architecture dll you are referring to.
Checking this .dll with DependencyWalker.net, it reported that the CefSharp.Core.Runtime.dll has the problem.
Reported what problem exactly? See my initial comment above.
This was first encountered with version 111.2.70. Also, checked today and issue with the 'CefSharp.Core.Runtime.dll version 102.0.100.0.
Are you upgrading from a previous version? No new dependencies have been added in quite some time. Upgraded from version 102.0.100.0
Are you seeing this problem on your development machine or when you deploy to machine? Sometimes it would show on the development machine, and I don’t know why it’s intermittent. The app with CefSharp would run fine after an initial installation. However, if you copied an updated .exe, after a minor change, to the target machine, the error would show up.
Please answer the questions at https://github.com/cefsharp/CefSharp/wiki/Questions-&-Support#when-asking-a-question-please-include-the-following
Answers to questions at link.
1. Version 112.2.70
2. WinForms
3. Not .net Core: Targeting .net framework 4.7.2
Need more information to provide any sort of guidance here. The MinimalExample<https://github.com/cefsharp/CefSharp.MinimalExample> is kept up to date for testing purposes.
—
Reply to this email directly, view it on GitHub<#4468 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ALZABXLOKQ7LKSVXMFSN7DDXBWRMXANCNFSM6AAAAAAW67QHXM>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Alex,
Get the DependancyWalker.net app from isindicic/DependencyWalker.Net: Show dependencies tree for .NET assemblies like old Depend Walker show it for non managed applications. (github.com)<https://github.com/isindicic/DependencyWalker.Net> and run it against the CefSharp.Core.Runtime.dll. Its found on GitHub at https://github.com/isindicic/DependencyWalker.Net and the above link. I believe I found this utility through Stackoverflow.com when trying to get answers to fix the problem.
I could not duplicate the problem using the ‘MinimalExample’.
If you have more questions, feel free to call me at the number listed below.
Clarification to an earlier email from today.
GH question: An attempt was made to load a program with an incorrect format. usually means you are loading the incorrect architecture dll.
RBO answer: The app architecture using CefSharp is set for 64bit. It also uses .net framework version 4.7.2. Is there a different architecture dll you are referring to.
Checking this .dll with DependencyWalker.net, it reported that the CefSharp.Core.Runtime.dll has the problem.
…-----------------------------------------------------------------
GH question: Reported what problem exactly?
RBO answer:
F:\_OneDriveBusiness\Intent Digital L.L.C\GUS CEF - Source Code - Copy\VoteLynx_VP_CEF\bin\Debug\CefSharp.Core.Runtime.dll - Error loading
System.BadImageFormatException: Could not load file or assembly 'file:///F:\_OneDriveBusiness\Intent Digital L.L.C\GUS CEF - Source Code - Copy\VoteLynx_VP_CEF\bin\Debug\CefSharp.Core.Runtime.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: 'file:///F:\_OneDriveBusiness\Intent Digital L.L.C\GUS CEF - Source Code - Copy\VoteLynx_VP_CEF\bin\Debug\CefSharp.Core.Runtime.dll'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at SindaSoft.DependencyWalker.Walker.inspectAssembly(String name)
This was first encountered with version 111.2.70. Also, checked the 'CefSharp.Core.Runtime.dll' version 102.0.100.0. The error is found in this version as well.
-----------------------------------------------------------------
GH question: Are you upgrading from a previous version? No new dependencies have been added in quite some time.
RBO answer: Upgraded from version 102.0.100.0
-----------------------------------------------------------------
GH question: Are you seeing this problem on your development machine or when you deploy to machine?
RBO answer: Sometimes it would show on the development machine, and I don’t know why it’s intermittent. The app with CefSharp would run fine after an initial installation. However, if you copied an updated .exe, after a minor change, to the target machine, the error would show up.
-----------------------------------------------------------------
GH question: Please answer the questions at https://github.com/cefsharp/CefSharp/wiki/Questions-&-Support#when-asking-a-question-please-include-the-following
RBO answer: Answers to questions at link.
1. Version 112.2.70
2. WinForms
3. Not .net Core: Targeting .net framework 4.7.2
Thank You,
Richard B. Oberholz
Engineer
Intent Digital
602-404-0100 Ext: 25
Email: ***@***.******@***.***>
Web: www.intentdigital.com<http://www.intentdigital.com/>
www.votelynx.com<http://www.votelynx.com/>
From: Alex Maitland ***@***.***>
Sent: Thursday, April 20, 2023 1:38 PM
To: cefsharp/CefSharp ***@***.***>
Cc: Richard B. Oberholz ***@***.***>; Author ***@***.***>
Subject: Re: [cefsharp/CefSharp] How to report a dependency issue with CefSharp.Core.Runtime? (Discussion #4468)
Need more information to provide any sort of guidance here. The MinimalExample<https://github.com/cefsharp/CefSharp.MinimalExample> is kept up to date for testing purposes.
Does the problem reproduce using the MinimalExample?
—
Reply to this email directly, view it on GitHub<#4468 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ALZABXLFVEZ6GVNCYUITJ5DXCGND7ANCNFSM6AAAAAAW67QHXM>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
-
Alex,
GH Question: How does your project/solution differ from the MinimalExample?
RBO Answer:
I wasn’t totally clear about the results I got when running the MinimalExample. I only ran it and didn’t see any problems. I did use the DependancyWalker.net utility and checked the dependencies of the CefSharp.core.Runtime.dll. I see the same reported dependance issue.
See the following results:
F:\Visual Studio Community Projects\CefSharp.MinimalExample-master\CefSharp.MinimalExample.WinForms\bin.net472\Debug\net472\x64\CefSharp.Core.Runtime.dll - Error loading
System.BadImageFormatException: Could not load file or assembly 'file:///F:\Visual Studio Community Projects\CefSharp.MinimalExample-master\CefSharp.MinimalExample.WinForms\bin.net472\Debug\net472\x64\CefSharp.Core.Runtime.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: 'file:///F:\Visual Studio Community Projects\CefSharp.MinimalExample-master\CefSharp.MinimalExample.WinForms\bin.net472\Debug\net472\x64\CefSharp.Core.Runtime.dll'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at SindaSoft.DependencyWalker.Walker.inspectAssembly(String name)
Alex, please get a copy of DependanceWalker.net and check the Cefsharp.Core.Runtime.dll yourself.
GH Question: If your application is x64 then I'd expect this error if it attempted to load an x86 dll.
RBO Answer: App architecture is x64.
GH Question: You can add some debugging to your build output which might shed some light on what's going on.
RBO Answer: This info is here because the the links took me to a page that talked about ‘Basic formatting syntext’ but not a place to upload the text.
The target build info is as follows:
1>CefSharpAfterBuildDiagnostic:
1> CefSharp After Build Diagnostic
1> CefSharpBuildAction = Content
1> CefSharpPropertiesLoaded = true
1> CefSharpTargetDir =
1> CefSharpTargetDirAnyCpu32 = x86\
1> CefSharpTargetDirAnyCpu64 = x64\
1> CefSharpAnyCpuSupport =
1> RuntimeIdentifier =
1> EffectivePlatform =
1> Platform = x64
1> PlatformName = x64
1> Platforms =
1> PlatformTarget = x64
1> CefSharpPlatformTarget = x64
1> PlatformTargetAsMSBuildArchitecture = x64
1> TargetFramework =
1> TargetFrameworkVersion = v4.7.2
1> libcef.dll exists = bin\Debug\libcef.dll
1> CefSharpTransformXmlDllPath = D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\Web\Microsoft.Web.Publishing.Tasks.dll
1> NuGetProjectStyle =
1> NuGetToolVersion =
1> OutputType = WinExe
1> OutDir = bin\Debug\
1> Prefer32Bit = false
All the liks did was take me to a page that talked about ‘Gasic formatting syntext’ but no place to upload the text.
Thank You,
Richard B. Oberholz
Engineer
Intent Digital
602-404-0100 Ext: 25
Email: ***@***.******@***.***>
Web: www.intentdigital.com<http://www.intentdigital.com/>
www.votelynx.com<http://www.votelynx.com/>
From: Alex Maitland ***@***.***>
Sent: Monday, April 24, 2023 1:58 AM
To: cefsharp/CefSharp ***@***.***>
Cc: Richard B. Oberholz ***@***.***>; Author ***@***.***>
Subject: Re: [cefsharp/CefSharp] How to report a dependency issue with CefSharp.Core.Runtime? (Discussion #4468)
Get the DependancyWalker.net app from isindicic/DependencyWalker.Net: Show dependencies tree for .NET assemblies like old Depend Walker show it for non managed applications. (github.com)https://github.com/isindicic/DependencyWalker.Net and run it against the CefSharp.Core.Runtime.dll.
* Built DependancyWalker.Net from source
* Built MinimalExample from source (net472 solution)
* Opened CefSharp.Core.Runtime.dll from bin folder of MinimalExample, dll loaded without exception, listed dependencies as you'd expect.
I could not duplicate the problem using the ‘MinimalExample’.
How does your project/solution differ from the MinimalExample?
Checking this .dll with DependencyWalker.net, it reported that the CefSharp.Core.Runtime.dll has the problem.
Try running it against the bin output from the MinimalExample.
An attempt was made to load a program with an incorrect format. usually means you are loading the incorrect architecture dll.
If your application is x64 then I'd expect this error if it attempted to load an x86 dll.
You can add some debugging to your build output which might shed some light on what's going on.
Troubleshooting
Add the following to your csproj/vbproj file at the end
<Target Name="CefSharpAfterBuildDebug" AfterTargets="AfterBuild">
<CallTarget Targets="CefSharpAfterBuildDiagnostic" />
</Target>
Change your MSBuild project output verbosity to Normal:
1. Go to Tools->Options menu in VS
2. Open Projects and Solutions->Build and Run
3. Change the value of the MSBuild project build output verbosity. Pick Normal or higher
After you build, check the output window for a block of text that looks like:
Target CefSharpAfterBuildDebug:
Target CefSharpAfterBuildDiagnostic:
CefSharp After Build Diagnostic
CefSharpBuildAction = Content
CefSharpPropertiesLoaded = true
CefSharpTargetDir =
CefSharpTargetDirAnyCpu32 = x86\
CefSharpTargetDirAnyCpu64 = x64\
RuntimeIdentifier = win7-x64
EffectivePlatform =
Platform = x64
PlatformName = x64
Platforms = x86;x64;AnyCPU
PlatformTarget = x64
CefSharpPlatformTarget = x64
PlatformTargetAsMSBuildArchitecture = x64
TargetFramework = net472
TargetFrameworkVersion = v4.7.2
libcef.dll exists = bin.net472\x64\Debug\net472\libcef.dll
CefSharpTransformXmlDllPath = C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\Web\Microsoft.Web.Publishing.Tasks.dll
NuGetProjectStyle = PackageReference
NuGetToolVersion = 5.11.1
OutputType = WinExe
OutDir = bin.net472\x64\Debug\net472\
Prefer32Bit = false
Copy and paste the output here, making sure to format it for ease of reading.
* https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#quoting-text
* https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#quoting-code
—
Reply to this email directly, view it on GitHub<#4468 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ALZABXIRUL4MTEHTAKRSV2DXCY6CRANCNFSM6AAAAAAW67QHXM>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
DependancyWalker.Net application reports:
CefSharp.Core--->CefSharp.Core.Runtime - Error loading
System.BadImageFormatException: Could not load file or assembly 'CefSharp.Core.Runtime, Version=112.2.70.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138' or one of its dependencies. 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 'file:///F:_OneDriveBusiness\Intent Digital L.L.C\GUS CEF - Source Code\VoteLynx_VP_CEF\bin\Debug\CefSharp.Core.Runtime.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: 'file:///F:_OneDriveBusiness\Intent Digital L.L.C\GUS CEF - Source Code\VoteLynx_VP_CEF\bin\Debug\CefSharp.Core.Runtime.dll'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at SindaSoft.DependencyWalker.Walker.currentDomain_AssemblyResolve(Object sender, ResolveEventArgs e)
at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
This same dependency showed up on occasion in an app on loading CefSharp.WinForms.dll. Checking this .dll with DependencyWalker.net, it reported that the CefSharp.Core.Runtime.dll has the problem. This was first encountered with version 111.2.70.
I filled out information per the template instructions according to https://github.com/cefsharp/CefSharp/blob/master/.github/ISSUE_TEMPLATE/bug_report.md#bug-report.
I believe one submits a bug report to StackOverflow. However, nothing told me how to submit the report to StackOverflow.
You need better instructions.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions