Why Web Deployment Project deploys *.csproj files?

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
 
M

Mark Rae [MVP]

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... :)
 
M

Max2006

Thank you Mark for help.

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

Regards,
Max
 
M

Mark Rae [MVP]

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...
 
S

Steven Cheng[MSFT]

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.
--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top