WPF and EXE console applications in one solution

I have a WPF application that will be installed on several client PCs. I am using InstallShield Express Edition as a deployment tool for this.

I created another project (DLL) to track software installations. This is basically a standalone C # project that reads, writes, and performs some validation checks in the Windows registry and can be integrated into other WPF applications (this project / DLL will be useful for other applications).

What I want to do is create an .EXE file to register the installation. This .EXE not used in the main WPF application, but it uses the .DLL , which I just talked about above.

I managed to do this by creating another solution using one Console Application project and referencing the necessary DLLs. But I really want to create it as a project in my main application, and when I do this, the .EXE file other than the Main App executable is not created.

Is there anything I can do to get 2 .EXE files (main application and InstallationRegistration ) or the way I currently use the only way?

This is more of a nuisance than a problem, but still ... it will be the best way to track this small module in all the various applications that I have developed.

thanks

+6
source share
3 answers

By default, all intermediate compilation artifacts are placed in the obj folder in the framework of this project in the solution (I still donโ€™t know that this can be changed).

For project outputs, they are placed by default in bin \ Debug or bin \ Release, depending on the configuration of the assembly.

However, this can be changed from the project properties; on the "Assembly" tab there is an option "Exit path" to indicate the location of the output of the assembly.

This should be done on the basis of each project, but I usually create the SolutionDir \ bin folder under the Solution root and direct all the project output paths to SolutionDir \ bin \ Debug or SolutionDir \ bin \ Release, depending on the situation. This has the added benefit of reducing the overall size of SolutionDir by avoiding multiple copies of the output assemblies in large solutions with complex interdependencies between projects.

Does it help?

0
source

Are you saying that the console EXE was not created as part of the build / run solution?

Or is the console EXE not created as part of the InstallShield deployment project?

If you are referring to creating an EXE console as part of the build / run solution:

Usually, when you press F5, Visual Studio builds only those projects that you designate as Startup and their dependencies.

You will need to explicitly create this console application or the complete solution.

You can designate it as one of your startup projects if you want it to be built every time you press F5; or specify it as a dependency on the MainApp project (which is a bit of a hoax, but it does its job).

+1
source

Having tried several different ways, I got to this DUH !!! moment.

What happened is that VS created both .EXE files for the main application and the console application, only with each of them is in the corresponding Debug / Release folder

Example:

Main application -> C: \ Projects \ MyApp \ MyAppUI \ bin \ Debug \ MyAppUI.exe

Intallation Control.EXE -> C: \ Projects \ MyApp \ InstControl \ bin \ Debug \ InstControl.exe

NOTE. C: \ Projects \ MyApp is the solution folder.

Be that as it may, they are in their own folder, but, on the other hand, there should be an option in VS to choose where we want to send the whole .EXE solution

Hope this helps someone in the future.

+1
source

Source: https://habr.com/ru/post/979621/


All Articles