-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Source Link should have more detailed information as it has unexpected consequences #38404
Comments
Apparently there is this documentation https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/8.0/source-link |
I feel like this should have been disabled by default. It had a lot of negative consequences in our system, including disabling our entire logging system because the version # was too long to insert into logs. Edit: I want to clarify our project files still target .NET 7. |
Yes, if you target .net7 in TFM but build against net8 SDK, you still will be affected. |
Agreed about having it disabled by default. Even with extensive documentation, having to disable it in every project that could be built on a system with the .NET 8 SDK is quite frustrating. Especially frustrating since it affects projects that don't even target .NET 8. I encountered this issue when the github actions runners upgraded to the .NET 8 SDK & previously-working project files targeting .NET 6 started having the commit hash appended to their product versions unexpectedly. Also, while
This benefit is not worth including by default for executables that will be publicly released. The product version field is the only place that you can (sensibly) put an actual semver2 version number without it being mangled, and having to take extra steps to prevent that should never be the default behaviour. Additionally, most Windows users access version information for an executable through the Details tab in the properties window, which doesn't allow copying the values. Making those version numbers even harder to accurately type is not good. Overall, this makes it much more confusing for people that are coming to C# from other languages like C++. I certainly wouldn't have expected this to be the default behaviour, and I'm fairly confident that most developers would agree with me on that. If this is going to continue being the default behaviour of the .NET SDK going forward, it should be shouted from the rooftops & made exceedingly clear in both the build log and the SDK documentation for all versions (since it affects all versions). |
@baronfel FYI |
What about adding |
Echoing everyone's comments here and in related threads, this is terrible behaviour to enable by default, especially when most .net8 documentation pages fail to mention it. |
Type of issue
Missing information
Description
I want to mention this issues: dotnet/runtime#95134, dotnet/sdk#36885, dotnet/sdk#34568, dotnet/sdk#37158, dotnet/sdk#37142, stackoverflow
As the issues show, the SourceLink adds commit hash to the product version. This might be unexpected because this wasn't included in .net 6 & 7.
For example my application extracts the product version and the commit hash wasn't expected, also we use product version for SCCM and the hash is also not desired.
My problem with the current documentation is that the SourceLink description is too vague, it doesn't say anything about the consequences, for example i did not know it includes commit hash to the product version. It also doesn't link to the sourcelink build properties, in my opinion
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
is hard to discover if you want everything to work as before.Maybe it would make sense to add this information to the https://learn.microsoft.com/en-us/dotnet/core/compatibility/8.0 instead of the "What's new".
Page URL
https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-8
Content source URL
https://github.com/dotnet/docs/blob/main/docs/core/whats-new/dotnet-8.md
Document Version Independent Id
b22cffcc-898f-a3cf-83f9-a3c7349a1b14
Article author
gewarren
Metadata
Associated WorkItem - 189675
The text was updated successfully, but these errors were encountered: