Improved NuGet Integration

NuGet became an essential part of the development for .NET platform over the recent years, as it provided the convenience of creating and consuming the packages.

The packages are easy to discover and use with the help of Package Manager UI in Visual Studio. In reality, adding a package reference to a project often comes down to a single line:

<Project>  
  ...
  <ItemGroup>
    <!-- The line below adds Contoso.HelpfulLibrary NuGet package to the project -->
    <PackageReference Include = "Contoso.HelpfulLibrary" Version = "1.3.0"/>
  </ ItemGroup>
  ...
</Project>  

Once the package reference is in place, Contoso.HelpfulLibrary can be used by the code.

NuGet does all the heavy lifting. It automatically downloads the package (if it is not downloaded yet), adds an assembly reference to the project, copies required package files at the build time and so on.

Development tends to be much easier with NuGet. And even more so since it also allows to consume tools.

Back in 2014, in addition to .msi setup file, we started to distribute Eazfuscator.NET as a NuGet package. It was essential for build servers as they often prohibited direct software installations. We chose to host Eazfuscator.NET package at a private NuGet server. The integration with the package was made at the solution level, so every protected project would share the same version of Eazfuscator.NET. It did the job and looked good, at first.

The time revealed some significant imperfections. One of them was related to new PackageReference format that had to replace an older packages.config. The new format had no support for solution-level NuGet packages. It meant that some newer project types such as .NET Standard and .NET Core could not consume Eazfuscator.NET as a package. Also the original package did not play well with NuGet restore operation due to implementation specifics. Finally, as NuGet was gradually becoming a more mature technology, we faced a considerable demand for a public Eazfuscator.NET package at nuget.org.

The new Eazfucsator.NET 2019.1 takes it all to the perfect state:

  • Eazfuscator.NET package is publicly hosted on nuget.org
  • Both PackageReference and packages.config formats are supported out of the box
  • The package is now integrated at the project level
  • All known edge corners are rectified

Using the new Eazfuscator.NET is no different from any other NuGet package:

<Project>  
  ...
  <ItemGroup>
    <PackageReference Include = "Gapotchenko.Eazfuscator.NET" Version="2019.1.538"/>
  </ItemGroup>
  ...
</Project>  

Once the package is added, the project is automatically obfuscated every time you build it in Release configuration.

Try it now

comments powered by Disqus