Create Setup file for .Net Core Apps

Viewed 630

In my .Net Core App I want to create a setup file (.msi), but I struggle with the correct configuration.

When I simply take all files from my debug folder and put them inside my "Application Folder" it works, but that's not how Microsoft (I guess) and me want it to work.

Mainly I have two problems:

  1. When I take the "Primary output" of my project and create a Shortcut to this, the Shortcut tries to start the .dll instead of my .exe file.

enter image description here

  1. When I create the .msi file and install my project there is no "runtimes" folder and I manually need to create it inside my "Application Folder". Is there a way to automatically include it into my .msi?

Thanks for your advice!

2 Answers

If you want to be able to install the necessary run time for a framework-dependent .NET Core 3.1 app, you can do this using prerequisites.

  • Open properties dialog of your installer project.
  • open the Prerequisites dialog and Select prerequisites.

enter image description here

I did some tests and I think I can reproduce your first problem. According to this document: Workflow changes for .NET Core 3.1, the correct output for .NET Core project seems changed. Though the document is for .NET Core 3.1, I think it also works for .NET Core 5.0.

So, please try to select Publish Items instead of choosing Primary output when you adding project output.

For the second problem, I am not very sure. Maybe Add > File.../Folder can work.

I suggest you also start a thread here: Microsoft Visual Studio Installer Projects - Q&A to ask this question.

Related