warning BC40056: Namespace or type specified in the Imports 'System.Windows.Devices.Bluetooth' doesn't contain any public member or cannot be found.

The ArtistB 0 Reputation points
2024-09-20T12:49:04.8433333+00:00

Hello,

I have a project on visual studio 2022 that I'm trying to build but it's showing me import errors that aren't supposed to be there. I've tried everything, looked for solutions, installed SDKs, updated my PC, but nothing. I've also tried with a PC running Windows 11 but I'm having the same problems.

warning BC40056: Namespace or type specified in the Imports 'System.Windows.Devices.Bluetooth' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

warning BC40056: Namespace or type specified in the Imports 'System.Windows.Devices.Bluetooth.GenericAttributeProfile' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

warning BC40056: Namespace or type specified in the Imports 'System.Windows.Storage.Streams' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,722 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jiachen Li-MSFT 31,166 Reputation points Microsoft Vendor
    2024-09-23T01:22:20.22+00:00

    Hi @The ArtistB ,

    The namespaces you're trying to import seem incorrect. For Bluetooth-related functionality and storage streams in a Windows environment, the correct namespaces should come from the Windows.Devices.Bluetooth and Windows.Storage.Streams namespaces, not from System.Windows.

    Best Regards.

    Jiachen Li


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.