postsharp / postsharp.community.packer Goto Github PK
View Code? Open in Web Editor NEWPacks all your .dlls into your main executable so it becomes standalone
License: MIT License
Packs all your .dlls into your main executable so it becomes standalone
License: MIT License
After dancing around with the same issue as #2 (eventually I just gave up and downloaded the standalone; every other method just eventually pointed to the downloads page - even the mentioned exe), I tried building my project in VS2019 Community with [assembly: Packer]
in the project as per the instructions, and PostSharp does note in the logs that it's alive during that process.
does not contain any aspect or other transformation.
For legacy reasons the project was initially targeting .NET Framework 4.6.1. The compiled release spewed out every single DLL the project had ever touched (and possibly some that it never touched) into the release folder.
I tried re-targeting to 4.7.2 and then again to 4.8 and a much milder version of the same thing occurred with both versions: extra DLLs were not packed, just dumped into the release folder. In this case the DLLs were limited to the expected DLLs used by the main exe, as well as a few PostSharp-related files. The same message appeared in the output log each time I built/rebuilt.
For good measure I:
[assembly: Packer]
into a different C# file in the project,using
statements to the relevant file(s),but ended up with a not-packed compiled program regardless of these efforts.
During compilation, the NuGet package complains about no valid license key been installed. Browsing the website postsharp.net does not lead me to any page or form to subscribe for a free license, besides that, the website states "No key required for community and trial." So is this package lagging behind changes in the license policy for PostSharp?
Hi,
By initializing any of the string[] fields in PackerAttribute.cs, Packer throws InvalidCastException when casting from Sytem.Object[] to System.String[].
Hello,
When I utilize PostSharp.Community.Packer
in conjunction with PostSharp.Patterns.Diagnostics
, entries are written to my log file which I assume are from PostSharp.Community.Packer
:
2022-06-28 12:22:22,849 INFO - DebugUtils | *** LOG STARTED ON Tuesday, June 28, 2022 at 12:22:22 PM.
2022-06-28 12:22:22,939 DEBUG - Parse.CommandLine([ "-?" ]) | Starting.
2022-06-28 12:22:22,942 DEBUG - CommandLineInfo..ctor() | Starting.
2022-06-28 12:22:22,943 DEBUG - CommandLineInfo..ctor() | Succeeded.
2022-06-28 12:22:23,037 DEBUG - ILTemplate.ResolveAssembly({Name:mysendmail.exe
There are no context policies.
}, {ResolveEventArgs}) | Starting.
2022-06-28 12:22:23,039 DEBUG - Common.ReadExistingAssembly({mysendmail.CommandLine.Actions.resources, Version=1.0.0.0, Culture=en-US, PublicKeyToken=null}) | Starting.
2022-06-28 12:22:23,042 DEBUG - Common.ReadExistingAssembly({mysendmail.CommandLine.Actions.resources, Version=1.0.0.0, Culture=en-US, PublicKeyToken=null}) | Succeeded: returnValue = null.
2022-06-28 12:22:23,047 DEBUG - Common.Log("Loading assembly '{0}' into the AppDomain", [ {mysendmail.CommandLine.Actions.resources, Version=1.0.0.0, Culture=en-US, PublicKeyToken=null} ]) | Starting.
2022-06-28 12:22:23,048 DEBUG - Common.Log("Loading assembly '{0}' into the AppDomain", [ {mysendmail.CommandLine.Actions.resources, Version=1.0.0.0, Culture=en-US, PublicKeyToken=null} ]) | Succeeded.
2022-06-28 12:22:23,063 DEBUG - Common.ReadFromEmbeddedResources([ {[alphafs, costura.alphafs.dll.compressed]}, {[fluentcommandlineparser, costura.fluentcommandlineparser.dll.compressed]}, {[log4net, costura.log4net.dll.compressed]}, {[mysendmail.commandline.actions, costura.mysendmail.commandline.actions.dll.compressed]}, {[mysendmail.commandline, costura.mysendmail.commandline.dll.compressed]}, and 7 more ], [ {[alphafs, costura.alphafs.pdb.compressed]}, {[fluentcommandlineparser, costura.fluentcommandlineparser.pdb.compressed]}, {[mysendmail.commandline.actions, costura.mysendmail.commandline.actions.pdb.compressed]}, {[mysendmail.commandline.interfaces, costura.mysendmail.commandline.interfaces.pdb.compressed]}, {[mysendmail.commandline, costura.mysendmail.commandline.pdb.compressed]}, and 1 more ], {mysendmail.CommandLine.Actions.resources, Version=1.0.0.0, Culture=en-US, PublicKeyToken=null}) | Starting.
2022-06-28 12:22:23,065 DEBUG - Common.LoadStream([ {[alphafs, costura.alphafs.dll.compressed]}, {[fluentcommandlineparser, costura.fluentcommandlineparser.dll.compressed]}, {[log4net, costura.log4net.dll.compressed]}, {[mysendmail.commandline.actions, costura.mysendmail.commandline.actions.dll.compressed]}, {[mysendmail.commandline, costura.mysendmail.commandline.dll.compressed]}, and 7 more ], "en-US.mysendmail.commandline.actions.resources") | Starting.
2022-06-28 12:22:23,066 DEBUG - Common.LoadStream([ {[alphafs, costura.alphafs.dll.compressed]}, {[fluentcommandlineparser, costura.fluentcommandlineparser.dll.compressed]}, {[log4net, costura.log4net.dll.compressed]}, {[mysendmail.commandline.actions, costura.mysendmail.commandline.actions.dll.compressed]}, {[mysendmail.commandline, costura.mysendmail.commandline.dll.compressed]}, and 7 more ], "en-US.mysendmail.commandline.actions.resources") | Succeeded: returnValue = null.
2022-06-28 12:22:23,067 DEBUG - Common.ReadFromEmbeddedResources([ {[alphafs, costura.alphafs.dll.compressed]}, {[fluentcommandlineparser, costura.fluentcommandlineparser.dll.compressed]}, {[log4net, costura.log4net.dll.compressed]}, {[mysendmail.commandline.actions, costura.mysendmail.commandline.actions.dll.compressed]}, {[mysendmail.commandline, costura.mysendmail.commandline.dll.compressed]}, and 7 more ], [ {[alphafs, costura.alphafs.pdb.compressed]}, {[fluentcommandlineparser, costura.fluentcommandlineparser.pdb.compressed]}, {[mysendmail.commandline.actions, costura.mysendmail.commandline.actions.pdb.compressed]}, {[mysendmail.commandline.interfaces, costura.mysendmail.commandline.interfaces.pdb.compressed]}, {[mysendmail.commandline, costura.mysendmail.commandline.pdb.compressed]}, and 1 more ], {mysendmail.CommandLine.Actions.resources, Version=1.0.0.0, Culture=en-US, PublicKeyToken=null}) | Succeeded: returnValue = null.
2022-06-28 12:22:23,068 DEBUG - ILTemplate.ResolveAssembly({Name:mysendmail.exe
There are no context policies.
}, {ResolveEventArgs}) | Succeeded: returnValue = null.
2022-06-28 12:22:23,069 DEBUG - ILTemplate.ResolveAssembly({Name:mysendmail.exe
There are no context policies.
}, {ResolveEventArgs}) | Starting.
2022-06-28 12:22:23,070 DEBUG - ILTemplate.ResolveAssembly({Name:mysendmail.exe
There are no context policies.
}, {ResolveEventArgs}) | Succeeded: returnValue = null.
2022-06-28 12:22:23,079 DEBUG - ILTemplate.ResolveAssembly({Name:mysendmail.exe
There are no context policies.
}, {ResolveEventArgs}) | Starting.
2022-06-28 12:22:23,080 DEBUG - Common.ReadExistingAssembly({mysendmail.CommandLine.Actions.resources, Version=1.0.0.0, Culture=en, PublicKeyToken=null}) | Starting.
2022-06-28 12:22:23,081 DEBUG - Common.ReadExistingAssembly({mysendmail.CommandLine.Actions.resources, Version=1.0.0.0, Culture=en, PublicKeyToken=null}) | Succeeded: returnValue = null.
2022-06-28 12:22:23,081 DEBUG - Common.Log("Loading assembly '{0}' into the AppDomain", [ {mysendmail.CommandLine.Actions.resources, Version=1.0.0.0, Culture=en, PublicKeyToken=null} ]) | Starting.
2022-06-28 12:22:23,082 DEBUG - Common.Log("Loading assembly '{0}' into the AppDomain", [ {mysendmail.CommandLine.Actions.resources, Version=1.0.0.0, Culture=en, PublicKeyToken=null} ]) | Succeeded.
2022-06-28 12:22:23,082 DEBUG - Common.ReadFromEmbeddedResources([ {[alphafs, costura.alphafs.dll.compressed]}, {[fluentcommandlineparser, costura.fluentcommandlineparser.dll.compressed]}, {[log4net, costura.log4net.dll.compressed]}, {[mysendmail.commandline.actions, costura.mysendmail.commandline.actions.dll.compressed]}, {[mysendmail.commandline, costura.mysendmail.commandline.dll.compressed]}, and 7 more ], [ {[alphafs, costura.alphafs.pdb.compressed]}, {[fluentcommandlineparser, costura.fluentcommandlineparser.pdb.compressed]}, {[mysendmail.commandline.actions, costura.mysendmail.commandline.actions.pdb.compressed]}, {[mysendmail.commandline.interfaces, costura.mysendmail.commandline.interfaces.pdb.compressed]}, {[mysendmail.commandline, costura.mysendmail.commandline.pdb.compressed]}, and 1 more ], {mysendmail.CommandLine.Actions.resources, Version=1.0.0.0, Culture=en, PublicKeyToken=null}) | Starting.
2022-06-28 12:22:23,083 DEBUG - Common.LoadStream([ {[alphafs, costura.alphafs.dll.compressed]}, {[fluentcommandlineparser, costura.fluentcommandlineparser.dll.compressed]}, {[log4net, costura.log4net.dll.compressed]}, {[mysendmail.commandline.actions, costura.mysendmail.commandline.actions.dll.compressed]}, {[mysendmail.commandline, costura.mysendmail.commandline.dll.compressed]}, and 7 more ], "en.mysendmail.commandline.actions.resources") | Starting.
2022-06-28 12:22:23,083 DEBUG - Common.LoadStream([ {[alphafs, costura.alphafs.dll.compressed]}, {[fluentcommandlineparser, costura.fluentcommandlineparser.dll.compressed]}, {[log4net, costura.log4net.dll.compressed]}, {[mysendmail.commandline.actions, costura.mysendmail.commandline.actions.dll.compressed]}, {[mysendmail.commandline, costura.mysendmail.commandline.dll.compressed]}, and 7 more ], "en.mysendmail.commandline.actions.resources") | Succeeded: returnValue = null.
2022-06-28 12:22:23,083 DEBUG - Common.ReadFromEmbeddedResources([ {[alphafs, costura.alphafs.dll.compressed]}, {[fluentcommandlineparser, costura.fluentcommandlineparser.dll.compressed]}, {[log4net, costura.log4net.dll.compressed]}, {[mysendmail.commandline.actions, costura.mysendmail.commandline.actions.dll.compressed]}, {[mysendmail.commandline, costura.mysendmail.commandline.dll.compressed]}, and 7 more ], [ {[alphafs, costura.alphafs.pdb.compressed]}, {[fluentcommandlineparser, costura.fluentcommandlineparser.pdb.compressed]}, {[mysendmail.commandline.actions, costura.mysendmail.commandline.actions.pdb.compressed]}, {[mysendmail.commandline.interfaces, costura.mysendmail.commandline.interfaces.pdb.compressed]}, {[mysendmail.commandline, costura.mysendmail.commandline.pdb.compressed]}, and 1 more ], {mysendmail.CommandLine.Actions.resources, Version=1.0.0.0, Culture=en, PublicKeyToken=null}) | Succeeded: returnValue = null.
2022-06-28 12:22:23,084 DEBUG - ILTemplate.ResolveAssembly({Name:mysendmail.exe
There are no context policies.
}, {ResolveEventArgs}) | Succeeded: returnValue = null.
2022-06-28 12:22:23,084 DEBUG - ILTemplate.ResolveAssembly({Name:mysendmail.exe
There are no context policies.
}, {ResolveEventArgs}) | Starting.
2022-06-28 12:22:23,085 DEBUG - ILTemplate.ResolveAssembly({Name:mysendmail.exe
There are no context policies.
}, {ResolveEventArgs}) | Succeeded: returnValue = null.
2022-06-28 12:22:24,918 DEBUG - Parse.CommandLine([ "-?" ]) | Succeeded: returnValue = {CommandLineInfo}.
2022-06-28 12:22:24,920 DEBUG - DebugUtils | Program.Main: Result = 0.
I suppose, in principle, this is a good thing, as it helps us diagnose if there are any issues with PostSharp.Community.Packer
; however, for my use case, I would like to disable/suppress logging for the PostSharp.Community.Packer
content.
Is there an aspect I can put in, e.g., my GlobalAspects.cs
file to in order to suppress the logging that is not from my own software?
Thank you.
Regards,
Brian Hart
This project utilizes PostSharp v6.6.6 modules, and the latest version of PostSharp is 6.10.13.
While embedding unmanaged assemblies, the following exception is thrown during startup of the application.
Application: XXX.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidProgramException
at PostSharp.Community.Packer.Templates.ILTemplateWithUnmanagedHandler..cctor()
Exception Info: System.TypeInitializationException
at PostSharp.Community.Packer.Templates.ILTemplateWithUnmanagedHandler.Attach()
at <Module>..cctor()
Exception Info: System.TypeInitializationException
Hi,
I installed the PostSharp.Comunity.Packer 1.1.0 successfully
(and also PostSharp 6.6.7 with full license)
Compile succeeded.
But when I added the [assembly: Packer]
I got an error: The type or namespace name 'PackerAttribute' could not be found (are you missing a using directive or an assembly reference?)
In the intellisence of PostSharp.Comunity.Packer I see only Templates:
What I missed?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.