Why Web Deployment Project deploys *.csproj files?

  • Thread starter Thread starter Max2006
  • Start date Start date
M

Max2006

Hi,



When I use Web Deployment Project to create a deployment image of my web
site, It includes un-necessaty files such as *.csproj files.



Can I disable the deployment of *.csproj files?



Thank you,

Max
 
When I use Web Deployment Project to create a deployment image of my web
site, It includes un-necessaty files such as *.csproj files.

Can I disable the deployment of *.csproj files?


1) Right-click on the WDP project in your solution and select "Open Project
File"

2) Scroll right down to the remmed out section at the bottom

3) Un rem the <Target Name="AfterBuild" section

4) Amend it so that it looks as follows:

<Target Name="AfterBuild" Condition="'$(Configuration)|$(Platform)' ==
'Release|AnyCPU'">
<Delete Files="$(OutputPath)\MyProject.csproj" />
<Delete Files="$(OutputPath)\MyProject.csproj.user" />
</Target>

Obviously, change MyProject.csproj to the actual name of your project... :-)
 
Thank you Mark for help.

Is there any reason that WDP actually deploys *.csproj files?

Regards,
Max
 
Is there any reason that WDP actually deploys *.csproj files?

Don't know...

WDP is a superb tool, but it's only about half-finished, IMO...

E.g. if you exclude a file from the project, it still deploys it...

If you exclude a code file from the project, the WDP no longer compiles...

Etc...
 
Thanks for Mark's nice tips.

Hi Max,

I think the reason "web deployment project include the csproj" files is it
is originally designed to target the ASP.NET 2.0 "web site" project model
which is project less(doesn't have project files). And the "Web application
Project" is started abit later after the "Web Deployment project", and
surely the WDP may have some drawbacks when dealing with "Web application
project"

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
Back
Top