-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Type name conflicts in PowerShell after moving to .Net 6.0 Preview7 #57017
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
ExecutionContext is a very old type introduced more than decade ago. Renaming it would be significant breaking change. I think you are getting bitten by implicit namespaces feature. You may want to set:
in the Powershell repo to disable it. FWIW, it is what we have done in this repo as well. |
@jkotas Thanks! Is the problem caused by changing the default values in Preview7? |
It's caused by implicit usings that add an implicit "using System.Threading" at the beginning of all CS files. The above properties disable the feature. The feature is going to be disabled by default after Preview 7 because it causes trouble like this in existing code (and more): dotnet/sdk#19521 |
Description
See PowerShell/PowerShell#15886 It is very amazing to see such name conflicts.
Proposal is to rename System.Threading.ExecutionContext to System.Threading.ThreadExecutionContext
"ExecutionContext" is such a common pattern that there will be conflicts in many projects.
I haven't exact proposal. If we renamed System.Management.Automation.DriveNotFoundException to System.Management.Automation.PSDriveNotFoundException in PowerShell repository this would be a breaking change. I feel it is not accessible /cc @SteveL-MSFT @adityapatwardhan
I hope .Net can find alternative name for System.IO.DriveNotFoundException (maybe IODriveNotFoundException?)
Regression?
Regression in PowerShell after moving to .Net Core 6.0 Preview.7.
The text was updated successfully, but these errors were encountered: