This is a migrated thread and some comments may be shown as answers.

Add and run a WPF project to an existing solution

1 Answer 1050 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
n/a
Top achievements
Rank 1
n/a asked on 12 Oct 2020, 02:10 PM

Hi,

This is a more general question, not about Telerik controls though I am using them.
(VISUAL STUDIO 2019)
I have a VSTO project (I think the question can be for Winforms projects as well).
I have a WPF project that I want to interact with from the VSTO project and back.
I managed to run (process.start with parameters) the the WPF exe from the VSTO but it's not good enough because I want to be able to communicate between the two projects.
I added the WPF project to the VSTO solution, and added a reference from the VSTO to the WPF and then create a "common project" that both projects reference to be able to pass data in common models.
I am able to run the WPF project from the VSTO (when the user clicks a button, in the UI of the VSTO, I call App.Main() in the WPF project).
The problem is that if I try to use App.Main() again (to call the WPF project again) I get an exception because I can not create a second Application in the appdomain.
Any thoughts on how I can accomplish this (my way or any other way that will let me interact between the two projects).
Thank you
Yaron

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 15 Oct 2020, 09:45 AM

Hello Varda,

You can find a similar question in the following stackoverflow topic: https://stackoverflow.com/questions/5923779/multiple-calls-of-application-run-in-wpf

I also found that this question was already posted in the MSDN Q&A section and an answer was provided. I hope that helps someone else with the same issue too.

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
n/a
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or