locked
ASP.NET Web Service Running From a Windows Store App RRS feed

  • Question

  • Hi ,

    I successfully implemented a windows store app that retrieves,update and add data to a database and i achieved this by creating a ASP.NET web service, a WCF data service and a Entity Model ado.net however it only works when im running it from visual studio , when i try to run it from windows 8 start menu it simply doesnt do anything other than launching the app, and i m pretty sure thats because windows store apps dont support or depend on those services, how can i make my windows store app work like in visual studio by running ASP.net and the insides of this project as background services?
    thanks in advance,

    Romulo Romero

    Tuesday, October 22, 2013 11:30 PM

Answers

  • May I know if your ASP.NET web service host in the same machine as your windows store app?


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by MrDebugging Friday, November 15, 2013 5:44 PM
    Tuesday, November 12, 2013 2:31 AM
    Moderator
  • The problem is that you're running the ASP.NET webservice on the same machine as the Windows Store app. Store apps may not contact locally-hosted services of any sort except during development and only for development purposes.  That's why it only works from Visual Studio.


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Thursday, November 14, 2013 8:25 PM
    Moderator
  • Yes, if you host a remote service, your app will work.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Tuesday, November 19, 2013 3:59 PM
    Moderator

All replies

  • Have you run the Windows App Certification Kit? It will tell you if you are using any features that are not allowed in the Windows Store App. I usually launch the App Certification Kit by right-clicking on my project in the Solution Explorer and then selecting Store > Create App Packages. Then answering "No" for the question "Do you want to build packages to upload to the Windows Store?". After that, click Next and then Create buttons. When the package is created you should see a button "Launch Windows App Certification Kit". Click it - after a while you will see a status of the certification process: Passed or Failed.

    I have built an app using "classic" ASP.NET web services and an SQLite database. It has passed the certification process. I'm not sure about using the ADO.NET Entity Model. I think this is functionality that is not supported in Windows Apps.

    Leszek


    Wiki: wbswiki.com
    Website: www.wisenheimerbrainstorm.com

    Wednesday, October 23, 2013 12:07 AM
  • Hi Ata6502,

    i have tried that yesterday although my application didnt pass most of the tests then i deselected almost all the tests types then it passed however it didnt install the application and then i deployed manually but it didnt work as well, the asp.net service didnt run...it must be something that i am missing...

    any clue why this isnt working?

    PS: the application is based on this book : 

    Microsoft
    ® Visual C# ® 2012
    Step by Step

    so dont know how the tests work, and im a little unsure how to run the tests, like which one of them should i run and how to install the app...im confused ..need help

    Wednesday, October 23, 2013 5:36 PM
  • The tests are run automatically for you in Visual Studio. I would remove the Entity Framework functionality first (everything, including references to assemblies, 'using' statements etc.) and run the App Certification Kit again. My suspicion is that this is the functionality that makes your application fail the certification process.

    The ASP.NET web service should be fine. I'm using it and my app passed the certification.


    Wiki: wbswiki.com
    Website: www.wisenheimerbrainstorm.com

    Wednesday, October 23, 2013 6:32 PM
  • Hi ata6502 again,

    first of all sorry for the delay, i have been reading another book about xaml and i dedicated most of my time to study the internals of xaml, and  its not with the ADO.net entity framework, i have created a project from scratch(just a test it doesnt do anything other than connect to the web service) and installed it but it didnt launch the IIS server either..it only launches from visual studio, and by the way, im not sure what version of the App certification kit you are running the tests but here in version 3.1 you have to carefully choose which tests you want to run , otherwise you will fail in most of the tests..dont know why..and im really unsure how these tests work..but if i select only like 3 of them , then it will pass...weird..since my application is safe and i built it based on the John Sharp 's book...

    if you want i can pack the files so you test it in your machine and try to fix the web service issue(its just a professional application but not a commercial...its the application from the book)...cause im out of hope, since you are the only one who replied to this thread..
    Thanks in advance,

    C# user

    Saturday, October 26, 2013 1:11 AM
  • Wow no more replies in this entire forum? Oo

    do i need to provide any extra information?

    im running Visual studio 2012 ultimate...

    thanks in advance for any help if anyone sees this thread..

    Tuesday, November 5, 2013 6:59 PM
  • May I know if your ASP.NET web service host in the same machine as your windows store app?


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by MrDebugging Friday, November 15, 2013 5:44 PM
    Tuesday, November 12, 2013 2:31 AM
    Moderator
  • sorry for the delay Jamles Hez,

    i had to format my computer and reinstall everything again, and now i have visual studio 2013 pro installed on my computer and answering what you asked me , well i think so i had deployed my app in my standard user account, i may be honest with you , i dont know much of ASP.NET yet, so im not sure if i can answer you that precisely, all i know is that the address of the asp.net service was the localhost and the name of the WCF service coming right after, i havent tested my app with the new visual studio, i will try to deploy it tomorow as i said i just finished installing all the stuff in my pc and configured GPOs etc...but i can definetly send you my Project without any problem since i follwed it with the book guidance!
    Thanks in advance for any reply!
    PS: Is there any need for any service to be running that i dont know? in the services.msc console, cause i disabled some of them , the ones that opens ports and that idont use such as server,workstation and a couple of others..

     

    Thursday, November 14, 2013 8:07 PM
  • The problem is that you're running the ASP.NET webservice on the same machine as the Windows Store app. Store apps may not contact locally-hosted services of any sort except during development and only for development purposes.  That's why it only works from Visual Studio.


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Thursday, November 14, 2013 8:25 PM
    Moderator
  • Wow Matt i had no clue about that , thanks a lot for the support that really helped me and i really appreciate the attention,so if i host it in a remote database that means it will work then?

    thanks again for the help!

    Kind regards,

    C# user

    Friday, November 15, 2013 5:44 PM
  • Yes, if you host a remote service, your app will work.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Tuesday, November 19, 2013 3:59 PM
    Moderator