
Pitfalls of Unoptimized NuGet Packages
Summary You might unknowingly be using an unoptimized dependency which could impact the performance of your app. Now, it’s easy to get a warning if that happens, at build time, using the NuGet package UnoptimizedAssemblyDetector: <PackageReference Include="UnoptimizedAssemblyDetector" Version="0.1.0"> <PrivateAssets>all</PrivateAssets> </PackageReference> After you add this NuGet package, a warning will be included in your build if any unoptimized assembly is detected. The source code of project is hosted on GitHub ⭐. What’s the pitfall? The default build configuration for dotnet pack and dotnet publish is not Release as you might assume or expect. When publishing NuGet packages to nuget.org, one must explicitly make it a release package, like: dotnet pack -c Release. Without it, the assemblies packed will not be compiled with optimizations. In this blog post you’ll learn that’s not always the case. Even for those who know, accidents happens and a misconfigured build script can result in a Debug build ending up on nuget.org. ...




