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

Use props to hide files instead of .pp extension #26

Merged
merged 1 commit into from
Jul 9, 2022
Merged

Use props to hide files instead of .pp extension #26

merged 1 commit into from
Jul 9, 2022

Conversation

gtbuchanan
Copy link
Contributor

@gtbuchanan gtbuchanan commented Jul 8, 2022

The workaround of using the .pp extension no longer works in MSBuild 17.2.1 when using TargetFrameworks. Builds fail with an error like this:

error CS0122: 'NotNullIfNotNullAttribute' is inaccessible due to its protection level

or this (depending on the situation):

error CS0246: The type or namespace name 'NotNullWhen' could not be found

Using the Visible MSBuild property makes the intent more clear anyway. The approach is adapted from here.

Related to manuelroemer/IsExternalInit#14

The workaround of using the .pp extension no longer works in MSBuild 17.
Using the `Visible` MSBuild property makes the intent more clear anyway.

https://til.cazzulino.com/dotnet/nuget/hide-contentfiles-from-your-nuget-packages
@manuelroemer
Copy link
Owner

That looks absolutely fantastic, many many thanks @gtbuchanan!
I will do some local tests and then look into publishing a new version of the package if nothing else seems to break.

@manuelroemer manuelroemer merged commit 3ee76e5 into manuelroemer:master Jul 9, 2022
@gtbuchanan gtbuchanan deleted the fix-msbuild-17 branch July 11, 2022 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants