Coder Social home page Coder Social logo

postsharp.community.packer's People

Contributors

addabis avatar gfraiteur avatar silversharp avatar soothsilver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

astrohart

postsharp.community.packer's Issues

Code needs to be cleaned up

  • Need to remove unused usings
  • The names of all unit test classes must end in *Tests not *Test
  • Use var where possible along with other modern C# 7.3 syntactic sugar features
  • Alphabetically arrange members by modifier, then type, then name

Compiled program is not actually packed (.NET Framework 4.6.1, 4.7.2, 4.8)

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:

  • restarted VS twice,
  • tried putting [assembly: Packer] into a different C# file in the project,
  • tried building the project with both the default Debug and Release presets,
  • tried adding using statements to the relevant file(s),
  • tried cleaning the projects,
  • tried manually wiping some of the files,
  • tried unloading projects with no related references,
  • tried straight up removing said projects from the solution,
  • tried updating the versions of PostSharp and PostSharp.Redist that Nuget auto-downloaded for PostSharp.Community.Packer (to 6.9.7, from 6.6.6(?)),
  • tried poking around the settings for PostSharp

but ended up with a not-packed compiled program regardless of these efforts.

License key required?

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?

Suppress logging to PostSharp.Patterns.Diagnostics

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

System.TypeInitializationException during runtime when embedding Unmanaged Assemblies

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

The Packer Attribute is unknown

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:
image

What I missed?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.