Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work as described in readme #53

Open
Jdbye opened this issue Jun 7, 2024 · 4 comments
Open

Does not work as described in readme #53

Jdbye opened this issue Jun 7, 2024 · 4 comments

Comments

@Jdbye
Copy link

Jdbye commented Jun 7, 2024

You cannot simply install the NuGet package and it will automatically merge all of the dependencies.
it does nothing unless you create an ILRepack.targets file, which (as far as I can tell) requires manually defining the path of each dependency to merge.
It would be nice if it worked automatically, like the readme says, or at least was able to automatically detect the dependencies to merge, since it's easy to forget adding a newly added dependency to the targets file.

@ravibpatel
Copy link
Owner

The default targets file that is supplied with NuGet package should work with Release configuration. Can you tell me which .NET Framework version are you using, so I can try to reproduce it?

@Jdbye
Copy link
Author

Jdbye commented Jun 11, 2024

That may be my mistake as I assumed it would apply to both debug and release and I'm not sure if I actually tested the release build.
I am using a custom targets file with the debug symbols enabled, but is it possible to use a custom targets file without manually specifying the input assemblies?

@ravibpatel
Copy link
Owner

You can do just like I did it in default targets file. It will include the executable itself and all the DLL files in the output directory.

<Target Name="ILRepack" AfterTargets="Build">
	<ItemGroup>
		<InputAssemblies Include="$(OutputPath)$(TargetName)$(TargetExt)"/>
		<InputAssemblies Include="$(OutputPath)*.dll" Exclude="$(OutputPath)$(TargetName)$(TargetExt)"/>
	</ItemGroup>

	<ILRepack
		Parallel="true"
		DebugInfo="true"
		AllowDuplicateResources="false"
		InputAssemblies="@(InputAssemblies)"
		TargetKind="SameAsPrimaryAssembly"
		KeyFile="$(KeyFile)"
		OutputFile="$(OutputPath)$(TargetName)$(TargetExt)"
	/>
</Target>

@SolenoidMan
Copy link

Also does not work by default for me, does nothing. Using the recommended targets file outputs " not recognized". I tried everything recommended and I'm giving up on this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants