Unable to open an AppServiceConnection in a UWP Windows Application Packaging solution2019 Community Moderator ElectionAuthentication in UWP ApplicationWindows 10 Application - iot systemManagement capabilityUWP App Communication with Windows ServiceExpose a win32 application as a service to a UWP applicationsUnable to use Windows Application Package when the app references Windows.winmdIssues in launching desktop extension code from UWP appDevelop and install an UWP app on Windows Server 2016Google Cloud Speech API for UWP applicationUnable to build for ARM64 from UWP packaging project (UWP + Win32)Display custom information in App settings of UWP application
How are passwords stolen from companies if they only store hashes?
Why does energy conservation give me the wrong answer in this inelastic collision problem?
Adventure Game (text based) in C++
Is it normal that my co-workers at a fitness company criticize my food choices?
Does this sum go infinity?
Are ETF trackers fundamentally better than individual stocks?
Why do tuner card drivers fail to build after kernel update to 4.4.0-143-generic?
Official degrees of earth’s rotation per day
This word with a lot of past tenses
How to make healing in an exploration game interesting
Describing a chess game in a novel
Why one should not leave fingerprints on bulbs and plugs?
combinatorics floor summation
Employee lack of ownership
Is there a symmetric-key algorithm which we can use for creating a signature?
ERC721: How to get the owned tokens of an address
Are relativity and doppler effect related?
Print a physical multiplication table
Brexit - No Deal Rejection
Why is a white electrical wire connected to 2 black wires?
Violin - Can double stops be played when the strings are not next to each other?
Examples of transfinite towers
How to pronounce "I ♥ Huckabees"?
Aluminum electrolytic or ceramic capacitors for linear regulator input and output?
Unable to open an AppServiceConnection in a UWP Windows Application Packaging solution
2019 Community Moderator ElectionAuthentication in UWP ApplicationWindows 10 Application - iot systemManagement capabilityUWP App Communication with Windows ServiceExpose a win32 application as a service to a UWP applicationsUnable to use Windows Application Package when the app references Windows.winmdIssues in launching desktop extension code from UWP appDevelop and install an UWP app on Windows Server 2016Google Cloud Speech API for UWP applicationUnable to build for ARM64 from UWP packaging project (UWP + Win32)Display custom information in App settings of UWP application
I have a UWP app that has 2 main parts, a UWP project that has the UI and a WinForms project that is used to provide system tray functionality. I am using a Windows Application Packaging project to join these together as in this example: https://docs.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-extend#show-a-modern-xaml-ui .
When the app launches the WinForm app is launched first and resides in the system tray. When one of it's menu options is selected the UWP app is launched and navigates to the appropriate page using the protocol approach from the example (ie Windows.System.Launcher.LaunchUriAsync("myapp://action?key=value");). This is working fine.
The problem I have is that I would like to be able to communicate from the UWP app to the WinForms app (maybe the other way too in some cases). I am trying to achieve this using the App Service extension. I have been following the example here: https://stefanwick.com/2017/06/24/uwp-app-with-systray-extension/ . However I cannot get this to work. I'm not quite sure which project the fulltrust and app service declarations should be in.
If I put them in my UWP project as in the example I always get an AppServiceUnavailable error (the name is definitely correct - I have no idea what the version that the documentation for this status refers to but I can't see how it can be incorrect). This happens regardless of whether the UWP app is open at the time or not. Previously I have got this approach working but only when there was no Windows Application Packaging project involved and the UWP app launched first which I don't want.
If I put the declarations in the Windows Application Packaging project (setting the app service executable and entry point to the UWP project App class), I get an AppUnavailable error which I guess means it's failing at an earlier point.
Does anyone know how I can get this working? If it's not possible for some reason can anyone point me in the right direction for achieving this idea (a UWP app that does not launch any windows on startup and resides in the system tray with bi-directional messaging between any components required).
EDIT: Target version: 17763, Min version: 16299, Windows version: 17763
EDIT2: I've created a small test solution that hopefully shows what I'm trying to do better: https://github.com/csuzw/AppServiceTest .
uwp
add a comment |
I have a UWP app that has 2 main parts, a UWP project that has the UI and a WinForms project that is used to provide system tray functionality. I am using a Windows Application Packaging project to join these together as in this example: https://docs.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-extend#show-a-modern-xaml-ui .
When the app launches the WinForm app is launched first and resides in the system tray. When one of it's menu options is selected the UWP app is launched and navigates to the appropriate page using the protocol approach from the example (ie Windows.System.Launcher.LaunchUriAsync("myapp://action?key=value");). This is working fine.
The problem I have is that I would like to be able to communicate from the UWP app to the WinForms app (maybe the other way too in some cases). I am trying to achieve this using the App Service extension. I have been following the example here: https://stefanwick.com/2017/06/24/uwp-app-with-systray-extension/ . However I cannot get this to work. I'm not quite sure which project the fulltrust and app service declarations should be in.
If I put them in my UWP project as in the example I always get an AppServiceUnavailable error (the name is definitely correct - I have no idea what the version that the documentation for this status refers to but I can't see how it can be incorrect). This happens regardless of whether the UWP app is open at the time or not. Previously I have got this approach working but only when there was no Windows Application Packaging project involved and the UWP app launched first which I don't want.
If I put the declarations in the Windows Application Packaging project (setting the app service executable and entry point to the UWP project App class), I get an AppUnavailable error which I guess means it's failing at an earlier point.
Does anyone know how I can get this working? If it's not possible for some reason can anyone point me in the right direction for achieving this idea (a UWP app that does not launch any windows on startup and resides in the system tray with bi-directional messaging between any components required).
EDIT: Target version: 17763, Min version: 16299, Windows version: 17763
EDIT2: I've created a small test solution that hopefully shows what I'm trying to do better: https://github.com/csuzw/AppServiceTest .
uwp
What's your project's target and min version? And what's your OS build version?
– Xavier Xie - MSFT
Mar 11 at 0:25
@XavierXie-MSFT added version information to question
– rcarrington
Mar 11 at 9:04
Please check if you have created the AppService correctly like the demo.
– Xavier Xie - MSFT
Mar 11 at 9:09
@XavierXie-MSFT Yes I followed that example (via Stefan Wick's blog post). There is a difference in my example though and that is that I'm using a Windows Application Packaging project. This allows me to have the WinForms app start first and the UWP app not launch until I need it. However none of t he demos other than the first one I posted in my question use this.
– rcarrington
Mar 11 at 9:17
@XavierXie-MSFT I've create small test app that hopefully shows what I'm trying to do better. I'm pretty much at my wits end now, none of the samples show this scenario (as far as I can tell). The existing systray samples really don't have great behaviour in my opinion. I've even resorted to trying Named Pipes to communicate between the apps but I can't get that working either even though there is documentation to suggest that if the name is prefix LOCAL this should work between apps in the same app package.
– rcarrington
Mar 12 at 11:04
add a comment |
I have a UWP app that has 2 main parts, a UWP project that has the UI and a WinForms project that is used to provide system tray functionality. I am using a Windows Application Packaging project to join these together as in this example: https://docs.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-extend#show-a-modern-xaml-ui .
When the app launches the WinForm app is launched first and resides in the system tray. When one of it's menu options is selected the UWP app is launched and navigates to the appropriate page using the protocol approach from the example (ie Windows.System.Launcher.LaunchUriAsync("myapp://action?key=value");). This is working fine.
The problem I have is that I would like to be able to communicate from the UWP app to the WinForms app (maybe the other way too in some cases). I am trying to achieve this using the App Service extension. I have been following the example here: https://stefanwick.com/2017/06/24/uwp-app-with-systray-extension/ . However I cannot get this to work. I'm not quite sure which project the fulltrust and app service declarations should be in.
If I put them in my UWP project as in the example I always get an AppServiceUnavailable error (the name is definitely correct - I have no idea what the version that the documentation for this status refers to but I can't see how it can be incorrect). This happens regardless of whether the UWP app is open at the time or not. Previously I have got this approach working but only when there was no Windows Application Packaging project involved and the UWP app launched first which I don't want.
If I put the declarations in the Windows Application Packaging project (setting the app service executable and entry point to the UWP project App class), I get an AppUnavailable error which I guess means it's failing at an earlier point.
Does anyone know how I can get this working? If it's not possible for some reason can anyone point me in the right direction for achieving this idea (a UWP app that does not launch any windows on startup and resides in the system tray with bi-directional messaging between any components required).
EDIT: Target version: 17763, Min version: 16299, Windows version: 17763
EDIT2: I've created a small test solution that hopefully shows what I'm trying to do better: https://github.com/csuzw/AppServiceTest .
uwp
I have a UWP app that has 2 main parts, a UWP project that has the UI and a WinForms project that is used to provide system tray functionality. I am using a Windows Application Packaging project to join these together as in this example: https://docs.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-extend#show-a-modern-xaml-ui .
When the app launches the WinForm app is launched first and resides in the system tray. When one of it's menu options is selected the UWP app is launched and navigates to the appropriate page using the protocol approach from the example (ie Windows.System.Launcher.LaunchUriAsync("myapp://action?key=value");). This is working fine.
The problem I have is that I would like to be able to communicate from the UWP app to the WinForms app (maybe the other way too in some cases). I am trying to achieve this using the App Service extension. I have been following the example here: https://stefanwick.com/2017/06/24/uwp-app-with-systray-extension/ . However I cannot get this to work. I'm not quite sure which project the fulltrust and app service declarations should be in.
If I put them in my UWP project as in the example I always get an AppServiceUnavailable error (the name is definitely correct - I have no idea what the version that the documentation for this status refers to but I can't see how it can be incorrect). This happens regardless of whether the UWP app is open at the time or not. Previously I have got this approach working but only when there was no Windows Application Packaging project involved and the UWP app launched first which I don't want.
If I put the declarations in the Windows Application Packaging project (setting the app service executable and entry point to the UWP project App class), I get an AppUnavailable error which I guess means it's failing at an earlier point.
Does anyone know how I can get this working? If it's not possible for some reason can anyone point me in the right direction for achieving this idea (a UWP app that does not launch any windows on startup and resides in the system tray with bi-directional messaging between any components required).
EDIT: Target version: 17763, Min version: 16299, Windows version: 17763
EDIT2: I've created a small test solution that hopefully shows what I'm trying to do better: https://github.com/csuzw/AppServiceTest .
uwp
uwp
edited Mar 11 at 14:26
rcarrington
asked Mar 7 at 15:11
rcarringtonrcarrington
3592415
3592415
What's your project's target and min version? And what's your OS build version?
– Xavier Xie - MSFT
Mar 11 at 0:25
@XavierXie-MSFT added version information to question
– rcarrington
Mar 11 at 9:04
Please check if you have created the AppService correctly like the demo.
– Xavier Xie - MSFT
Mar 11 at 9:09
@XavierXie-MSFT Yes I followed that example (via Stefan Wick's blog post). There is a difference in my example though and that is that I'm using a Windows Application Packaging project. This allows me to have the WinForms app start first and the UWP app not launch until I need it. However none of t he demos other than the first one I posted in my question use this.
– rcarrington
Mar 11 at 9:17
@XavierXie-MSFT I've create small test app that hopefully shows what I'm trying to do better. I'm pretty much at my wits end now, none of the samples show this scenario (as far as I can tell). The existing systray samples really don't have great behaviour in my opinion. I've even resorted to trying Named Pipes to communicate between the apps but I can't get that working either even though there is documentation to suggest that if the name is prefix LOCAL this should work between apps in the same app package.
– rcarrington
Mar 12 at 11:04
add a comment |
What's your project's target and min version? And what's your OS build version?
– Xavier Xie - MSFT
Mar 11 at 0:25
@XavierXie-MSFT added version information to question
– rcarrington
Mar 11 at 9:04
Please check if you have created the AppService correctly like the demo.
– Xavier Xie - MSFT
Mar 11 at 9:09
@XavierXie-MSFT Yes I followed that example (via Stefan Wick's blog post). There is a difference in my example though and that is that I'm using a Windows Application Packaging project. This allows me to have the WinForms app start first and the UWP app not launch until I need it. However none of t he demos other than the first one I posted in my question use this.
– rcarrington
Mar 11 at 9:17
@XavierXie-MSFT I've create small test app that hopefully shows what I'm trying to do better. I'm pretty much at my wits end now, none of the samples show this scenario (as far as I can tell). The existing systray samples really don't have great behaviour in my opinion. I've even resorted to trying Named Pipes to communicate between the apps but I can't get that working either even though there is documentation to suggest that if the name is prefix LOCAL this should work between apps in the same app package.
– rcarrington
Mar 12 at 11:04
What's your project's target and min version? And what's your OS build version?
– Xavier Xie - MSFT
Mar 11 at 0:25
What's your project's target and min version? And what's your OS build version?
– Xavier Xie - MSFT
Mar 11 at 0:25
@XavierXie-MSFT added version information to question
– rcarrington
Mar 11 at 9:04
@XavierXie-MSFT added version information to question
– rcarrington
Mar 11 at 9:04
Please check if you have created the AppService correctly like the demo.
– Xavier Xie - MSFT
Mar 11 at 9:09
Please check if you have created the AppService correctly like the demo.
– Xavier Xie - MSFT
Mar 11 at 9:09
@XavierXie-MSFT Yes I followed that example (via Stefan Wick's blog post). There is a difference in my example though and that is that I'm using a Windows Application Packaging project. This allows me to have the WinForms app start first and the UWP app not launch until I need it. However none of t he demos other than the first one I posted in my question use this.
– rcarrington
Mar 11 at 9:17
@XavierXie-MSFT Yes I followed that example (via Stefan Wick's blog post). There is a difference in my example though and that is that I'm using a Windows Application Packaging project. This allows me to have the WinForms app start first and the UWP app not launch until I need it. However none of t he demos other than the first one I posted in my question use this.
– rcarrington
Mar 11 at 9:17
@XavierXie-MSFT I've create small test app that hopefully shows what I'm trying to do better. I'm pretty much at my wits end now, none of the samples show this scenario (as far as I can tell). The existing systray samples really don't have great behaviour in my opinion. I've even resorted to trying Named Pipes to communicate between the apps but I can't get that working either even though there is documentation to suggest that if the name is prefix LOCAL this should work between apps in the same app package.
– rcarrington
Mar 12 at 11:04
@XavierXie-MSFT I've create small test app that hopefully shows what I'm trying to do better. I'm pretty much at my wits end now, none of the samples show this scenario (as far as I can tell). The existing systray samples really don't have great behaviour in my opinion. I've even resorted to trying Named Pipes to communicate between the apps but I can't get that working either even though there is documentation to suggest that if the name is prefix LOCAL this should work between apps in the same app package.
– rcarrington
Mar 12 at 11:04
add a comment |
1 Answer
1
active
oldest
votes
Ok. I've checked your demo. After consulting with Stefan Wick, the issue is able to be resloved.
You would need to make the following change to the Package.appxmanifest file of the WAP project. Otherwise, VS will declare the AppService on the Winforms app, which won't work.
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
<uap:VisualElements DisplayName="AppServiceTest" Description="AppServiceTest" BackgroundColor="transparent" Square150x150Logo="ImagesSquare150x150Logo.png" Square44x44Logo="ImagesSquare44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="ImagesWide310x150Logo.png">
</uap:DefaultTile>
</uap:VisualElements>
</Application>
<Application Id="App2" Executable="AppServiceTest.UI.exe" EntryPoint="AppServiceTest.UI.App">
<uap:VisualElements AppListEntry="none" DisplayName="WapProjTemplate1" Description="WapProjTemplate1" BackgroundColor="transparent" Square150x150Logo="ImagesSquare150x150Logo.png" Square44x44Logo="ImagesSquare44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="ImagesWide310x150Logo.png" />
</uap:VisualElements>
<Extensions>
<uap:Extension Category="windows.appService">
<uap:AppService Name="MyAppServiceName" />
</uap:Extension>
<desktop:Extension Category="windows.fullTrustProcess" Executable="AppServiceTest.SystrayAppServiceTest.Systray.exe"/>
</Extensions>
</Application>
I think I need my AppService to be in-process as I need my UWP app to be able to react to the messages that are received - unless I'm misunderstanding what in-process and out-of-process mean?
– rcarrington
Mar 11 at 11:57
Regarding the UWP app needing to run once: If I don't want the UWP app to show anything at startup, is there a way to achieve this? As far as I can tell launching the UWP app always shows the window. Also as I said in my question, even after I've launched the window, I'm not getting connections created (OnBackgroundActivated never seems to get called).
– rcarrington
Mar 11 at 12:03
@rcarrington I've updated my reply. Please check it.
– Xavier Xie - MSFT
yesterday
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55047054%2funable-to-open-an-appserviceconnection-in-a-uwp-windows-application-packaging-so%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Ok. I've checked your demo. After consulting with Stefan Wick, the issue is able to be resloved.
You would need to make the following change to the Package.appxmanifest file of the WAP project. Otherwise, VS will declare the AppService on the Winforms app, which won't work.
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
<uap:VisualElements DisplayName="AppServiceTest" Description="AppServiceTest" BackgroundColor="transparent" Square150x150Logo="ImagesSquare150x150Logo.png" Square44x44Logo="ImagesSquare44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="ImagesWide310x150Logo.png">
</uap:DefaultTile>
</uap:VisualElements>
</Application>
<Application Id="App2" Executable="AppServiceTest.UI.exe" EntryPoint="AppServiceTest.UI.App">
<uap:VisualElements AppListEntry="none" DisplayName="WapProjTemplate1" Description="WapProjTemplate1" BackgroundColor="transparent" Square150x150Logo="ImagesSquare150x150Logo.png" Square44x44Logo="ImagesSquare44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="ImagesWide310x150Logo.png" />
</uap:VisualElements>
<Extensions>
<uap:Extension Category="windows.appService">
<uap:AppService Name="MyAppServiceName" />
</uap:Extension>
<desktop:Extension Category="windows.fullTrustProcess" Executable="AppServiceTest.SystrayAppServiceTest.Systray.exe"/>
</Extensions>
</Application>
I think I need my AppService to be in-process as I need my UWP app to be able to react to the messages that are received - unless I'm misunderstanding what in-process and out-of-process mean?
– rcarrington
Mar 11 at 11:57
Regarding the UWP app needing to run once: If I don't want the UWP app to show anything at startup, is there a way to achieve this? As far as I can tell launching the UWP app always shows the window. Also as I said in my question, even after I've launched the window, I'm not getting connections created (OnBackgroundActivated never seems to get called).
– rcarrington
Mar 11 at 12:03
@rcarrington I've updated my reply. Please check it.
– Xavier Xie - MSFT
yesterday
add a comment |
Ok. I've checked your demo. After consulting with Stefan Wick, the issue is able to be resloved.
You would need to make the following change to the Package.appxmanifest file of the WAP project. Otherwise, VS will declare the AppService on the Winforms app, which won't work.
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
<uap:VisualElements DisplayName="AppServiceTest" Description="AppServiceTest" BackgroundColor="transparent" Square150x150Logo="ImagesSquare150x150Logo.png" Square44x44Logo="ImagesSquare44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="ImagesWide310x150Logo.png">
</uap:DefaultTile>
</uap:VisualElements>
</Application>
<Application Id="App2" Executable="AppServiceTest.UI.exe" EntryPoint="AppServiceTest.UI.App">
<uap:VisualElements AppListEntry="none" DisplayName="WapProjTemplate1" Description="WapProjTemplate1" BackgroundColor="transparent" Square150x150Logo="ImagesSquare150x150Logo.png" Square44x44Logo="ImagesSquare44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="ImagesWide310x150Logo.png" />
</uap:VisualElements>
<Extensions>
<uap:Extension Category="windows.appService">
<uap:AppService Name="MyAppServiceName" />
</uap:Extension>
<desktop:Extension Category="windows.fullTrustProcess" Executable="AppServiceTest.SystrayAppServiceTest.Systray.exe"/>
</Extensions>
</Application>
I think I need my AppService to be in-process as I need my UWP app to be able to react to the messages that are received - unless I'm misunderstanding what in-process and out-of-process mean?
– rcarrington
Mar 11 at 11:57
Regarding the UWP app needing to run once: If I don't want the UWP app to show anything at startup, is there a way to achieve this? As far as I can tell launching the UWP app always shows the window. Also as I said in my question, even after I've launched the window, I'm not getting connections created (OnBackgroundActivated never seems to get called).
– rcarrington
Mar 11 at 12:03
@rcarrington I've updated my reply. Please check it.
– Xavier Xie - MSFT
yesterday
add a comment |
Ok. I've checked your demo. After consulting with Stefan Wick, the issue is able to be resloved.
You would need to make the following change to the Package.appxmanifest file of the WAP project. Otherwise, VS will declare the AppService on the Winforms app, which won't work.
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
<uap:VisualElements DisplayName="AppServiceTest" Description="AppServiceTest" BackgroundColor="transparent" Square150x150Logo="ImagesSquare150x150Logo.png" Square44x44Logo="ImagesSquare44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="ImagesWide310x150Logo.png">
</uap:DefaultTile>
</uap:VisualElements>
</Application>
<Application Id="App2" Executable="AppServiceTest.UI.exe" EntryPoint="AppServiceTest.UI.App">
<uap:VisualElements AppListEntry="none" DisplayName="WapProjTemplate1" Description="WapProjTemplate1" BackgroundColor="transparent" Square150x150Logo="ImagesSquare150x150Logo.png" Square44x44Logo="ImagesSquare44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="ImagesWide310x150Logo.png" />
</uap:VisualElements>
<Extensions>
<uap:Extension Category="windows.appService">
<uap:AppService Name="MyAppServiceName" />
</uap:Extension>
<desktop:Extension Category="windows.fullTrustProcess" Executable="AppServiceTest.SystrayAppServiceTest.Systray.exe"/>
</Extensions>
</Application>
Ok. I've checked your demo. After consulting with Stefan Wick, the issue is able to be resloved.
You would need to make the following change to the Package.appxmanifest file of the WAP project. Otherwise, VS will declare the AppService on the Winforms app, which won't work.
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
<uap:VisualElements DisplayName="AppServiceTest" Description="AppServiceTest" BackgroundColor="transparent" Square150x150Logo="ImagesSquare150x150Logo.png" Square44x44Logo="ImagesSquare44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="ImagesWide310x150Logo.png">
</uap:DefaultTile>
</uap:VisualElements>
</Application>
<Application Id="App2" Executable="AppServiceTest.UI.exe" EntryPoint="AppServiceTest.UI.App">
<uap:VisualElements AppListEntry="none" DisplayName="WapProjTemplate1" Description="WapProjTemplate1" BackgroundColor="transparent" Square150x150Logo="ImagesSquare150x150Logo.png" Square44x44Logo="ImagesSquare44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="ImagesWide310x150Logo.png" />
</uap:VisualElements>
<Extensions>
<uap:Extension Category="windows.appService">
<uap:AppService Name="MyAppServiceName" />
</uap:Extension>
<desktop:Extension Category="windows.fullTrustProcess" Executable="AppServiceTest.SystrayAppServiceTest.Systray.exe"/>
</Extensions>
</Application>
edited yesterday
answered Mar 11 at 9:45
Xavier Xie - MSFTXavier Xie - MSFT
5,7191316
5,7191316
I think I need my AppService to be in-process as I need my UWP app to be able to react to the messages that are received - unless I'm misunderstanding what in-process and out-of-process mean?
– rcarrington
Mar 11 at 11:57
Regarding the UWP app needing to run once: If I don't want the UWP app to show anything at startup, is there a way to achieve this? As far as I can tell launching the UWP app always shows the window. Also as I said in my question, even after I've launched the window, I'm not getting connections created (OnBackgroundActivated never seems to get called).
– rcarrington
Mar 11 at 12:03
@rcarrington I've updated my reply. Please check it.
– Xavier Xie - MSFT
yesterday
add a comment |
I think I need my AppService to be in-process as I need my UWP app to be able to react to the messages that are received - unless I'm misunderstanding what in-process and out-of-process mean?
– rcarrington
Mar 11 at 11:57
Regarding the UWP app needing to run once: If I don't want the UWP app to show anything at startup, is there a way to achieve this? As far as I can tell launching the UWP app always shows the window. Also as I said in my question, even after I've launched the window, I'm not getting connections created (OnBackgroundActivated never seems to get called).
– rcarrington
Mar 11 at 12:03
@rcarrington I've updated my reply. Please check it.
– Xavier Xie - MSFT
yesterday
I think I need my AppService to be in-process as I need my UWP app to be able to react to the messages that are received - unless I'm misunderstanding what in-process and out-of-process mean?
– rcarrington
Mar 11 at 11:57
I think I need my AppService to be in-process as I need my UWP app to be able to react to the messages that are received - unless I'm misunderstanding what in-process and out-of-process mean?
– rcarrington
Mar 11 at 11:57
Regarding the UWP app needing to run once: If I don't want the UWP app to show anything at startup, is there a way to achieve this? As far as I can tell launching the UWP app always shows the window. Also as I said in my question, even after I've launched the window, I'm not getting connections created (OnBackgroundActivated never seems to get called).
– rcarrington
Mar 11 at 12:03
Regarding the UWP app needing to run once: If I don't want the UWP app to show anything at startup, is there a way to achieve this? As far as I can tell launching the UWP app always shows the window. Also as I said in my question, even after I've launched the window, I'm not getting connections created (OnBackgroundActivated never seems to get called).
– rcarrington
Mar 11 at 12:03
@rcarrington I've updated my reply. Please check it.
– Xavier Xie - MSFT
yesterday
@rcarrington I've updated my reply. Please check it.
– Xavier Xie - MSFT
yesterday
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55047054%2funable-to-open-an-appserviceconnection-in-a-uwp-windows-application-packaging-so%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What's your project's target and min version? And what's your OS build version?
– Xavier Xie - MSFT
Mar 11 at 0:25
@XavierXie-MSFT added version information to question
– rcarrington
Mar 11 at 9:04
Please check if you have created the AppService correctly like the demo.
– Xavier Xie - MSFT
Mar 11 at 9:09
@XavierXie-MSFT Yes I followed that example (via Stefan Wick's blog post). There is a difference in my example though and that is that I'm using a Windows Application Packaging project. This allows me to have the WinForms app start first and the UWP app not launch until I need it. However none of t he demos other than the first one I posted in my question use this.
– rcarrington
Mar 11 at 9:17
@XavierXie-MSFT I've create small test app that hopefully shows what I'm trying to do better. I'm pretty much at my wits end now, none of the samples show this scenario (as far as I can tell). The existing systray samples really don't have great behaviour in my opinion. I've even resorted to trying Named Pipes to communicate between the apps but I can't get that working either even though there is documentation to suggest that if the name is prefix LOCAL this should work between apps in the same app package.
– rcarrington
Mar 12 at 11:04