如何在.NET 7中更改发布时的可执行文件名称

huangapple go评论118阅读模式
英文:

How to change the executable name on publish in .NET 7

问题

<TargetName>cli</TargetName>
英文:

to demonstrate i will use illustrative names.

  • I use VSCode

The problem

I have a project with name App.

I i enter on my terminal and type: dotnet publish --configuration Release -o build

i will have an exe ./build/App.exe.

this is the current behavior.

The wanted solution

So, i need the executable name to be cli.exe when i run the publish command instead of App.exe.

How can i do that?

I have been tried the:

<TargetName>cli</TargetName>

but this tag only changes the .dll file, not the .exe.

答案1

得分: 0

请使用 AssemblyName,而不是 TargetName

英文:

Instead of TargetName use AssemblyName

huangapple
  • 本文由 发表于 2023年3月7日 01:01:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/75653719.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定