I have some user data in my Winstore C# app. I just learnt that local store and app data are being erased after new version of the app is installed (or user reinstalled the app).
How to permanently store the data? Can it be done transparently for the user?
What about enterprise class of apps - how do you guys access more robust data like databases?
Removing all local data when an app is uninstalled is the expected pattern for Windows Store apps.
If you want to store data permanently, my recommendation is that you consider building a back-end data store and services to access them. Then you control the server-side data, and can associate the data with the users when they install your app (note that if you plan to store data and not delete it when the user uninstalls the app, you should probably call that out in your app's privacy policy).
There are several good options in terms of building back-end services, and I explore several of them in a blog series I'm currently working on:
http://bitly.com/bundles/devhammer/2
The series covers building a back-end game leaderboard service which stores data in a SQL Database on Windows Azure (though the concepts are applicable to services you host yourself as well), using one of 3 stacks:
WCF Data Services
ASP.NET Web API
Windows Azure Mobile Services
Any of those three stacks will allow you to create a robust back-end for your apps, and can be leveraged across platforms.
With respect to transparency, you can definitely make the above services functionally transparent to the user, but as noted above, it's a good idea to also be transparent about the fact that you plan to continue to store data after the app is uninstalled, and perhaps even give the user options for deleting their data. Pete Brown recently posted a good overview of traits of a good Windows Store app privacy policy, and addresses this a bit in the post:
http://10rem.net/blog/2013/01/21/traits-of-a-good-windows-store-app-privacy-policy
For more info on Windows Store app development, register for Generation App.
You can use something like Skydrive or Dropbox to store the files.
EDIT*
There is no database access support in WinRT. While you can use something like SQLite to store data locally - it would be used mostly for caching and it would be expected that you persist the data somewhere in the cloud, so you should still upload the data you want stored somewhere outside of your machine.
If you want to store files on your machine that don't get deleted with your app - you can save them somewhere in the documents/pictures/music/videos libraries, depending on where they fit best.
Related
Motivation
We are developing an Azure website in C# ASP.NET MVC and we want to improve cooperation with our clients/admin users who optionally co-develop "content" of the website with us.
The application generates different outputs based on user defined "parameters" (plain data stored in SQL Database) interpreted trough user defined "fcs templates" ("application specific script source files" currently stored in blob storage).
We manage the C# code in a private repository (GitHub) and regularly deploy the binaries from Visual Studio via web deployment process. This works great.
We manage the "fcs templates" on another GitHub repository which is accessible also by the client and we upload them on demand of us/admin-user to blob storage, where they can be accessed from the application (cached locally in memory and maybe later in local cache/disk).
Later on, we would like to have the application checkout and use the "fcs templates" directly from GitHub as smartly as possible and based on the user web request. Possibly even to have "more working directories" to sandbox development branch separate from the master branch of the "fcs templates", so that users can test the impact of their change before they confirm it for other users of the application.
I know that thanks to Kudu, there is git installed on the VM hosting my website, and I may take the risk and try to somehow "shell git" create some working directory in "D:\home\site\wwwroot\my_fcs_branches_mess", but I want to stick as much as possible to the Microsoft "game rules" for c#.NET web app development and deployment and avoid too much of undocumented hacks. Still, I am willing to take a little risk, though, if it will look promising based on your feedback.
I want to stress out, that I am not asking for automated git deployment of the C# application, which surely is possible with kudu. I do not want the user to deploy the whole application, but only update a small subset of the user content.
The actual question
Is there a way to take advantage of git on the actual VM where my standard azure website is deployed so that our application can use for the client modifying the client content "fcs templates"?
Does someone use Git to manage not only the actual source code but also the user content of the website? How?
I want to create an app (for Windows runtime), that will get data about user preferences, history of downloaded apps and so on. I want to gather that data and analise it to create some kind of App Advisor.
So: Can I get data like installed apps or something of that sort?
Not that I know of from a Windows Store app. You can get some of it through Windows.Management.Deployment APIs, but those are restricted to full-trust processes and thus have to be used from a desktop/Win32 application.
I am writing a new version of a Delphi app in WPF/MVVM. It is not a complete redesign from the ground up, but rather just replacing Delphi code with WPF code, with a few modernization changes. I currently only have access to the running Delphi app, not source, but will have that soon.
Currently authentication uses a database query for a user name and hashed - I suspect it's not quite one way, but must address that later than today - password. How do I store that a user is authenticated, to check for access to all application commands and data? A simple private boolean in the User view model, an instance which is contained in the top level, application, view model? Or maybe when I extend to authorization, simply the fact that the User view model has been allocated a null list of permissions? What is normally done here?
The application is an access control and time and attendance management app for a very large international corporation, so security levels need be fairly high. Using AD is not feasible at this point due to the equally massive user base and list of access rights, and the rewrite is on very high priority.
Not a simple question, actually.
This doesn't fit as a comment, so I'm posting this as an answer:
what is the architecture of your application? 2-tier? 3-tier?
are you using WCF for the communication?
who are the users of your application? Windows users?
from where is your application used? In a Windows domain? Over the Internet?
Those questions might help you decide which way to go.
For example, if you're using 3-tier architecture, WCF for the communication, application used on a Windows domain, you might be interested in a non-custom authentication (you could use Windows authentication). See MSDN (Authentication, Authorization, and Identities in WCF).
I'm currently writing an application in C# (Windows 8 Windows Store App, .Net 4.5), what would highly rely on one thing I never worked before: user management.
The application to be done has to access a Windows-based server, and parse the login information with that server, then display functions, profile information, etc., based on that user data. Right now I'm stuck at the really beginning, I have no clue how to solve a global user for the whole application (pretty much like the XBox application, it would be nice to have a small user representation on the top right corner in every screen).
About the platform: we use Windows solution for user management in the whole network (there's a Microsoft ActiveDirectory server running), supplying the information for the Exchange and SharePoint servers. What I want to do is to authenticate the user with the AD server, pull the information (full name, role, access, other user data), then using these information, first display the user profile on the top right corner (the XBox Win8 app style), and load the accessible functions (this will be based on role and other domains of the user, e.g. groups).
If anyone knew a tutorial or solution what can get me closer solving this very part of the problem, it would be great!
There are specific libraries included in the .NET Framework for handling active directory requests. Take a look here:
Generic Authentication Call to Active Directory in C#
http://support.microsoft.com/kb/316748
The place where I work has 2 servers and a load balancer. The setup is horrible since I have to manually make sure both servers have the same files. I know there are ways to automate this but it has not been implemented, hopefully soon (I have no control over this). I wrote an application that collects a bunch of information from a user, then creates a folder named after the email of the user in one of the servers. The problem is that I can't control in which server the folder gets created in, so let say a user goes in.. fills his stuff and his folder gets created in server 1, user goes away for a while and goes back to the site but this time the load balancer throws the user into server 2, now the user does something that needs to be saved into his folder but since it didn't created in this server an error occurs. What can I do about this? any suggestions?
Thanks
It sounds like you could solve a few issues by implementing a cloud file service for the file writes such as Amazon S3 http://aws.amazon.com/s3/
Disk size management would no longer be a concern
Files are now written and read from S3 so load balancer concerns are solved
Benefits of a semi-edge network with AWS. (not truly edge but in my experience better than most internally hosted solutions)
Don't store your data in the file system, store it in a database.
If you really can't avoid using the file system, you could look at storing the files in a network share both servers have access to. This would be a terrible hack, however.
It sounds like you may be having a session state issue. It sounds odd the way you describe it, but have a look at this article. It's old, but covers the basics. If it doesn't try googling "asp.net session state web farm"
http://ondotnet.com/pub/a/dotnet/2003/03/24/sessionstate.html
Use NAS or SAN to centralize storage. That same network-accessible storage can store the shared configuration that IIS can be setup to use.
Web Deploy v2 just released from Microsoft, I would encourage the powers that be to investigate that, along with Application Request Routing and the greater Web Farm Framework.
This is a normal infrastructure setup. Below are the two commonly used solutions for the situation you are in.
If you have network attached storage available (e.g. Netapps), you can use this storage to centrally store all of your user files that need to be available across all servers in your web farm.
Redesign your application to store all user specific data in a database.