-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ContentFiles not included with multiple TargetFrameworks and --no-incremental after upgrading to 6.0.300 #25758
Comments
I observed the error also with only one TFM. |
@shuebner - Same here, but only with the plural form of the tag. The problem doesn't appear to be the number of TFMs, but which tag is used to specify. In other words, |
@mattjohnsonpint |
@shuebner - possibly that's another separate but related issue then. Not sure, really. If you can make a minimal repro, that would help, but I don't want the .NET SDK team to lose site of the main issue since it seems like an obvious bug introduced in the latest SDK. |
I was going to, don't worry. This is the repro for the same errors (with one error each for both IsExternalInit and Nullable) without multitargeting: https://github.com/shuebner/repro-dotnet-sdk-25758 |
I don't have a full analysis of this yet, but after looking into the scenario described in manuelroemer/Nullable#24 I have the mechanism of the problem well understood:
The For what it's work, |
FYI, it appear that the issue also appears in Visual Studio when doing a "Rebuild" - which makes sense as I believe it uses the same mechanism. manuelroemer/IsExternalInit#13 |
I can confirm the bug being introduced in 6.0.300. Build command is
The following fails in 6.0.300
Changing from When downgrading to 6.0.203 there is no problem 👍 |
The issue appears to be related to the use of @seesharper I see that |
It may have been a workaround in Nullable, but in other libraries (like LibLog), it's a legitimate way to include transformable source code files in a NuGet package. |
Worth noting that I couldn't reproduce this in 7.0.100 RC 1 so far. I also note that NuGet-scaffolded generated files don't seem to be added to the list of files to Clean. |
I'm still able to reproduce this with solutions that use LibLog, using dotnet 7.0.100. |
Removed myself so that the @dotnet/domestic-cat can take a look as available. |
Well, interestingly, the specific repro given above now works for me, but my actual project that uses LibLog is still seeing the error. I'll try to come up with a new repro. |
Describe the bug
After installing the 6.0.300 SDK, running
dotnet build --no-incremental
fails when using<TargetFrameworks>
(plural) and including a nuget package that bundles source files ascontentFiles
(as described in docs here).Specifically, multi-targeted projects using the popular Nullable library by @manuelroemer started failing non-incremental builds after upgrading to 6.0.300. This library provides a shim for nullability annotations on older targets, and does so by including several
.cs.pp
source files undercontentFiles
in its nuget package. The problem isn't with this library, but that the files it provides are being excluded from the build.It does work when passing a specific framework (such as
-f net48
), or when only specifying a single<TargetFramework>
. So I believe the problem is with content files not being included when dispatching to each framework's build.Everything does work when the .NET SDK is pinned to 6.0.203 in a
global.json
file, so this is new for 6.0.300.I tried on both Windows 11 21H2 and macOS 12.4 with the same results.
To Reproduce
See minimal repro in issue here: manuelroemer/Nullable#24
Failed build output:
Working build output (without
--no-incremental
):Further technical details
dotnet --info
The IDE (VS / VS Code/ VS4Mac) you're running on, and its version
N/A - occurs on command line
Here are binlogs that may be useful: binlogs.zip
Thanks
The text was updated successfully, but these errors were encountered: