-
Notifications
You must be signed in to change notification settings - Fork 408
FUTDC support for CopyToOutputDirectory="IfDifferent" #9858
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
FUTDC support for CopyToOutputDirectory="IfDifferent" #9858
Conversation
Evangelink
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @drewnoakes <3
|
How should I think about project-system changes like this in the context of differing SDK capabilities? I very strongly expect copies and publishes to break in silent ways on any SDK that doesn't include Jan's changes (and more) - so turning this on for any SDK < 10.0.200 would be something I would push back on. |
|
@baronfel it might be possible to change the set of options we show to the user based on their SDK. It's a bit more work. But even if one dev is using a new SDK, they may have colleagues on the team who use an older SDK. And older versions of VS don't understand this option and will fail on it. The safest option is to break this PR up into different parts: the part that handles the value gracefully, and the part that makes it easier for users to discover and use this new value. |
The `IfDifferent` value is valid in modern MSBuild: https://github.com/dotnet/msbuild/blob/863bbb87f1b5cbf792fbefb7005ff83bb8af0e4b/src/MSBuild/MSBuild/Microsoft.Build.CommonTypes.xsd#L776 Without this change, attempting to use it causes an error in the FUTDC: ``` ===================== 20-Nov-25 11:17:37 LimitedFunctionality System.AggregateException: Project system data flow 'UpToDateCheckConfiguredInputDataSource: 36760100' closed because of an exception. CopyToOutputDirectory should be Always or PreserveNewest, not IfDifferent ---> (Inner Exception #0) Microsoft.Assumes+InternalErrorException: CopyToOutputDirectory should be Always or PreserveNewest, not IfDifferent at Microsoft.Assumes.Fail(String message) at Microsoft.VisualStudio.ProjectSystem.VS.UpToDate.CopyItem.<GetCopyType>g__ParseCopyType|15_0(String value) at Microsoft.VisualStudio.ProjectSystem.VS.UpToDate.CopyItem.GetCopyType(IImmutableDictionary`2 metadata) at Microsoft.VisualStudio.ProjectSystem.VS.UpToDate.UpToDateCheckImplicitConfiguredInput.<>c.<Update>b__76_24(KeyValuePair`2 pair) at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext() at System.Linq.Buffer`1..ctor(IEnumerable`1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable`1 items) at Microsoft.VisualStudio.ProjectSystem.VS.UpToDate.UpToDateCheckImplicitConfiguredInput.<>c__DisplayClass76_0.<Update>g__UpdateCopyData|9() at Microsoft.VisualStudio.ProjectSystem.VS.UpToDate.UpToDateCheckImplicitConfiguredInput.Update(IProjectSubscriptionUpdate jointRuleUpdate, IProjectSubscriptionUpdate sourceItemsUpdate, IProjectItemSchema projectItemSchema, IProjectCatalogSnapshot projectCatalogSnapshot) at Microsoft.VisualStudio.ProjectSystem.VS.UpToDate.UpToDateCheckImplicitConfiguredInputDataSource.<>c__DisplayClass12_0.<<LinkExternalInput>g__TransformAsync|0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.TransformBlockSlim`2.TransformBlockSlimAsync.<ProcessInputAsync>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.VisualStudio.ProjectSystem.DataReceivingBlockSlim`1.<ProcessInputQueueAsync>d__5.MoveNext() <--- (Inner Exception #0) =================== ``` This change adds support for it. The FUTDC already treats "Always" in the same way as "IfDifferent" (which helps performance a lot), so the user wouldn't notice a difference between these two options for builds in VS, but there would be a different for command-line builds.
3751490 to
5ac2276
Compare
|
I removed the change to the project properties and will create a separate PR to track that. This PR now only teaches the FUTDC about this option to prevent the original exception. |
The
IfDifferentvalue is valid in modern MSBuild:https://github.com/dotnet/msbuild/blob/863bbb87f1b5cbf792fbefb7005ff83bb8af0e4b/src/MSBuild/MSBuild/Microsoft.Build.CommonTypes.xsd#L776
Without this change, attempting to use it causes an error in the FUTDC:
This change adds support for it. The FUTDC already treats "Always" in the same way as "IfDifferent" (which helps performance a lot), so the user wouldn't notice a difference between these two options for builds in VS, but there would be a different for command-line builds.
EDIT Showing this in the properties window was moved to a separate PR given the below discussion: #9861