I have a console project in my solution.
Now I want that exe of that project should be added to my main project post deployment using web deploy.
How can I achieve that?
Regards,
Gautam
I have a console project in my solution. Now I want that exe of
Share
There are two high level solutions for this:
Option 1: Copy the file into App_Data
You can copy the exe into the App_Data folder as part of a post build event or as part of the script below. It’s your choice.
Now that it’s there, we have another problem. The WPP only includes files that are part of the project when it deploys. To get around this, you can create a
WebProjectName.wpp.targetsfile to the root of the web application with the following contents:(You could just as easily skip the interim step and copy the exe from it’s original home into the
$(WPPAllFilesInSingleFolder)folder)Option 2: Include the exe as a separate provider
This one requires a bit more understanding of msdeploy, but gives you the option to deploy the exe wherever you want on the target server.
Basically it involves adding an additional
dirPathprovider in the deployment. Again, add a wpp.targets file in the root:You’ll also need to replace the path in your pubxml to specify where the exe will go on the far end: