问题
This question is related to Why when compiling .NET Core console application we end up with both dll and exe files?
So, how can we suppress the creation of the executable? I am creating a NuGet package from the code and I do not need the executable in the NuGet.
回答1:
Prefacing with "not a great answer as this solved the symptom rather than providing a clean end-all solution"...
Typically if I need to mess with files triggered off a build, I use a post-build command. Effectively it is powershell command that executes after the build completes (or before, which is also supported).
Solution Explorer - right click Project - Settings/Options - Build tab.
来源:https://stackoverflow.com/questions/61112507/how-to-suppress-creating-of-the-platform-specific-executable-when-building-a-ne