Boris, this is interesting. To accept the pull request we'll need to set up
an assignment agreement. Feel free to contact me off list and I'll get that
process started.
On Sat, May 11, 2013 at 3:33 PM, Boris Dachev <[email protected]> wrote:
> Hello Gents,
>
> While we were migrating from VS2008 to VS201x I found a problem with
> harvesting projects containing links to external files and more precisely
> if the link is not in the root level of the project but in a sub-folder.
>
> Following is an example of such project:
>
> <Project ...>
> ...
> <ItemGroup>
> <Content Include="..\..\FolderOutsideProject\SubFolder\File.ext">
> <Link>Subfolder1\SubFolder2\File.ext</Link>
> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
> </Content>
> ...
> </Project>
>
> If project is created in VS2008 and uses tools version 3.5 then link's
> sub-folder is properly recognized and heat generates sub-folders
> accordinglywhen creating corresponding
> Component entries. After migration to V201x and tools version 4.0
> sub-folders are not taken into account and corresponding Component
> entries are placed in the root directory.
>
> I tracked the problem down to VSProjectHarvester.cs file and more
> precisely to VSProjectHarvester.MSBuild40Project.Build() method which
> does not populate the dictionary of targetOutputs.
> I also studied the new approach used when building projects against tools
> 4.0 inside harvester and found a way to populate targetOutputs so it
> contains the same data as returned by the old approach used when building
> against 3.5 target.
>
> Following URL is a pull request with the changes made in 3.8 branch:
>
> https://wix.codeplex.com/SourceControl/network/forks/bdachev/ProjectHarverster/contribution/4702
>
> Please find attached the fix as a patch file if you prefer it that way.
>
> The code below (written in C# and without using reflection) illustrates
> how to populate targetOutputs:
>
> IDictionary<string, TargetResult> resultsByTarget =
> buildResult.ResultsByTarget;
> if (resultsByTarget != null)
> {
> foreach (string itemName in targetNames)
> {
> TargetResult result;
> bool hasKey = resultsByTarget.TryGetValue(itemName,
> out result);
> if (hasKey)
> {
> if (result != null)
> {
> ITaskItem[] items = result.Items;
> targetOutputs.Add(itemName, items);
> }
> }
>
> if (!targetOutputs.Contains(itemName))
> {
> targetOutputs.Add(itemName, new List<object>());
> }
> }
> }
>
> The patch itself is written using reflection as the rest of the code in
> VSProjectHarverster.cs to avoid references to MSBuild related assemblies.
>
> Hope it will be of some help!
> Best regards,
> Boris.
>
> PS: The patch also includes a fix for another problem of project harverst
> er related to winforms .resx files
>
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and
> their applications. This 200-page book is written by three acclaimed
> leaders in the field. The early access version is available now.
> Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
> _______________________________________________
> WiX-devs mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wix-devs
>
>
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
WiX-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-devs