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
ParseAssemblyInfo does not support .NET Core generated assembly info #2473
Comments
@Joev- this is known to be the case. While there was a LOT of churn with the new project format, a parser was created here: https://github.com/cake-contrib/Cake.Incubator Which correctly handles the new project format. At some point, this will be moved into Cake proper. |
No problem Gary, I figured that this was the case but spent a while searching and did not come across any other references. I'll check out the Incubator. |
@Joev- actually, I might have misread your issue.... I thought you were referring to the new csproj format, not an AssemblyInfo file. I am not sure if there is a new parser for that in Incubator or not. If not, come back here and we can investigate. Sorry to mess you around! |
Not a problem at all, I did just have a look through the incubator and as you say, I didn't see anything for the AssemblyInfo file. |
This change supports reading attributes from the auto generated AssemblyInfo files in .NET Core projects.
(GH-2473) Support fully qualified attributes in AssemblyInfo
What You Are Seeing?
When parsing an AssemblyInfo file generated by the .NET Core SDK on build no information is returned. e.g. AssemblyInformationalVersion returns the default value of 1.0.0 rather than my specified version.
What is Expected?
The correct information is returned.
What version of Cake are you using?
0.32.1
Are you running on a 32 or 64 bit system?
64bit
What environment are you running on? Windows? Linux? Mac?
Windows
Are you running on a CI Server? If so, which one?
No
How Did You Get This To Happen? (Steps to Reproduce)
Parse the generated AssemblyInfo file using
ParseAssemblyInfo
Output Log
Not necessary
The reason this is not working is that the generated AssemblyInfo in .NET Core projects uses the full attribute type name rather than the typically shortened type name. Cake uses the shorter name as seen here whereas .NET core Projects will have
System.Reflection.AssemblyInformationalVersionAttribute
in the generated file.An alternative regex that would work for all cases would be this: https://regex101.com/r/Teupyl/1 and modified to allow for the string format substitution:
The text was updated successfully, but these errors were encountered: