小编use*_*586的帖子

Azure移动服务身份验证 - App.MobileService不存在

我有一个Windows 8商店应用程序,我想添加Azure身份验证.我已经按照MSDN页面中的示例进行操作.但是,以下行给了我一些问题:

MobileServiceUser loginResult = await App.MobileService.LoginAsync(result.Session.AuthenticationToken);
Run Code Online (Sandbox Code Playgroud)

错误是:App不包含MobileService的定义.什么时候将MobileService实例添加到App类?

我添加了对Microsoft.Live和Azure移动服务库的引用.这是整个Authenticate函数:

private async System.Threading.Tasks.Task Authenticate()
        {
        LiveAuthClient liveIdClient = new LiveAuthClient("<< INSERT REDIRECT DOMAIN HERE >>");


        while (session == null)
        {
            // Force a logout to make it easier to test with multiple Microsoft Accounts
            if (liveIdClient.CanLogout)
                liveIdClient.Logout();


            LiveLoginResult result = await liveIdClient.LoginAsync(new[] { "wl.basic" });
            if (result.Status == LiveConnectSessionStatus.Connected)
            {
                session = result.Session;
                LiveConnectClient client = new LiveConnectClient(result.Session);
                LiveOperationResult meResult = await client.GetAsync("me");
                MobileServiceUser loginResult = await App.MobileService.LoginAsync(result.Session.AuthenticationToken);

                string title = …
Run Code Online (Sandbox Code Playgroud)

c# windows azure

5
推荐指数
1
解决办法
2324
查看次数

标签 统计

azure ×1

c# ×1

windows ×1