Consuming WCF service using NetTcpBinding in a UWP app - c#

I am currently in the process of migrating all of our applications over to the Windows 10 UWP platform. We were coming from the Windows 8.1 platform and we were using a WCF service to send both data as well as files to and from a server running our service.
This worked great in Windows 8.1 since it fully supported the uploading of files to a WCF service that had a nettcpbinding. However, according to numerous posts on here as well as the MSDN forums, nettcpbinding is not currently supported on UWP. Whenever I try to run our app and upload a file to our server I get PlatformNotSupportedException when it tries to upload.
The issue here is that while I could roll my own socket classes to upload this file, I find it hard to believe that Microsoft would've released UWP without basic support for nettcpbindings. On top of this it appears that the .NET library that is included in UWP apps does not have support for native FTP so I cannot do that either.
Has anyone had any experience in getting nettcpbindings to work with UWP? If I try to circumvent my proxy classes that I have made manually with "Add Service Reference" it ends up generating the upload method with an incorrect signature. The signature is supposed to be UploadFileAsync(RemoteFileInfo info) but is turned into UploadFileInfo(byte[] info when using "Add Service Reference".
Any ideas?

Related

Communication channel between a windows app and UWP app

I have a uwp project and a windows app (net5).
Both are installed in the same machine (same will happen in production), but the uwp is installed using sideloading, not on windows store.
The windows app gets some data by listening to a wss port. I have to pass those data from the windows app to the uwp app and also wait for a response back from it.
To do this internal communication I came across the AppServiceBridgeSamples in this repo https://github.com/microsoft/DesktopBridgeToUWP-Samples but it is outdated and I can't use it.
Is there any alternatives to it? What would be the easiest implementation to achieve this?
Any suggestions/comments are appreciated.
Currently, the general way to implement a communication channel between a UWP app and a windows app is by using App service. This is not outdated. If you don't want to use the App service, you have to build your own socket server so that both of your apps could communicate with it. Another way is that your windows app could save the data in a local file and load them in the UWP app.

Xamarin Forms App as TCP Server

I have a cross-platform Xamarin.Forms app (iOS and Android) which provides a specific service. This service code is in PCL part of the project and I want to use it on web client as well using my app as server. Is there a way to implement TCP server in the app which listens to incoming connections and provides with the service.
Do I have to use platform specific background services to run TCPListener? The server should only be running when the app is in foreground.
I have tried to look for answers over forums and got bits and pieces.
All I need right now is right direction to go to:
Server Client Application with .NET and Xamarin
Xamarin.Forms Background Thread
Sockets PCL Plugin
Any kind of help is highly appreciated.
Cheers.

How do I real time communicate a Universal Windows App with a older .Net 4.5 app in the same solution. IPC?

I have been struggling with this for over a month, but am slowly learning. Here is what I have:
C# Solution With 3 Projects
-Universal Windows Platform App (Cortana Voice Support)
::Above just shows a floating PNG image and is Cortana enabled
-Universal Windows Service (Cortana Background Service)
::Needed for the Cortana Support
-.Net 4.5 C# App with HTML DOM Automation
::Automates locating elements and clicking of a website
I can't re-code my .Net app's functionality in my Universal app because some of the libraries it uses won't install. (GhostDriver, PhantomJS, and a HotKey Library provided via NuGet. Installing on the Universal Platform fails on all 3 libraries).
What is needed:
-Master Universal Windows App or Service sends signal to .Net App
-.Net App receives signal and calls method/function providing my functionality.
I've never tried calling methods in other apps within the same solution and was wondering if there was a few-code workaround. What I need I think is a method of inter process communication or events, but can't find any examples of a UWP. Most are .Net communicating with other older non universal apps.
Thank you so much!
If I understand correctly, you were developing a app which will can automate the DOM operation through Cortana.
Do you need to submit this app to App Store?
If no, as Scott said, you can use WCF to communicate between UWP process and .NET 4.5 desktop app process.
If yes, as Andrew pointed out, you need an intermediate remote server hosting the service.

Using Excel Component Works From Application But Not Windows Service

I have a .NET Windows service which self hosts a WCF service. This WCF service then goes on to call an old COM component written in ATL on Visual Studio 6. This COM component then creates a Excel.Application COM component. It calls various methods on this Excel COM component and then calls SaveAs on it to finish saving the document. This SaveAs method call fails. The Windows service is running as Local System so I thought it must be some permission problem. So I changed the windows service so that it ran under my user account (just go into services.msc, stop the service, properties, change log on, and restart the service). However, the same problem persists.
I create a quick .NET Win Forms test app and then run the COM component from there. This works fine. The app is running under my user account so I would have thought running the windows service under my account would have the same effect.
What is the problem with the windows service (even when it is running under my user account)? And how do I solve this?
Since Vista Windows Service are not allowed to do "Desktop things" (security etc.)... additionally Office automation is NOT supported by MS in this scenario...
You could find some way to circumvent all this BUT I would strongly recommend to take another route - for Office files there is a free SDK from MS you can use called OpenXML SDK 2.0 - you can download it here.
IF the features are not enough there are other free and commercial SDKs out there - to recommend something it would help to know more about your requirements.

System.Speech on Windows Azure Error

I am trying to call some methods from System.Speech via a WCF Service hosted on Windows Azure. When i try this locally on the development fabric, it is working perfectly fine. I can consume the methods from this Speech API via WCF service in my client.
But when I up this service in real cloud on Azure, i get the following exception error message on the client:
No voice installed on the system or none available with the current security setting.
I have tried to set Copy Local property to True of System.Speech dlls but it is still throwing this exception to me.
Is there any workaround for this?
It looks like Windows Azure does not have actual voice engines installed. Unless it is possible to easily deploy them via the XCopy (which I doubt), then at the moment there is no way to use Speech on Windows Azure.

Categories