Enable <PublishedSingleFileName> to be set in .csproj
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 1.3k
- PR merge metrics
- PR metrics pending
Description
I'd like to be able to control the published single file name independently from the assembly name. I can't set the assembly name to the desired published single file name because it would conflict with a library assembly name in the same project. However, the published single file name can be set to anything without causing a conflict, as evidenced by testing after renaming it to the desired file name after publishing.
It seems setting `Xyz.exe` in the .csproj is very close to working:
https://github.com/dotnet/sdk/blob/f49821513314459df88302142d6fe1aabbb5e9e9/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets#L1069-L1072
We just need to change one line to follow the standard MSBuild "provide default if not already set" pattern:
```xml
$(AssemblyName)$(_NativeExecutableExtension)
$(PublishDir)$(PublishedSingleFileName)
```
Alternatively, if it would be desirable to use a different csproj property which specifies only the name part without the `.exe` file extension, a new property could be introduced or `PublishedSingleFileName` could be refactored to not include the `.exe` part.
Happy to send a PR.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.