Getting Dicomserver.Create<T> to work in UWP

83 views
Skip to first unread message

David Murray

unread,
Mar 1, 2017, 2:49:13 PM3/1/17
to Fellow Oak DICOM
Hi There,

First off, thanks everyone for the new release. I'm pretty excited about ultimately consolidating all our implementations in to a .Net Core library for re-use across our projects.

But right now I have moved a single UWP project to 3.0.0, and I am creating a service using DicomServer.Create<T>. When I run this (in debug), it seems to enter the server creation code, and never return. I've turned on all the runtime exception catching, but it doesn't seem to be throwing one I can see. Right now I'm linking with the 3.0.0 UWP library directly (i.e. not use .Net core and the bait and switch trick).

I thought it might be the logger not set up correctly, but I have initialised it beforehand and a test log goes to the output OK.

I have tried using the 3.0.0-supplied echo provider for <T> and it still fails in this way, so I don't think it is my service implementation either. I'm building in x86.

Can anyone see what I might be missing? If it's not something stupid I can of course provide some code. I feel like it's something silly like me not linking the correct library.

Thanks!

Dave

Anders Gustafsson Cureos AB

unread,
Mar 2, 2017, 3:23:11 AM3/2/17
to Fellow Oak DICOM
Hi David,

I have to admit that I have not had time to test the networking functionality too much on UWP. However, I few things spring to mind:

1) Have you configured the capabilities of your UWP application to allow network server functionality?

2) If I understand UWP networking correctly, you cannot have the server and the client on the same computer, they need to be on two different systems. What is your configuration?

Best regards
Anders @ Cureos

Dave Murray

unread,
Mar 2, 2017, 1:30:56 PM3/2/17
to Fellow Oak DICOM
Hi Anders,

Thanks for your reply.

You're right in general about server and client not being on the same system (unless you do some fancy config to enable this). But I am running both client and server inside VSTS in my current config, and this requires just local network access. This is working fine with the version of my application that uses fo-dicom 2.0.2, for example. I did add in the "Internet (client and server)" capability, but this made no difference.

However, in any case, the application (server part) seems to hang insider the server construction prior to any transfer being attempted, so I don't think it can be related to my configuration. I am assuming that DicomServer.Create<>() is asynchronous as it was in 2.0.2 - if not let me know, and the fix will be very simple!

When I get a bit of time I'll create a very simple UWP app that does nothing but call DicomServer.Create<DicomCEchoProvider>(11112), and see if I can take it from there. I still think it might be something on my side, rather than a problem with the toolkit coding.

Cheers

Dave

Anders Gustafsson Cureos AB

unread,
Mar 2, 2017, 5:03:44 PM3/2/17
to Fellow Oak DICOM
Hi again Dave,

can you share some code of how you are instantiating the server? The listening thread is automatically started in the background, but the Create method returns independently of that.What if you try the same code with .NET?

Best regards,
Anders

David Murray

unread,
Mar 2, 2017, 7:47:21 PM3/2/17
to Fellow Oak DICOM
Hi Anders,

I just created a small new UWP project using MetroLog and fo-dicom 3.0.0, then created a server using DicomServer.Create with <DicomCEchoProvider> as <T>. This seems to work just fine, whereas it is not working fine in my other app.

Bottom line: Leave it with me, and I will try and work out what is different between the two applications. There may be some interplay between the Template10 application template I am using and fo-dicom, or there may be some other subtle difference in configuration.

Thanks! I'll be back in touch with what I find in due course.

Best Regards
Dave

Dave Murray

unread,
Mar 4, 2017, 3:40:51 PM3/4/17
to Fellow Oak DICOM
Hi again Anders,

I've solved my problem, simply by starting the DicomServer using a Task. There is something about the Template10 MVVM template for UWP that reacts badly to the server being started on the event thread (or that is what appears to be happening). When I created a test UWP app that did not use Template10, this was not needed. A bit strange, but never mind.

In case I didn't make it clear, we really appreciate the work being done on fo-dicom.

Best Regards

Dave

Anders Gustafsson Cureos AB

unread,
Mar 5, 2017, 10:39:28 AM3/5/17
to Fellow Oak DICOM
Hi again Dave,

Glad to hear that you managed to solve your problems. If you get to the bottom of why Template 10 and fo-dicom are not working well together, don't hesitate to post the details in case there is something we can do in fo-dicom to make the libraries more compatible.

Best regards,
Anders
Reply all
Reply to author
Forward
0 new messages