Reputation: 21
I'm looking to apply aspects to all types within my .NET Core 2.0 project. The examples given on the PostSharp site all speak about the AssemblyInfo.cs file, but that does not exist for .NET Core projects.
I have tried putting the configuration into the .csproj file as suggested here but this does not allow me to pass in a non-string parameter, and I need to set the AttributeTargetTypes value prior to the string constant.
Has anyone managed to get this working for .NET Core 2.0? This is my first time using PostSharp and I am hopefully missing something obvious.
Upvotes: 1
Views: 86
Reputation: 21
Having returned to this, the main problem I appear to have had was that that I needed to reference the PostSharp nuget package in the consuming project as well as in the project holding the aspect. Once that was done the aspect worked as expected, and then as Daniel mentioned above I created a new .cs file with the aspect reference and this binded the attribute to the necessary classes.
Upvotes: 1