ArgumentException in WCF service in ASP.NET Web App while using WinRT API's

0

Requirement is to show Toast Notifications from asp.net web application.

I have a WCF service hosted in my asp.net web app, where I'll receive responses from another web service. As and when I receive the response, I need to send a toast with some info.

To support toasts on traditional asp.net application, I did add "TargetPlatformVersion" tag with "10.0" in the .csproj file and there after I could add the references of "Windows.Data" & "Windows.UI" namespaces that are required to send Toasts.

Now in my WCF service code behind, I handled the response received and at last added new API ("UpdateToast") to send toasts, where I continuously getting Argument Exception at this caller itself.

Exception detail below:

{System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

I tried adding displaying MessageBox construct in my "UpdateToast" API, and it works but once I include any WinRT API's, I get this exception.

I also tried sending toasts using same WinRT API's in a sample console application targeting .net framework only and it's working there, I only see this exception in asp.net application.

I couldn't get any clue as whether WinRT API's are not supported here in this context or whether I did messed up anything. Kindly help.

asp.net
wcf
windows-runtime
toast
asked on Stack Overflow May 23, 2018 by SiD • edited May 23, 2018 by SiD

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0