4

I would like to add a console app as a reference to an asp.net project. Ideally I want them in the /bin folder (or in a sub folder in the web/output folder). Unfortunately, adding the console app as a reference will put the build output in /bin of the web project, but it will not generate the App.config file.

Does anyone know the proper way to include a console app in the build/publish process of an asp.net project?

Thank you,

herme 0
  • 912
  • 1
  • 9
  • 23
  • Are you trying to add a reference or just execute it as a separate process? – SLaks Feb 05 '18 at 22:01
  • I am trying to deploy an executable on the web server. There is another application on the server that will spawn a process to run it automatically. So yes, I will be running the executable in a separate process. I would like to avoid multiple steps publish to get everything on the server. – herme 0 Feb 05 '18 at 22:04

1 Answers1

3

Adding it as a reference will affect compilation, which is not what you want.

Instead, you should add a build step (to either project) to copy the EXE & config file to a directory of your choice.

You should also edit the solution to add the EXE as a dependency of the web project to make sure it builds first.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
  • Hello, would you know the solution to this ? https://stackoverflow.com/questions/48645724/why-do-i-get-the-error-no-access-control-allow-origin-header-present-on-the – TheProgrammer Feb 06 '18 at 14:55