CS0854 - no build error with VS2026 #1654
Replies: 4 comments 2 replies
-
|
@adrian-cockburn-appspace Can you give an example of the code which raise build error |
Beta Was this translation helpful? Give feedback.
-
this results in a build error in VS2022, adding an extra |
Beta Was this translation helpful? Give feedback.
-
|
This is not related to VS2026, but it is an improvement of .NET 10.0 / C# 14.0 which support optional and named arguments in Expression trees. |
Beta Was this translation helpful? Give feedback.
-
|
Cool, thanks. Its definitely an improvement. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I doubt if this is a moq issue specifically.
Typically when setting up your mocks you would see a build error
CS0854 - An expression tree may not contain a call or invocation that uses optional argumentsif you missed an optional parameter in your setup. With VS2026 I no longer get these, which is an issue as its not consistent with our ci/cd platform which does throw a build error.Anybody know how to get the old behaviour back with VS2026?
Beta Was this translation helpful? Give feedback.
All reactions