Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the name of the output assembly and package using dnx/.net core

Tags:

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
like image 472
Damian Avatar asked Oct 07 '15 14:10

Damian


Video Answer


2 Answers

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

like image 108
Maxim Avatar answered Sep 21 '22 14:09

Maxim


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> 
like image 30
André Pena Avatar answered Sep 18 '22 14:09

André Pena