简体   繁体   中英

Windows 8 Application Packaging

I am working on creating a Windows 8 application. UI is using HTML5. Using WinJs I am calling a WCF service that returns a datatable used to build out the UI. All that is good.

I would also like to create a Window Service that gets packaged up with the application, so when someone download/installs it gets unpackaged and the windows service is started/executed. Is this type of configuration possible?

The WCF service today is a web service, but I would like to make it a windows service. The idea is to make everything self contained. This would allow me to make it available in the Microsoft Online store - if I wanted to go that route.

Windows 8 Applications don't support installing services. The best you can do is install a service separately.

Your WCF service should be decoupled from your app and most probably running on a different machine! I am pretty sure that the they are not going to allow you to install or run services in context of a Windows Store App.

Installing a windows service is not an ideal approach for any Windows 8 application. I understand that you want to make everythig self contained but, why as a WCF local service then? Why don't you consider having it has a data access layer in your app itself? Just a thought.

REGARDING CLIENT SIDE

Web services are separate projects and separate deployment models. You can have one Visual Studio project for the Windows 8 client app and one project for the Web Services side.

Windows 8 apps have several options for saving persistent data, such as endpoints for consuming web services.

There are several consideration when storing Windows 8 application data, such as the location of web services to be consumed.

Windows 8 Application data also includes session state, user preferences, and other settings. It is created, read, updated, and deleted when the app is running.

There are 3 types of dimensions to consider. The system manages these data stores for your app: (1) local : Persistent data that exists only on the current device (2) roaming : Data that exists on all devices on which the user has installed the app (3) temporary : Data that could be removed by the system any time the app isn't running

As a developer, you concern yourself with a couple of objects to persist application data: The first container object is ApplicationDataContainer. The other is ApplicationData. You can use these objects to store your local, roaming, or temporary data.

REGARDING SERVER SIDE

Your Windows 8 Client app will consume http-based web services.

Most developers deploy web services to the cloud to be consumed by iOS, Android, Windows, and other server side services.

Windows Azure is a cloud offering that makes exposing services to clients very simple.

You can leverage either cloud services for robust solutions or the lighter weight Azure Web Sites.

You can typically choose either of these two project types to create web services:

(1) Windows Communication Foundation WCF; or

(2) ASP.NET Web API, which is included with MVC version 4.

WCF has been around longer and has historically been the primary choice for developers when it comes to exposing services.

Microsoft's more modern concepts about web services relate to the ASP.NET Web API, which truly embracing HTTP concepts (URIs and verbs). Also, the ASP.NET Web API can be used to create services that leverage request/response headers, hypermedia, etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM