Control the name of your .NET Core output

Problem:

When I run dotnet build on my CI build agent it names my dll “s.dll”.

Solution:

Add outputName to buildOptions in project.json.

Explanation:

By default the dotnet build command names the resulting assembly based on the folder name in which it was built.   This can cause an issue when using CI where you may not control the folder structure in which the command is executed.  For example on Team Services the source folder is simply named “s”. This means the dll created for a ASP.NET Core application would be named “s.dll”.  This was an issue for me because my Dockerfile was expecting the name to match the project name and failed.  To correct this simply update your project.json file and add outputName.

image

Be sure to leave off any extension it will be added for you.

Comments (3) -

  • Ben Coleman

    2/19/2017 5:07:58 PM | Reply

    Awesome, this broke my .NET Core + Docker + VSTS demo, a quick google for "s.dll" and I got a hit for this. Thanks

Add comment

Loading