0

I developed an app in c#. The solution contains several projects among which :

  • a wpf project for the front
  • a consol app called "web" that exposes the backend through a collection of API (I used the "ASP.NET Core Web API" Template)

From Visual Studio, When I launch the App, I use "multiple startup projects" so Visual Studio launches the web project (the backend) and launches the WPF project (the frontend) in parrallel.

I want to package my app. For the moment, I dont want to publish it on the Windows store, just packaging it locally which is called sideloading. I did it and it ended successfully. I then install the app from the package on my local machine.

Problem: When I start my app I just have the consol running. I checked from Postman and my web project correctly runs. But the WPF app is not started.

In the project related to packaging (I called it installer), I have specified the appxmanifest, the temporarykey.pfx and in Dependencies->Applications I can find my two projects (wpf and web)

When I right click on wpf, I can select "set as entry point". When I repack my app, then the wpf project launches, but not the console for the backend anymore. Indeed, when I select "set as entry point" then the web project is not an entry point anymore.

So my question is : How can I/Is it possible to package an App with several entry points ?

screenshot of my solution

Felix
  • 13
  • 3

1 Answers1

0

I am going to assume you are using ClickOnce when you publish since you mentioned side-loading. ClickOnce is really finicky about multiple exe's in a single package (Just one of many security mechanisms that can possibly get in your specific way)

You can read more about some of the pain points here:

Windows Store has many of the same security restrictions when publishing so familiarizing yourself if you plan on using it for distribution.

Other options are packaging your MSI yourself using WIX or other installer frameworks.

If your WPF app is dependent on the console app, I suggest you convert it to a Worker Service so its always running without needing to be launched.

Anthony G.
  • 452
  • 2
  • 7