Cefsharp works for x64 but no x86 v.108.4.13 - winforms

I was running cefsharp v91.1.21 and upgraded NuGet packages:
cef.redist.x64, cef.redist.x86 to 108.4.13
cefsharp.common and cefsharp.winforms to v108.4.130
Prior to upgrading I was targeting x86 and deployed through clickonce without issue.
After upgrading, my winforms project and everything works fine if I target x64 but when I target x86 the application crashes on Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null);
. Looking at the crash dump, all I see is:
Unhandled exception at 0x10CC6C48 (libcef.dll)
and the libcef.dll is version 108.4.13
I'm not quite sure how to troubleshoot this issue, any suggestions would be appreciated.
Target x86:
CefSharp After Build Diagnostic
CefSharpBuildAction = Content
CefSharpPropertiesLoaded = true
CefSharpTargetDir =
CefSharpTargetDirAnyCpu32 = x86
CefSharpTargetDirAnyCpu64 = x64
CefSharpAnyCpuSupport =
RuntimeIdentifier =
EffectivePlatform =
Platform = x86
PlatformName = x86
Platforms =
PlatformTarget = x86
CefSharpPlatformTarget = x86
PlatformTargetAsMSBuildArchitecture = x86
TargetFramework =
TargetFrameworkVersion = v4.8
libcef.dll exists = bin\x86\Debug\libcef.dll
CefSharpTransformXmlDllPath = C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\Web\Microsoft.Web.Publishing.Tasks.dll
NuGetProjectStyle =
NuGetToolVersion =
OutputType = WinExe
OutDir = bin\x86\Debug\
Prefer32Bit = true
Logging:
[0112/154303.980:ERROR:broker_win.cc(56)] Error reading broker pipe: The pipe has been ended. (0x6D)

I found the most consistent way to get this to work:
//add to app.config file with text editor and insert the following
<runtime><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><probing privatePath="x86"/></assemblyBinding></runtime>
// after the <configuration> line.
//and add the settings to cef:
var settings = new CefSettings();
settings.BrowserSubprocessPath = ExecutingAssemblyDirectory + "\\x86\\CefSharp.BrowserSubprocess.exe";
//add to .csproj
<PropertyGroup>
<CefSharpBuildAction>Content</CefSharpBuildAction>
<CefSharpAnyCpuSupport>true</CefSharpAnyCpuSupport> <CefSharpPlatformTargetOverride>AnyCPU</CefSharpPlatformTargetOverride>
</PropertyGroup>

Related

Setting downloads directory for chrome driver suddenly stopped working after upgrade

After I've upgraded my project to use latest java selenium webdriver 3.7.1 and latest chrome driver 2.33 I noticed that my tests dealing with Excel export started to fail.
After debugging I see that for some reasons downloads directory is not being set to custom location and instead the default one is used. Nothing shows up in logs or whatsoever.
Any help appreciated.
Setting downloads directory is like usual:
val prefs = Map(
"profile.default_content_settings.popups" -> Integer.valueOf(0),
"download.default_directory" -> downloadsDir,
"credentials_enable_service" -> false,
"profile.password_manager_enabled" -> false
)
val chromeOptions:ChromeOptions = new ChromeOptions()
chromeOptions.setExperimentalOption("prefs", prefs)
val d = new ChromeDriver(chromeOptions)
I use WebDriver 3.7.1 and Chromedriver 2.33 and of course Chrome v.62 (try check Your Version of Chrome), and I can download files.
I'm using folder
public static String javaIoTmpDir = System.getProperty("java.io.tmpdir")+"/autotest/";
and I create/clean it with script in TestNG annotation: #BeforeSuite
File theDir = new File(javaIoTmpDir);
// if the directory does not exist, create it
if (!theDir.exists()) {
System.out.println("creating directory: " + theDir.getName());
boolean result = false;
try{
theDir.mkdir();
result = true;
}
catch(SecurityException se){
se.printStackTrace();
}
if(result) {
System.out.println(javaIoTmpDir+" created");
}
}
FileUtils.cleanDirectory(new File(javaIoTmpDir));
}

I2C Disabled using Lightning Provider (DMMD) in Windows 10 IoT / Raspberry Pi 2

I just started looking into the Lightning provider and the first thing I tried by I2C and I found an issue. The I2C device (returned by DeviceInformation) shows it as DISABLED but when using the Inbox Driver shows as ENABLED.
I have a RBPi2 B with Windows 10 IoT 10.0.14393.67
I enabled DMMD Driver and created a simple program that makes reference to:
Microsoft.IoT.Lightning: 1.1.0
Microsoft.IoT.SDKFromArduino: 1.1.1
Also enabled the extensions:
Windows Desktop Extensions for the UWP: 10.0.14393.0
Windows IoT Extensions for the UWP: 10.0.14393.0
Modified Package.aspxmanifest with
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:iot="http://schemas.microsoft.com/appx/manifest/iot/windows10"
IgnorableNamespaces="uap mp iot">
....
<Capabilities>
<Capability Name="internetClient" />
<iot:Capability Name="lowLevelDevices" />
<DeviceCapability Name="109b86ad-f53d-4b76-aa5f-821e2ddf2141"/>
</Capabilities>
</Package>
And with the following code:
public MainPage()
{
this.InitializeComponent();
if (LightningProvider.IsLightningEnabled)
{
LowLevelDevicesController.DefaultProvider = LightningProvider.GetAggregateProvider();
}
CreateAsync();
}
private async Task CreateAsync()
{
var aqs = I2cDevice.GetDeviceSelector("I2C1");
var i2cDevices = await DeviceInformation.FindAllAsync(aqs);
var i2cDevices_ManualAQS = await DeviceInformation.FindAllAsync("System.Devices.InterfaceClassGuid:=\"{a11ee3c6-8421-4202-a3e7-b91ff90188e4}\" AND System.DeviceInterface.Spb.ControllerFriendlyName:=\"I2C1\"");
var allDevices = await DeviceInformation.FindAllAsync();
foreach (var device in allDevices)
{
System.Diagnostics.Debug.WriteLine($"{device.Id} - {device.Name}");
}
}
i2cDevices does not return any devices, but i2cDevices_ManualAQS returns 1 which is DISABLED (I manually changed the AQS to include enabled and disabled devices) and the allDevices shows there is a I2C1 device in it (\\?\ACPI#MSFT8000#1#{a11ee3c6-8421-4202-a3e7-b91ff90188e4}\I2C1)
If I changed the driver to Inbox Driver i2cDevices has 1 device and it is ENABLED.
So, either DeviceInformation is returning incorrect data or the I2C device is not enable with using Lightning.
I have already posted this message to the "issues" section for that repo, but posted here too just in case I was doing it wrong and it was not a bug.
Any ideas would be appreciated.
Thank you!

Unable to run application outside of Visual Studio

Our .Net 4.0 app that runs normally while hosted by VS always crashes while loading (less than 1 second after executing) while not debugging (both debug and release binaries).
The app contains 5 libraries (all of it with .Net 4.0) + NHibernate dependencies.
It does not even fire the UnhandledException event, it just crashes right away with a OutOfMemoryException (I could only see that with the Windows Event Viewer).
Event Viewer tells me that kernelbase.dll had a OutOfMemoryException, and
Fuslogvw.exe tells me that System.Core fails to load:
*** Input Assembly Binder Log (6/27/2016 # 15:41:54) ***
The operation failed.
Result of the Association: hr = 0x8007000e. Insufficient storage space to complete the operation.
Assembly Manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable C:\Users\User\Source\Manager\MySoftware\MySoftware.WPF.App\bin\Release\MySoftware.WPF.App.exe
---Follows a detailed log of errors.
=== Pre-Association state information ===
LOG: DisplayName = System.Core, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089
(Fully-specified)
LOG: Appbase = file:///C:/Users/User/Source/Manager/MySoftware/MySoftware.WPF.App/bin/Release/
LOG: initial PrivatePath = NULL
Logging: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = MySoftware.WPF.App.exe
Calling assembly: MySoftware.WPF. App, Version 1.0.0.0, Culture = neutral, PublicKeyToken = null.
===
LOG: this Association starts at the default load context.
LOG: using application configuration file: C:\Users\User\Source\Manager\MySoftware\MySoftware.WPF.App\bin\Release\MySoftware.WPF.App.exe.Config
LOG: using host configuration file:
LOG: using machine configuration file C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: post policy reference: System.Core, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089
LOG: assembly located by searching on GAC.
ERR: unrecoverable error during pre download verification (hr = 0x8007000e).
I have 4GB of RAM with 60% occupied, so maybe that's not the problem. Can you give me a hint where to look?

Atom + Xdebug setup

I'm trying to setup Xdebug because I'm tired of using echoes and var_dumps.
I'm using Atom as my IDE with the php-debug plugin.
I'm using the laravel Homestead vm as a server. forwarded port 9000 to 9999
Atom has the plugin installed with the following settings:
I set a breakpoint in Atom, I browse to my page but the breakpoint doesn't trigger.
I have a hunch that it has something to do with the IDE key but I don't know how to proceed.
Does anyone know the IDE key for atom?
Or is there something else I'm missing?
edit: I've added the following to xdebug.ini:
xdebug.auto_trace = 0
xdebug.collect_includes = 1
xdebug.collect_params = 1
xdebug.collect_return = 0
xdebug.collect_vars = "Off"
xdebug.default_enable = "On"
xdebug.dump.COOKIE = ""
xdebug.dump.FILES = ""
xdebug.dump.GET = ""
xdebug.dump.POST = ""
xdebug.dump.REQUEST = ""
xdebug.dump.SERVER = ""
xdebug.dump.SESSION = ""
xdebug.dump_globals = 1
xdebug.dump_once = 1
xdebug.dump_undefined = 0
xdebug.extended_info = 1
xdebug.file_link_format = ""
xdebug.idekey = "VVVDEBUG"
xdebug.manual_url = "http://www.php.net"
xdebug.max_nesting_level = 100
xdebug.overload_var_dump = 1
xdebug.profiler_append = 0
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_dir = "/tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "192.168.50.1"
xdebug.remote_log = /srv/log/xdebug-remote.log
xdebug.remote_mode = "req"
xdebug.remote_port = 9000
xdebug.show_exception_trace = 0
xdebug.show_local_vars = 0
xdebug.show_mem_delta = 0
xdebug.trace_format = 0
xdebug.trace_options = 0
xdebug.trace_output_dir = "/tmp"
xdebug.trace_output_name = "trace.%c"
xdebug.var_display_max_children = -1
xdebug.var_display_max_data = -1
xdebug.var_display_max_depth = -1
Like #sparkos72 says, the atom ide key xdebug.atom works for me on Ubuntu 16.04 and Debian 7 :-). I try to extend their answer.
I used php-debug atom extension with this config in the xdebug.ini (path: /etc/php5/apache2/conf.d/xdebug.ini).
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=172.17.0.1
xdebug.remote_port=9000
xdebug.idekey=xdebug.atom
xdebug.remote_autostart=true
I have a docker container with debian 7 + apache + php 5, that's the reason because I use ip 172.17.0.1 instead of 127.0.0.1. My "real" machine is an Ubuntu.
Hope it helps.
IDE key is xdebug.atom for me (mac/apache). In the Atom php-debug config, set the server port to 9000
None of the answers worked for me, so I'm leaving one of my own.
Setup
Make sure xdebug is enabled; sudo phpenmod xdebug or equivalent
Make sure xdebug is correctly configured:
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=172.17.0.1 (as per your setup)
xdebug.remote_port=9000 (as per your setup)
Didn't do xdebug.remote_autostart because it starts the debug stuff even for normal requests. So, even if you are not in the debug mode for the Chrome / Firefox extension, an attempt to convey debugging data will be made, which might slow things down without any reason.
Install Xdebug chrome/firefox extension and setup IDE Key as xdebug-atom (I found xdebug.atom to also be working).
Debugging
When you actually want to debug something,
Add a breakpoint where you want in your code; Alt + F9 or equivalent.
Open the PHP Debug panel in Atom; Ctrl + Alt + D or equivalent. If you are on certain versions Ubuntu, you might want to change the shortcut Ctrl + Alt + D might act as Show Desktop. In which case, click on the PHP Debug button in the IDE to toggle the debugger.
The debugger should say something like Listening to port 9000 or the port you setup in the PHP Debug settings.
Open the page you want to debug in your browser (if not already open) and click on the debugging extension icon to enable Debug mode. This actually sets a cookie in your document like XDEBUG_SESSION=xdebug-atom, etc.
Once the debug extension is enabled, refresh the page and you should be able to use the debugger (if everything went right).
Hope this helps. Took a while to get it working. Now I don't have to buy PHP Storm!
I know it is late but again:
Your .ini file have this:
xdebug.idekey = "VVVDEBUG"
which means you need to set the value "VVVDEBUG"(without quotes) in "The Easiest Xdebug" extension settings where you use "Atom" currently
IDE key is xdebug-atom for me on PHP3.2+ ATOM+ XAMPP+ XDEBUG Helper, strongly recommending to use XDEBUG Helper, you could set IDE key there.
I was trying the same thing, but never I found a real solution and I saw that xdebug started debug when find a error exeption I started put error in my code when I need debug and works well, example put this code in the line that you want debug.
#xdebug_start:
and watch the magic.
I did a video installing the plugin.
https://www.youtube.com/watch?v=jD0TIzYMFzQ

bug in aspnet_compiler?

I have a solution with several web projects.
I have built each project into its own folder (there's about 10 projects):
/build/projA
/build/projB
/build/projC
If I call
aspnet_compiler -v / -p \"build/#{proj}\" merged/#{proj}
on each one in turn, everything is fine.
If I make all 10 calls to aspnet_compiler in parallel, I get assembly loading errors, saying the referenced assemblies are in use.
Is this a bug? Why would it be in use? It shouldn't be.
The assemblies that cant be loaded are in multiple projects, but each one has its own copy in its bin folder.
Update: it seems to occur (for some) of the assemblies that are references of references. Those loaded with complete binding information seem to work.
Here's a dump from one of the failed loadings from fuslogvw
The operation failed.
Bind result: hr = 0x80070020. The process cannot access the file because it is being used by another process.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = andrew.bullock
LOG: DisplayName = Yahoo.Yui.Compressor
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Yahoo.Yui.Compressor | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///E:/build/ProjA/
LOG: Initial PrivatePath = E:\build\ProjA\bin
LOG: Dynamic Base = C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\src_projects_proja\061ad2e7
LOG: Cache Base = C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\src_projects_proja\061ad2e7
LOG: AppName = 627cc9a9
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: E:\build\ProjA\web.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/src_projects_proja/061ad2e7/627cc9a9/Yahoo.Yui.Compressor.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/src_projects_proja/061ad2e7/627cc9a9/Yahoo.Yui.Compressor/Yahoo.Yui.Compressor.DLL.
LOG: Attempting download of new URL file:///E:/build/ProjA/bin/Yahoo.Yui.Compressor.DLL.
LOG: Assembly download was successful. Attempting setup of file: E:\build\ProjA\bin\Yahoo.Yui.Compressor.dll
LOG: Entering download cache setup phase.
ERR: Error extracting manifest import from file (hr = 0x80070020).
ERR: Setup failed with hr = 0x80070020.
ERR: Failed to complete setup of assembly (hr = 0x80070020). Probing terminated.
If you call the ClientBuildManager directly, outside of aspnet_compiler there doesn't seem to be a problem, no idea why.
var parameter = new ClientBuildManagerParameter
{
PrecompilationFlags = PrecompilationFlags.ForceDebug
};
var client = new ClientBuildManager("/", src, dest, parameter);
client.PrecompileApplication();

Resources