ILRepack.Lib.MSBuild.Task
ILRepack.Lib.MSBuild.Task copied to clipboard
ILRepack.Config.props gets ignored.
The documentation (which is very sparse btw) says, put the config in the project. But the file gets ignored if I build the whole solution.
Did you try closing and reopening the solution after adding the file? Top-level property imports seem to get cached and don't update properly unless you reload the solution.
@Garonenur Does the suggestion from @uecasm fixed the issue? This shouldn't happen cause it is working fine in Project itself.
I can't get the props configuration file to load at all.
@replaysMike Are you adding it at root of project directory?
@ravibpatel yep. The project, not the solution root. It's weird because at first it worked when it was not loading the .targets file, when I fixed that the configuration no longer worked. Tested this using the ClearOutputDirectory option which stopped cleaning the merged assemblies.
if you wish to see yourself, it's used in the latest version of AnyClone - I removed the config file in the source but easy enough to add in for testing.
@replaysMike It happens cause when you provide your custom targets file it assumes you want full control of the ILRepack procedure, so it doesn't do the cleaning. It only works when using the default targets file that comes with the package. You can add cleaning task in your ILRepack.targets. Just add the following after line 20 in your ILRepack.targets.
<Target
AfterTargets="ILRepacker"
Name="CleanReferenceCopyLocalPaths"
Condition="$(Configuration.Contains('Release'))">
<Delete Files="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')" />
<ItemGroup>
<Directories Include="$([System.IO.Directory]::GetDirectories('$(OutDir)%(DestinationSubDirectory)', '*', System.IO.SearchOption.AllDirectories))" />
<Directories>
<Files>$([System.IO.Directory]::GetFiles("%(Directories.Identity)", "*", System.IO.SearchOption.AllDirectories).get_Length())</Files>
</Directories>
</ItemGroup>
<RemoveDir Directories="@(Directories)" Condition="%(Files)=='0'" />
</Target>