.net - Obtain output files from a MSBuild project -


Is it possible to get a list of all output files from an MSBuild project?

Simple project, I

  & lt; Include CreateItem = "$ (OutputDire) ** \ *" & gt; & Lt; Output ItemName = "AllOptups" WorkPameters = "Include" /> & Lt; / CreateItem & gt;  

But my projects are part of a larger construction, and all the outputs go to a normal location, I want to be able to exculde dlls and content that is not related.

Any thoughts?

After looking at my comment, I realized that I tell you the wrong thing really needs it There is an interesting problem on hands.

If you do not mind editing the project file, you may be able to get pretty close for whatever you want. An item is flywears that keeps track of all files that were written during the build process. To start playing with this AfterBuild target

  & lt; Target name = "afterbild" & gt; & Lt; Message text = "file-source: @ (file-world)" value = "high" /> & Lt; / Target & gt;  

There are some problems with this approach

  • You must edit the project file manually
  • There should be files written in it Intermediate output DIR (i.e. obz ) and output dir (i.e. bean )
  • if optimization is created, then it is not necessary to write them On

You can think that you can solve the first problem with technology and after creating a build, FileWri Tes items can output. This will only work if the cover projection file was placed in the same folder as the original project because all items in a .csproj file have been declared with relative paths. So for the most part it goes.

You can obtain the second limit only by using the FindUnderPath function to get the files kept in the outputpath folder.

What you can do, but is not really reliable either in the beginning of construction is to check the output path and then once again on the end of the construction see what was added. Let's say that you have put the original files in an item StartFiles and by putting all the files in an item called Endfile at the end of the build you could:

  & lt; Goal Name = "Some Goals" & gt; & Lt; ItemGroup & gt; & Lt; Include files written = "@ (andfile)" /> & Lt; Remove files removed = "@ (startfile)" /> & Lt; / ItemGroup & gt; & Lt ;! - Now files are written in the endfile & amp; StartFiles - & gt; & Lt; / Target & gt; In short, I'm not sure whether there is a good solution that does not include custom work or custom logger: (. 

Saeed Ibrahim Hashimi

My Book:


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -