Comments (10)
@maf-soft .net only introduced async await in 4.5. I think that's the minimum.
from device.net.
I'm using it with 4.0 and Visual Studio Community 2019: https://www.nuget.org/packages/Microsoft.Bcl.Async/
i.e. await serialPort.BaseStream.ReadAsync()
works well, including CancellationToken
.
(But now I need USB HID, too. It's the same device, providing RS232 and USB for the same data. Unfortunately it's doesn't install a virtual com port. If there is any way to get a virtual com port for this USB device, my application could work without changes...)
from device.net.
@maf-soft fair point.
Are you interested in helping to see if it's possible to target 4.0?
I can give you a few pointers if you want to try it out.
If it works, you can submit a PR
from device.net.
Ok, I cannot invest a lot of time, but If you think it's not much effort, I can try with your pointers. Should we talk somewhere else?
from device.net.
@maf-soft I think it will be possible to some extent but there is going to be a lot of fiddly work involved.
I changed the csproj file to this as an example:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net4;</TargetFrameworks>
<NoWarn>NU5125</NoWarn>
<DocumentationFile>Device.Net.xml</DocumentationFile>
<DebugType>embedded</DebugType>
</PropertyGroup>
<ItemGroup>
<Compile Remove="DeviceDataStreamer.cs" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\README.md" Link="README.md" />
<PackageReference Include="Microsoft.Bcl.Async" Version="1.0.168" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
These are the compilation errors I get. You would need to find more BCL libraries.
from device.net.
@maf-soft
https://www.infoq.com/news/2011/10/ReadOnly-WInRT/
from device.net.
@maf-soft if you want to, you can create your own equivalent interface and list implementations...
from device.net.
Thanks for your investigations and the link. Let's see when I find some time to look at it.
from device.net.
According to https://docs.microsoft.com/en-us/dotnet/framework/install/guide-for-developers, .net 4.0, .net 4.5 and even .net 4.5.1 are officially abandoned starting from VS2022.
from device.net.
wanted to note that .NET 4.6.2 is the earliest version that's officially supported by Microsoft as of April 26th: https://devblogs.microsoft.com/dotnet/net-framework-4-5-2-4-6-4-6-1-will-reach-end-of-support-on-april-26-2022
Customers currently using .NET Framework 4.5.2, 4.6, or 4.6.1 need to update their deployed runtime to a more recent version – at least .NET Framework 4.6.2 before April 26, 2022 – in order to continue to receive updates and technical support.
from device.net.
Related Issues (20)
- Device.Net.LibUsb not compatible with 4.0.0 HOT 1
- Windows and LibUsb factory extensions don't match HOT 2
- Unmanaged memory leak in WindowsHidApiService.GetHidCapabilities HOT 3
- Leading zero missing in TrezorExample? HOT 1
- PR#215 Breaking on .Net Framework 4.8 HOT 5
- .net 5 to .net 6 HOT 1
- HidDevice.ReadAsync failed on .NET 6 HOT 6
- No Way To Open Readonly Hid HOT 1
- Factory Logging Too Verbose
- Hidapi Support (Hid on Linux/macOS)
- Reference App
- Nullable Reference Types
- The type 'LogLevel' exists in both 'Device.Net and 'Microsoft.Extensions.Logging' HOT 3
- Not able to get the device from USBfinder
- SerialPort.Net returned device can't be initialized HOT 5
- Send & Receive Data from Usb Hid device HOT 2
- Control transfers are incorrect when using LibUSB HOT 1
- Dead project? HOT 2
- 'FilterDeviceDefinition' does not contain a definition for 'CreateWindowsUsbDeviceFactory' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from device.net.