Question

I have a visual studio 2005 solution which has a web application and a class library project. The web application has a reference to the library project. I'd like the library project's code documentation XML to output to the web application's bin folder, along with the library's DLL. I can't seem to find any easy way of doing this.

Was it helpful?

Solution

Post-build step, perhaps? A bit ugly, but I think it would work.

OTHER TIPS

Use a post build event on the library project that will copy the Xml file to the web application's bin folder.

For example you could use something like: copy $(TargetDir)\ $(SolutionDir)\

This is untested so you'll prolly need to tweak it.

Not sure if this was possible in VS 2005, but in VS 2010:

Right click on your xml file and go to properties Change "Copy to Output Directory" to "Copy if newer" or "Copy always"

Here is the post-build command that worked:

copy "$(TargetDir)$(TargetName).xml" "$(SolutionDir)MyWebProject1\bin\$(TargetName).xml"
copy "$(TargetDir)$(TargetName).xml" "$(SolutionDir)MyWebProject2\bin\$(TargetName).xml"

A couple of problems inherent with this solution:

  • The xml is always copied even if that website is not part of the current build... so the documentation can get out of sync with the the dll in the bin folder until the next time that web project is built.
  • If we add a new web project that refers to this library, we need to add another post-build command, rather than having this all happen automatically.

I'm accepting this as a kludgy but workable solution... if anyone has a more elegant suggestion, please let me know!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top