Skip to content
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

Emit assembly attributes #85

Closed
drewnoakes opened this issue Nov 11, 2018 · 4 comments
Closed

Emit assembly attributes #85

drewnoakes opened this issue Nov 11, 2018 · 4 comments

Comments

@drewnoakes
Copy link

We have a CommonAssemblyInfo.cs file that's included in all projects in the solution.

I wanted to add assembly attributes based that use GitInfo properties, as described in the README.

It seems this can't work in the case of InternalsVisibleTo because a shared file cannot import a unique namespace per consuming project.

Would it make sense to have a property that caused GitInfo to emit assembly attributes into the .g.cs file? I could them remove them from CommonAssemblyInfo.cs.

@kzu
Copy link
Member

kzu commented Nov 11, 2018

SDK-style projects already provide that. Or you can use MSBuilder.AssemblyMetadata. here's an example: https://github.com/moq/moq/blob/master/src/build/Version.targets

@drewnoakes
Copy link
Author

It's a UI app so we're not using SDK projects yet.

Thanks for the example. I can see that it's possible, but it's more work than I'm willing to chew on right now. It feels like this should be something done once in this repo, and made easily available to all users via a simple property.

@kzu
Copy link
Member

kzu commented Nov 13, 2018

Understood, but this project does not intend to be overly prescriptive as to how you use those values. You can fairly easily do what you want with the things I mentioned. It's a package reference plus a couple MSBuild items on you targets.

@drewnoakes
Copy link
Author

Thanks Daniel, I'll take another look.

@devlooped devlooped locked and limited conversation to collaborators Sep 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants