microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
210 stars 7 forks source link

[BUG] Ambiguous reference between ‘Plugin.BLE.Abstractions.Trace’ and ‘System.Diagnostics.Trace’ #1204

Closed RolfNoot closed 5 days ago

RolfNoot commented 1 month ago

Describe the Issue

Version 1.0.6

I got an error when working with Plugin.BLE as HotReloadMobileTapInitializer uses System.Diagnostics.Trace which is an ambiguous to Plugin.BLE.Abstractions.Trace

/Users/rolf/Downloads/MauiXAMLBluetoothLE/MauiXAMLBluetoothLE/Microsoft.VisualStudio.HotReload.MobileTapInitializer/Microsoft.VisualStudio.HotReload.MobileTapInitializer.ModuleInitializerGenerator/HotReloadMobileTapInitializer.g.cs(17,45): error CS0104: ‘Trace’ is an ambiguous reference between ‘Plugin.BLE.Abstractions.Trace’ and ‘System.Diagnostics.Trace’ [/Users/rolf/Downloads/MauiXAMLBluetoothLE/MauiXAMLBluetoothLE/MauiXAMLBluetoothLE.csproj::TargetFramework=net8.0-ios]

The file HotReloadMobileTapInitializer.g.cs is also not available at that location and I cannot find it.

Steps To Reproduce

No response

Expected Behavior

No response

Environment Information

Version: 1.90.1 (Universal) Commit: 611f9bfce64f25108829dd295f54a6894e87339d Date: 2024-06-11T21:02:41.372Z Electron: 29.4.0 ElectronBuildId: 9593362 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Darwin x64 23.2.0

BretJohnson commented 1 month ago

@RolfNoot - Thanks for writing up this bug. I assume the workaround here https://devblogs.microsoft.com/dotnet/the-dotnet-maui-extension-for-visual-studio-code-is-now-generally-available/#coment-20909 worked for you - but let me know if it didn't.

RolfNoot commented 1 month ago

Thank you for the reply. Yes I added 'global using'. Changed 'global using Plugin.BLE.Abstractions.Trace' to using 'Plugin.BLE.Abstractions.Trace' and it works fine now!

BretJohnson commented 5 days ago

This should be fixed now, in C# extension 2.36.19 and later. If after updating the C# extension you still see this problem, please let us know.