Update to Fo-Dicom 5.03 from V 4 on .Net Framework 4.72

553 views
Skip to first unread message

pra...@herzdoktor.ch

unread,
May 23, 2022, 10:05:35 AM5/23/22
to Fellow Oak DICOM
Hi all

can I expect an update from Fo-Dicom V 4 on .Net Framework 4.72 to Fo-Dicom 5.03 to go through without problems?

Thsanks

-Schlomo

Reinhard Gruber

unread,
Jun 7, 2022, 2:17:08 AM6/7/22
to Fellow Oak DICOM
It should of course go without problems. There have been some breaking changes, so take a look at this wiki page:

pra...@herzdoktor.ch

unread,
Jun 9, 2022, 2:07:45 PM6/9/22
to Fellow Oak DICOM
Thank you Reinhard

I did so and from the initial 550 Errors I worked myselt down to one problem. (I guess some more will show up later).

The interface of IDicomCFindProvider defines IAsyncEnumerable<DicomCFindResponse> OnCFindRequestAsync(DicomCFindRequest request) and tha sample code implements ...

        public async IAsyncEnumerable<DicomCFindResponse> OnCFindRequestAsync(DicomCFindRequest request)
        {
            foreach (DicomDataset result in WorklistHandler.FilterWorklistItems(request.Dataset, WorklistServer.CurrentWorklistItems))
            {
                yield return new DicomCFindResponse(request, DicomStatus.Pending) { Dataset = result };
            }
            yield return new DicomCFindResponse(request, DicomStatus.Success);
        }

I work on .Net Framework 4.72 and I get the error message that 

Fehler    CS8370    Das Feature "Asynchrone Streams" ist in C# 7.3 nicht verfügbar. Verwenden Sie Sprachversion 8.0 oder höher.    DicomCommunication    D:\Repositories\EchoRApp\DicomCommunication\Dicom_WLSCP.cs    136    Aktiv

I assume you understand but for anyone that doesn'tspeak German it says "asynchronous streames are not available in C# 7.3 and I should upgrade to 8.0"

As I understand I can't upgrade when I use .Net Framework, korrekt?
Any workouround?

Thank you so much for your help.

-Schlomo

pra...@herzdoktor.ch

unread,
Jun 9, 2022, 2:53:34 PM6/9/22
to Fellow Oak DICOM
I manually added the line 
    <LangVersion>latest</LangVersion>

after the line
 <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>

in the *.csproj file

and that did the job.

Thanks

-Schlomo

pra...@herzdoktor.ch

unread,
Jun 10, 2022, 4:59:14 AM6/10/22
to Fellow Oak DICOM
So I guess I managed the upgrade

Maybe I can save someone some time by listing where I struggled

First of all: Read the Wiki page and the existing questions 300 times

But then again, quite some information is missing. 

I use .Net Framework 4.72 on WPF

Basically I needed 3 nuget-libraries:

fo-dicom 5.03
fo-dicom.Imaging.Desktop
fo-dicom.Codecs

Update all other nuget libraries especially Microsoft.Extensions.DependencyInjection.

That gave me 550 Errors that needed to be taken care of but that wasn't really a problem. Make sure you update to the async Interface, but that isn't really a problem eighter (besides the problem solved as mentioned above)

Then at the beginning of the application I had to add

    new DicomSetupBuilder()
                .RegisterServices(s => s.AddFellowOakDicom().AddTranscoderManager<FellowOakDicom.Imaging.NativeCodec.NativeTranscoderManager>())
                .SkipValidation()
                .RegisterServices(s => s.AddImageManager<WPFImageManager>())
                .Build();

the parameter  WPFImageManager  should be added to the FO-Dicom instructions, I had to guess it, only WinFormsImageManager and ImageSharpImageManager I saw there.

That basicall does it

I wasn't able to fully test the communication yet (Worklist SCU and SCP work).
I had to remove all the work I had to do in V 4.08 to make encoding of "Umlauts" work and was extremely happy to see that V 5.03 finally does it correct without my help. As soon as I can try with an ultrasound device I will know more. But I think it will be ok too.

So thank you again all contributors to fo-dicom. This is a fantastic project getting better by every version!

-Schlomo

pra...@herzdoktor.ch schrieb am Donnerstag, 9. Juni 2022 um 20:07:45 UTC+2:
Reply all
Reply to author
Forward
0 new messages