AleksanderCH
AleksanderCH

Reputation: 291

Is it possible to set a display-name in task manager for a .NET Core web application?

I have a .Net Core 2.0 web application and I would like to have the name displayed in task manager. It's currently showing .NET Core Host:

enter image description here

I have found this question, but unfortunately it's not possible to change the assembly info, because this window is not even showing up (I assume this is because it's a .NET Core 2.0 application and not a .NET Framework 4.x application).

enter image description here

Is there another way to display the title of the application in task manager?

Upvotes: 7

Views: 4196

Answers (2)

Soumya Mahunt
Soumya Mahunt

Reputation: 2762

I managed to set display name by setting the AssemblyTitle value in .csproj file in .net core 3.1:

.csproj

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
    <AssemblyName>Hello World</AssemblyName>
    <AssemblyTitle>Display Name</AssemblyTitle>
    <OutputType>WinExe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>
</Project>

Upvotes: 4

Vivien Sonntag
Vivien Sonntag

Reputation: 4629

If you run the application from the dll - no, there is no way as the DotnetCore-Hosting-Process is needed to run it.

If you deploy the application as a self-contained application it will display the name you set your AssemblyName/Executable to:

.csproj:

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
    <AssemblyName>Hello World</AssemblyName>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>
<PropertyGroup>
   <RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
</PropertyGroup>
</Project>

enter image description here

Please also read up the consequences of publishing self-contained apps here.

Upvotes: 1

Related Questions