winforms icon indicating copy to clipboard operation
winforms copied to clipboard

Web Browser control object creation give me error when application in multi threaded mode

Open shishiraltysys opened this issue 1 year ago • 6 comments

.NET version

.net 7

Did it work in .NET Framework?

Yes

Did it work in any of the earlier releases of .NET Core or .NET 5+?

Not sure about it

Issue description

image

If I was creating object inside separate single thread mode, but after creating these object i need to add these control in another window control i.e. (Spilite Container) panel.

Steps to reproduce

I have 2 thread when open any form, one is main thread that basically a communication thread a Pipe communication and then UI thread responsible for UI forms. Please help me. If you need anything please let me know

shishiraltysys avatar Feb 13 '24 15:02 shishiraltysys

@radical @shanselman @AArnott @timheuer Please help me this one is the blocker for me

shishiraltysys avatar Feb 13 '24 15:02 shishiraltysys

@shishiraltysys Please do not mention github user accounts that you don't personally know or that don't work on the repo you're on. I for one do not work on winforms, and I know at least some others you mentioned don't either. It just creates noise for us and there's really nothing we can do to help you here.

AArnott avatar Feb 13 '24 15:02 AArnott

@shishiraltysys Can you provide more detailed repro steps so we can understand the scenario a bit more? Ideally a sample project would be helpful here that shows it was working in Framework then moving to .NET 7 it no longer works.

lonitra avatar Feb 14 '24 21:02 lonitra

@lonitra Sorry for the delay, I have created POC and attached here. POC Detail In POC we have 3 application

  1. Net Framework Application [Legacy]
  2. Net 7 Application [New]
  3. Net standard [communicator in between both app]

Steps

Step 1: Run both the [Legacy] & [New] App parallel Step 2: Click on Button in [Legacy] App, It's called namepipeclient and pass message to [New] app message Received function Step 3: You can see message "NET7 Message Received," and then I am creating the object of Web browser You can see I am getting the above error Step 4: This is not part of this POC, but I also tried to open a new form object here, and in that form, i created a web browser object and got the same error.

I hope this will help you. WebBrowserLauncher.zip

shishiraltysys avatar Feb 19 '24 16:02 shishiraltysys

@shishiraltysys Thank you for the repro steps! I am able to repro what you are seeing. Looking at the code, I am not so sure we had this working on .NET Framework. In issue you mentioned that this was working in .NET Framework, could you clarify how this was working for you in Framework?

lonitra avatar Feb 26 '24 18:02 lonitra

This submission has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 14 days.

It will be closed if no further activity occurs within 7 days of this comment.