How to include another Console Application exe project on Asp.Net?

I have two projects: .Net 4.0 Console Application and Asp.Net 4.0 Website (they are in one solution). Now I want to include the console application (its .exe) in the web application, because I need to run it on the server when the user clicks on a specific button.

Now I would like to enable it so that the console application is updated whenever I recompile the solution, so it remains relevant.

So ... how to include my .exe in my web application?

Ps. Link does not work: enter image description here

+5
source share
3 answers

Have you tried simply adding it as a "Project Reference" to your project website ? Right-click the website project, select "Add Link ..." and click on the "Projects" tab.

A quick test showed that by doing this, the console application project (.exe) was copied to the / bin folder on the website when I built the solution.

You can then use standard deployment mechanisms to ensure that this is copied to the server at the same time as other libraries.


Sorry, you're right, this does not work with the WebSite project, only with Web Applciation .

"Post Build" , -.

"" , "".

"Build Events" " " :

xcopy "$(TargetDir)$(TargetFileName)" "c:\users\[UserName]\Documents\Visual Studio 2010\Websites\[ProjectName]\bin\" /D /S /I /Y

PDB , :

xcopy "$(TargetDir)$(TargetName).*" "c:\users\[UserName]\Documents\Visual Studio 2010\Websites\[ProjectName]\bin\" /D /S /I /Y
+6

Output type

, , , . .

+1

exe , .

0
source

All Articles