-
Notifications
You must be signed in to change notification settings - Fork 258
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
buildTransitive behavior fails #12483
Comments
Thank you for filing this issue. |
Note: Both ProjectA-net6.0 and ProjectB-net48 refer to the local ProjectB Nuget package, please pack ProjectB and ProjectC into a directory, and modify the NuGet.config file at the same time. Please help me to understand what is going on, thank you very much! |
After you complete the above operations, compile the entire solution, you can see the ProjectA-net6.0\bin\Denug\net6.0\net6.0\1.txt file, but there is no ProjectA-net48\bin\Debug directory. |
I think it's by design, I'll check and let you know soon. |
ok, thanks. |
Hey, TargetFramework is an opaque string, which is not something that's available in both SDK (or .NET projects) and old style csproj (.NET Framework projects). The .NET Framework project does not have TargetFramework, so it will never evaluate correctly. For
Since
But we don't recommend doing this way, because this kind of fragile implementation, it doesn't take into account of the package compatibility, next time if you want to extent above for Instead, please use asset control (https://learn.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#controlling-dependency-assets).
Above is more flexible and scalable in long run, see more from here. |
Thank you for helping me figure out what's wrong, thank you very much, wish you a good day every day. |
Sorry to bother you, I want to ask you a question, if I use asset control as you said (not applicable to .props files), then my ProjectA will not have 1.txt 2.txt 3.txt files, These files are all in ProjectC, ProjectB refers to ProjectC, and ProjectA refers to ProjectB. |
NuGet Product Used
Other/NA
Product Version
dotnet 7.0.2 Nuget 6.5.0.136
Worked before?
No response
Impact
It's more difficult to complete my work
Repro Steps & Context
Say I have the following project structure:
ProjectC.csproj
ProjectC.props:
Both ProjectB and ProjectC are Nuget packages, and ProjectA only references ProjectB.
When my ProjectA is a Framework project (net48), the buildTransitive of the indirectly dependent ProjectC fails, and the content files will not be copied to the output directory of ProjectA, but when my ProjectA project is an SDK-style .net core When projecting, everything is normal.
I want to know why when the .net core project indirectly depends on the Nuget package, the dependency file will be copied to the output directory normally, but the .net Framework project will not. Thanks!
Verbose Logs
No response
The text was updated successfully, but these errors were encountered: