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

NetCore Native reflection works better when attributes are allocated #2979

Merged
merged 1 commit into from Oct 31, 2018

Conversation

snakefoot
Copy link
Contributor

@snakefoot snakefoot commented Oct 29, 2018

Makes it possible to setup a console application with minimal configuration:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <RdXmlFile Include="rd.xml" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.DotNet.ILCompiler" Version="1.0.0-alpha-*" />
    <PackageReference Include="NLog" Version="NLog.4.5.10.8565-PR2979" />
  </ItemGroup>

  <ItemGroup>
    <None Update="NLog.config">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>

</Project>

Rd.xml:

<Directives>
  <Application>
    <Assembly Name="mscorlib" />
    <Assembly Name="NLog" Dynamic="Required All" />
  </Application>
</Directives>

See pre-release-build here: https://ci.appveyor.com/project/nlog/nlog/builds/19896626/artifacts

@codecov
Copy link

codecov bot commented Oct 29, 2018

Codecov Report

Merging #2979 into dev will decrease coverage by <1%.
The diff coverage is 82%.

@@          Coverage Diff           @@
##             dev   #2979    +/-   ##
======================================
- Coverage     80%     80%   -<1%     
======================================
  Files        331     331            
  Lines      25715   25721     +6     
  Branches    3337    3337            
======================================
- Hits       20633   20611    -22     
- Misses      4140    4172    +32     
+ Partials     942     938     -4

@304NotModified 304NotModified added the enhancement Improvement on existing feature label Oct 31, 2018
@304NotModified 304NotModified added this to the 4.6 milestone Oct 31, 2018
@304NotModified
Copy link
Member

Thanks!

@304NotModified 304NotModified merged commit 9d33551 into NLog:dev Oct 31, 2018
@snakefoot snakefoot mentioned this pull request Jan 14, 2019
@snakefoot
Copy link
Contributor Author

Just tested with NetCoreApp3.1 and NLog works with this config:

    <PublishTrimmed>true</PublishTrimmed>
    <PublishSingleFile>true</PublishSingleFile>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>

Published executable for hello-world-app becomes 36,1 MByte.

Surprised this was not needed:

<ItemGroup>
  <TrimmerRootAssembly Include="NLog" />
</ItemGroup>

@snakefoot snakefoot deleted the NLogCoreNativeReflectionHelp branch April 4, 2020 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement on existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants