Communication lost between VueJS App and CEF Sharp when do a RDP - cefsharp

In my hybrid application which developed using C#, WPF, CEF, and VueJs.
On RDP, CefSharp loaded event is trigged and Vue JS components are loading fine.
But from Vue JS application the communication to C# is failing.
CEF Version : CefSharp.WPF 79.1.360
There are no issues when we run the same on the local computer. This issue observed only when we take a remote desktop.
Steps to reproduce the issue.
Application is running in a remote machine and we are accessing through RDP.
On the launch of the application, everything works fine.
After I disconnect the RDP and login after 1 hour, it tries to re-loads the page. UI looks fine and javascript able to call the web APIs.
Issue occurs in communication between Javascript to .net.
I tried to call the C# .net method from JS. I am getting error as undefined.
From JS when C# .net object is undefined, I have tried JavascriptObjectRepository_Resolve on IsLoaded event.
It also does not work.
Please let me know anyone encounters this issue and any workaround suggestions?

Related

Debugging a VB6 ActiveX DLL called via VBScript in a Classic ASP Application

Whelp, I avoided it as long as possible, but the time has finally come to make some changes to some ancient VB6 code. I'm a recent college grad so I was hoping to stay away from this code that is almost as old as I am.
The DLL is compiled in a local installation of VB6 and deployed via Component Services. That component is then called by VBScript in a Classic ASP application running on a windows 2003 Server.
I've tried just about everything to debug this code using the VB6 debugger, but I can't get it to work. I've compiled the DLL to the same location that Component Services has it deployed to (a random folder on a non-system drive), and set binary compatibility to that same DLL. Each class file has instancing set to MultiUse and MTSTransactionMode set to '1 - NoTransactions.' The component works fine until I attach the debugger, then I get 'ActiveX component can't create object' when trying to instantiate the object. If I detach the debugger, it works again.
I noticed that in Component Services when I attach the debugger, the DLL location changes to C:\Program Files\Microsoft Visual Studio\VB98\VB6DEBUG.DLL, which I assume is just VB6 intercepting calls to the component. When I detach the debugger, it changes back. I should also note that the component is configured to use a specific user identity separate from my logged-in user account, however everyone has been granted access to the component via a user role. The component activation type is also 'Server Application,' however setting it to 'Library Activate' doesn't seem to make a difference.
I've also tried using the VC++6 IDE, and VS2010, but had no luck. I was able to debug the dllhost.exe in VS2010 and was able to hit some breakpoints, but the symbols weren't loaded properly. I tried compiling the DLL with debugging symbols and loading those to the VS2010 environment via the Debug settings menu, however that didn't resolve the issue.
I also didn't find the component services JIT Debugger to be very useful. I'd much prefer to just be able to debug in VB6.
What amazes me most is that this code is thousands of lines and has been maintained without the use of any debugger whatsoever. My young, spoiled self isn't ready to accept that this code can't be debugged.

Run ActiveXObject COM component that creates dialogs under IIS in Asp.NET

I have a ASP.NET MVC app, hosted on IIS on a dedicated server. At some point I need to create a com activex component. I use Interaction.CreateObject from Microsoft.VisualBasic.Interaction for this.
The issue is that this activex component shows some dialogs when starting and waits until they are closed before actually registering as COM component.
I wrote some simple code that closes the windows via Windows API using FindWindowEx etc. and it works on a dev machine when hosted under VS, but it looks like on IIS these windows are never shown even in Windows API and ActiveX component just freezes waiting for dialogs to close that never exist.
I tried:
Using Process.Start and then Interaction.GetObject instead of Interaction.CreateObject
Setting AppPool in IIS to run from a real user identity
Setting Load User Profile to True in IIS
Using https://github.com/mj1856/SimpleImpersonation library to run the code as a user
I also looked in dcomcnfg (and this is my best bet on what I need to do). I thought I need to find my COM component there, and set Identity to specific user - but for some reason the ActiveX COM component I'm running does not exist there. I see "cannot register COM component" in Event Viewer if the component run crashes by timeout (because it waits for dialogs before registering as COM), - so I know AppID, but it does not exist in the list in dcomcnfg. Maybe because the ActiveX is exe, not ocx?
I know IIS is not supposed to run anything with windows, and it of course cannot show them, but I was at least expecting to see them with Windows API and being able to close them, especially given that the component waits for them to be closed, so they exist somewhere. I think I'm missing some clever setup on the server.

Page never loads

I have an ASP.NET MVC 4 application. When I run it and try to access it using a web browser, the browser never loads the page; it is left stuck in the loading state.
I've tried pausing the debugger, but it doesn't show any threads stopped in the application code:
It was working fine when the application was first created from the Visual Studio template. I'm not sure which aspects of the application are relevant to this. It's running Elmah for error logging, and it's running under the Visual Studio development web server.
I've tried accessing it using both Internet Explorer and Chrome, and they both have the same problem, so I don't think it's a browser-related problem.
This stopped happening after doing more code changes and switching to IIS Express. It seems that one of the MVC views was producing an error, but for some reason the debugger wasn't picking it up and the framework wasn't producing an HTTP response.

When compiling a project with SignalR I have to do a iisreset

I have an n-tier application which I have added SignalR functionality to. When I now compile my business layer I have to do a iisreset before the website can load again. It simply just keeps loading, and doesn't get anywhere. Even a kill on the w3wp process doesn't help this out.
I have tried and removed SignalR and then it works fine when compiling the backend. My guess is that a connection is made from SignalR to the server, and it is broken when the backend is compiled, which haults the site from doing a complete load.
Anything I might be able to do about this?
Are you developing on windows 7? If you are then don't as it only allows 10 concurrent connections. Use IIS express instead.

Failed to create a window when launching it through reflection from the console app

Im trying to launch a dialog by invoking several methods from a windows forms assembly. My app is a console app. All the execution logic goes well and without exceptions, but the window is not launched. Is it a known issue that you cant launch a windows form from a console app?
well, yes. You have to have a Windows message loop for this to work.
If you create a Forms application from scratch, you'll see the Program.cs module created with ... Application.Run(new YourMainForm()) in it. Run is basically the message pump - having that is pretty much a requirement for forms to work.

Resources