Skip to content

Detects the use of unoptimized .NET assemblies in your project

Notifications You must be signed in to change notification settings

aalmada/unoptimized-assembly-detector

 
 

Repository files navigation

Alerted Snail

Unoptimized Assembly Detector

build NuGet

NuGet package that detects when assemblies compiled without the -optimized flag are added to a project and warns you about it.

How does it work?

This project hooks into the build process and detects if any referenced assembly was compiled in Debug mode.

UnoptimizedAssemblyDetector in action

Add to your project:

<ItemGroup>
  <PackageReference Include="UnoptimizedAssemblyDetector" Version="0.1.0" PrivateAssets="All" />
</ItemGroup>

Motivation

It's surprising to many that dotnet publish and dotnet pack compile assemblies in debug mode. This means that unless you've specified -c release, you're building .NET assemblies without the -optimize compiler flag.

With this package, you can get warned if one of your dependencies is being built in Debug mode and published to nuget.org. It can warn any referened assembly, not only added through NuGet.

Now that you know about it, you can communicate to the author of the dependency. Wait until a fix is shipped, you can ignore the warning for said package, roll back to an older version or chose another dependency.

Acknowledgements

About

Detects the use of unoptimized .NET assemblies in your project

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 77.6%
  • PowerShell 12.4%
  • Shell 10.0%