I'm using VS2022 and wanted to use getportnames()
.
But I notice when I wrote using that intellisense doesn't come up with the last instance.
I see system.io but Ports doesn't come up. Anyone has an idea why?
CodePudding user response:
You need the nuget package System.IO.Ports, e.g. in your csproj:
<PackageReference Include="System.IO.Ports" Version="6.0.0" />
How to find these packages
You could find it this way:
- Check the namespace and assembly on the docs: https://docs.microsoft.com/en-us/dotnet/api/system.io.ports.serialport.getportnames?view=dotnet-plat-ext-6.0. Here both System.IO.Ports. Also double check the platform support, under Applies to.
- Search for System.IO.Ports on nuget.org: https://www.nuget.org/packages?q=System.IO.Ports and select the Microsoft package