简体   繁体   中英

Xamarin.Forms Azure in Visual Studio 2017 Pro

I've been watching Joe Montemagno's presentation for Xamarin and Azure ( https://channel9.msdn.com/Events/Visual-Studio/Visual-Studio-2017-Launch/T104 ) And I followed all the steps explained in the video (I think it's incomplete, or at least i'm a little silly), and i can't validate App in Azure when debug application in UWP (in Windows 10 PC or from Lumia950, I haven't tried Android yet). Basically it's application that is created by default, checked AzureMobileAppUrl, and i'm trying to execute.

Steps i've followed:

  • Created a new Project, Cross-Platform->Multiplatform application (Xamarin.Forms or native)
  • In dialog of new cross plataform app -> Master Detail Options: Xamarin.Forms, PCL and check Host in cloud.
  • I've at azure App Services created for this App (from VS2017 created automatically, and checked at portal.azure.com)
  • When i publish Project MobileAppService, from VS I get the correct result, but when the publication ends and the browser opens, the site returns an error, typical ASP.NET error "Runtime error".
  • When i run application, first screen is: UWP演示应用程序开始屏幕

  • Then i push at Sign In button, and if i debug application i can see inside the TryLoginAsync function, dataStore.UseAuthentication returns false, but it's strange because the dataStore object of type AzureDataStore, from VS says that it does not exist in context, however there is no error in the code, and It is not validated in azure, and app stays at LoginPage.

  • And, obviously, in SignIn function, after execute TryLoginAsync, Settings.IsLoggedIn are false.

调试TryLoginAsync函数

  • In app.xaml.cs in Portable Project checked that AzureMobileAppUrl are correct
  • In Azure->App Services->MyAppService(AppAzureTest)-> Introduction-> I can see Requests from debug application, so I think at least the app is running

Anyone can help me with this?. I haven't been able to find more documentation in addition to the videos. Anyone knows where i can find a valid documentation?, because the documentation i've been found at Xamarin aren't valid for Visual Studio 2017.

Update: I'm testin in Azure, and i enabled RemoteErrors, and now i get error from AutoMapper:

Could not load file or assembly 'AutoMapper' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Ok, i need update nuGet AutoUpdate Package in a fresh VS2017 installation, now website in azure work without errors, but i continue with the previous error.

End Update

Thanks

好的,我使用以下方法解决了该问题: Azure App Service中的API应用程序的身份验证和授权

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