2

There are two WinRT applications (C#/Xaml if it matters) on Windows 8. The first app should receive and send some data into the second one. What the best way to do that? Can WCF be used?

EDIT: The first app knows about the second one. Actually the second app is an authentication server, it provides only one method to get a token.

2
  • Can you tell us more about the data, the amount, frequency, kind? Can you tell us more about the two applications, do they know about eachother or not?
    – Emond
    Jun 22, 2012 at 13:24
  • Please read this question: stackoverflow.com/questions/7465517/… (particularly the second answer: stackoverflow.com/a/7466021/563088) it gives some background and why you might want to change your architecture.
    – Emond
    Jun 22, 2012 at 13:34

4 Answers 4

2

Not possible, this requires loopback support. Something you can only turn on for testing, you cannot rely on it on your user's machine. The CheckNetIsolation.exe utility is available to enable it, MSDN article is here.

Emphasis on only for testing, you can't ship an app like this. Your authentication server needs to run on another machine. Pretty essential anyway considering the odds it will be compromised when it runs on the same machine.

1

Not having the full picture, it seems like a rather odd design decision to have an authentication server running in an UI centric application model such as WinRT. Can't it considered to be a "cloud" based service? I would prefer that anyway, not having to distribute the code for that server on every device out there.

Having said that, take a look a custom share contracts solution. You should essentially be able to send the authentication request as a DataRequest and let the "server" respond with a DataResponse.

There are two sample apps on code.msdn.com:

0

One thing I stumbled across is: Windows.Networking.BackgroundTransfer

Basically coming from this article: Transferring data in the background (Windows Store apps using C#/VB/C++ and XAML)

But I'm actually not through the hole article & concept of background tasks. Maybe someone can comment on this?

0

I am not sure if it has been answered but I found that it is possible to do this using LaunchFileAsync. An example is as follows: //To launch app var launchFileName = "june.kit";

            var folder = Windows.Storage.ApplicationData.Current.LocalFolder;
            var option = Windows.Storage.CreationCollisionOption.ReplaceExisting;

            // create file 
            var launchFile = await folder.CreateFileAsync(launchFileName, option);

            // write content
            await Windows.Storage.FileIO.WriteTextAsync(launchFile, tempChk);

            // launch file
            bool success = await Launcher.LaunchFileAsync(launchFile);

Where launchFileName is possible to have any name with any extension, and this extension should mention in the calling application's FileTypeAssociation in the packager.manifest file.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.