ILRepack.Lib.MSBuild.Task icon indicating copy to clipboard operation
ILRepack.Lib.MSBuild.Task copied to clipboard

ILRepack.Config.props gets ignored.

Open Garonenur opened this issue 5 years ago • 7 comments

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.

Garonenur avatar Mar 26 '19 11:03 Garonenur

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.

uecasm avatar Mar 26 '19 23:03 uecasm

@Garonenur Does the suggestion from @uecasm fixed the issue? This shouldn't happen cause it is working fine in Project itself.

ravibpatel avatar May 14 '19 10:05 ravibpatel

I can't get the props configuration file to load at all.

replaysMike avatar Jul 29 '21 01:07 replaysMike

@replaysMike Are you adding it at root of project directory?

ravibpatel avatar Jul 29 '21 12:07 ravibpatel

@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.

replaysMike avatar Jul 29 '21 22:07 replaysMike

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 avatar Jul 29 '21 22:07 replaysMike

@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>

ravibpatel avatar Jul 30 '21 05:07 ravibpatel