Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it bad practice to include .exe files in a Nuget package?

Tags:

c#

.net

nuget

nexus

First of all, I would like to clarify that I'm coming from a Java/Maven background.

I am managing Nexus and we have a team that are developing in .NET who are asking whether they can store exe files in Nexus under a Nuget repository. As this is not possible (and exe-s are not really artifacts as in "archives"), are Nuget packages a reasonable place to store exe-s? I would personally say "no", as, in my opinion, Nuget packages are supposed to just contain libraries and other resources, but as I'm not a .NET developer myself, I'd like to find out what the best practices are.

like image 299
carlspring Avatar asked Jan 10 '17 11:01

carlspring


People also ask

Can NuGet package contain EXE?

Nuget pack does not include exe.

Where is NuGet EXE stored?

The default is %userprofile%\. nuget\packages (Windows) or ~/. nuget/packages (Mac/Linux). A relative path can be used in project-specific nuget.

Is it safe to use NuGet packages?

NuGet doesn't manage trust. Even if it did, you would still have to be concerned about trusting what NuGet trusts. You should absolutely be concerned about the safety of the code in a NuGet package. You should be concerned about the safety of any code you are not familiar with.

What should be a NuGet package?

Put simply, a NuGet package is a single ZIP file with the . nupkg extension that contains compiled code (DLLs), other files related to that code, and a descriptive manifest that includes information like the package's version number.


2 Answers

are Nuget packages a reasonable place to store exe-s?

If it's a tool, then yes. There are several good examples where Nuget is an excellent place to store exe-files.

For example:

The nuget package dotless has a tool (standalone exe), which is a compiler for CSS-files. This enables us to use that tool in our (TFS-) build server without installing any third party software on the build server.

But other than that, I agree with you. A Nuget-package is mainly for libraries and other resources that will be references in the project. But it's after all just a platform for spreading code between developers and different teams.

Or as Nuget puts it:

No matter what your package does or what code it contains, NuGet is how you package that functionality into a component that can be shared with and used by any number of other developers.

like image 190
smoksnes Avatar answered Nov 16 '22 01:11

smoksnes


If the purpose of your nuget package is to deploy an executable program, then sure you can store an exe in there - what other option is there after all!

like image 27
Jamiec Avatar answered Nov 16 '22 00:11

Jamiec