I have some xml documentation files in my bin directory corresponding to referenced dlls. I want to keep the benefits of having the good intellisense while developing, but I'd like to exclude the xml from my deployment package to reduce its file size. Is there a way to prevent that file from being included in the azure cspkg file, but still keep the good intellisense?
Asked
Active
Viewed 1,439 times
3
-
Any better answer than the one below? – Guy Apr 02 '12 at 17:09
-
1Really? I have the exact opposite problem. I WANT to publish the XML documentation for my Web API as it drives my help page, but I can't get MSDeploy to include it in the deployment. – Raymond Saltrelli Feb 01 '13 at 22:21
1 Answers
1
The simplest way to do this would be to add a Post-Build Event to delete all XML Files from the output directory. This would run before the package file is created.
In your post build event you would want something like....
if $(ConfigurationName) == Release DEL "$(TargetDir)*.xml"
That should get rid of these files before it is packaged up.

David Steele
- 3,433
- 21
- 23
-
Did this work for you? Or do you need any more help. If it worked please mark this as an answer. – David Steele Jun 29 '11 at 10:45
-
Sorry, this doesn't work. If I do a regular build, of course the xml file is deleted from the Web Project's bin and it does not appear in the Azure Project's output directory either. However, if I do a publish in order to generate the cspkg file, the xml shows up in the Azure project's output directory and the cspkg file still contains the xml file (as indicated by there being no change to the cspkg file size). It seems that the post-build event is ignored when doing a publish. – gilly3 Jul 05 '11 at 20:39
-
I have to be honest and say I didnt check this it just seemed like it would work. Check out this post http://stackoverflow.com/questions/1360579/post-publish-events where it talks about post publish events. However a quick look at the msdn article shows there is a BeforePublish build target. – David Steele Jul 06 '11 at 06:34