Embeds dependencies as resources so that you can have a standalone executable.
This add-in only works under .NET Framework. In .NET Core, we recommend instead upgrading to .NET Core 3 or later and use the single file executable feature.
May 27, 2020. We've covered this add-in in a blog post.
This is an add-in for PostSharp. It modifies your assembly during compilation by using IL weaving.
Your project would normally result in MyProject.exe
which requires Newtonsoft.Json.dll
and Soothsilver.Random.dll
as dependencies because you used those NuGet packages.
If you use this add-in, instead those two DLLs will be embedded into MyProject.exe
as resources and loaded from there.
- Install the NuGet package:
PM> Install-Package PostSharp.Community.Packer
- Get a free PostSharp Community license at https://www.postsharp.net/essentials
- When you compile for the first time, you'll be asked to enter the license key.
- Add
[assembly: Packer]
somewhere in your code.
You can then distribute just the main output assembly file. It will be enough.
There are documented configuration options in the Packer attribute. Set them in your source code to change them from their defaults.
Published under the MIT license.
- Copyright © PostSharp Technologies, Simon Cropp, and contributors
- Icon by goescat, https://www.iconfinder.com/goescat, licensed under CC BY 3.0