22

I have a project which exists in a directory named Oracle and I would like the artifacts created to be called MyCompany.MyApp.Oracle instead of Oracle, what are my options for changing the output assembly name and nuget package name outside of changing the name of the directory?

  • I currently have a MyCompany.MyApp.Oracle.xproj next to my project.json file
  • I've also tried setting <AssemblyName>MyCompany.MyApp.Oracle</AssemblyName> in the xproj file but that didn't work
  • I've also tried setting {"id":"MyCompany.MyApp.Oracle"} in project.json and still no luck
Damian
  • 2,709
  • 2
  • 29
  • 40

3 Answers3

26

Based on comment of @Victor Hurdugaci

"buildOptions": {
    "outputName": "Some.Specific.Assembly.Name"
},

You need to put it inside project.json file. It will produce output with name: Some.Specific.Assembly.Name.dll

Maxim
  • 13,029
  • 6
  • 30
  • 45
  • 2
    Please be careful Visual Studio still contains some bugs. So custom output name will breaks MVC application startup and discovering tests in Test Explorer. – Maxim Jul 27 '16 at 23:00
20

From .NET Core 1.1 on, which uses csproj instead of package.json, you should use the <AssemblyName> configuration.

Example of x.csproj:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <AssemblyName>Name your assembly here</AssemblyName>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp1.1</TargetFramework>
  </PropertyGroup>

</Project>
Andre Pena
  • 56,650
  • 48
  • 196
  • 243
7

Later edit: this answer was applicable to the pre-dotnet releases (dnx). Now it's possible to change the package name.

Old answer: The only way to change the package name is by changing the folder name.

Victor Hurdugaci
  • 28,177
  • 5
  • 87
  • 103