views:

196

answers:

1

I want a particular file copied in with the published output of my web project. I tried changing the Build Action to Content and changing the Copy to Output Directory to Copy always. This works fine except that it buries it down in a sub folder the same way it is in the project.

I do not want it buried down in a sub folder. I want it sitting right next to the rest of of the published output. I thought I might instead handle this problem using the AfterPublish Target.

Can someone show how I might do this? I think I'd need to know the path that the person selected in the Publish dialog somehow.

+3  A: 

The Publish feature is unfortunately buried deep inside of Visual Studio itself. Because of this you are very limited in what you can do to extend the process. Because of this even a simple task as you have outlined here is not really possible, at least from your project file. If you need to get better control of your Web Deployments I would suggest that you take a look at Web Deployment Projects and/or MSDeploy. What I would do it add a Web Deployment Project which will prepare your Web App for deployment, including this custom file copy, and then allow MSDeploy to perform the actual deployment for you.

Sayed Ibrahim Hashimi