Git Product home page Git Product logo

Comments (10)

MelbourneDeveloper avatar MelbourneDeveloper commented on June 16, 2024

@maf-soft .net only introduced async await in 4.5. I think that's the minimum.

from device.net.

maf-soft avatar maf-soft commented on June 16, 2024

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.

MelbourneDeveloper avatar MelbourneDeveloper commented on June 16, 2024

@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.

maf-soft avatar maf-soft commented on June 16, 2024

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.

MelbourneDeveloper avatar MelbourneDeveloper commented on June 16, 2024

@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.
image

from device.net.

MelbourneDeveloper avatar MelbourneDeveloper commented on June 16, 2024

@maf-soft
https://www.infoq.com/news/2011/10/ReadOnly-WInRT/

from device.net.

MelbourneDeveloper avatar MelbourneDeveloper commented on June 16, 2024

@maf-soft if you want to, you can create your own equivalent interface and list implementations...

from device.net.

maf-soft avatar maf-soft commented on June 16, 2024

Thanks for your investigations and the link. Let's see when I find some time to look at it.

from device.net.

maf-soft avatar maf-soft commented on June 16, 2024

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.

danielchalmers avatar danielchalmers commented on June 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.