Open BryanCrotaz opened 1 year ago
You can suppress assembly harvesting by setting SuppressRegistry
to true
.
Leaving open to make a better error message.
But isn't the whole point of running the harvest to pick up all the assemblies in the folder? Why would I want to suppress that?
Setting SuppressRegistry
to true
suppresses registry harvesting, not the file harvesting.
I'm getting the error report for every assembly in the directory. Why would this be related to the registry?
Because registry harvesting loads the assembly.
Silly question, why is it called registry harvesting and not assembly harvesting?
And if I suppress it, won't that mean that my assemblies are ignored?
It will still generate File
authoring.
Ok this needs some documentation as to what Registry Harvesting actually does.
You've said disabling it will stop assembly harvesting but file harvesting still happens.
Sounds like this should be named FileHarvest and AssemblyHarvest instead.
However I'm completely confused as to what the difference is. From a packaging point of view assemblies are files. And why the word registry in there? I'm not giving it any registry keys to start from and it doesn't seem to be creating registry keys on the windows target machine. So the name doesn't make sense.
Assemblies can generate registry entries (see, e.g., regasm).
This definitely needs better documentation. None of this is covered.
And no clue why running harvest causes it to load a version of System.Runtime that I'm not using.
https://wixtoolset.org/docs/v3/msbuild/target_reference/harvestdirectory/
Just stumbled over the same error using HeatFile
where setting SuppressRegistry="true" did not help.
I'm using WixToolset.Sdk/5.0.2.
heat.exe : error HEAT5151: Could not harvest data from a file that was expected to be an assembly: mylibrary.dll. If this file is not an assembly you can ignore this warning. Otherwise, this error detail may be helpful to diagnose the failure: Could not load file or assembly 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
Bugs
If this issue is a bug:
4.0.0-rc.1
Visual Studio 2022
Using wixproj
.Net 6.0
Use HarvestDirectory
Every file fails with:
Failed to run heat.exe, can't find System.Runtime (using an old version)