【发布时间】:2015-10-05 17:14:50
【问题描述】:
我正在使用在您下载用于使用 Azure 移动服务的示例时生成的 xamarin.forms 应用程序。我做了一些修改。首先,我已将 Todo 更改为 entry.cs:
public class entry
{
string id;
[JsonProperty("ID")]
public string ID { get; set; }
[JsonProperty("Time")]
public int Time { get; set; }
[JsonProperty("Percentage")]
public int Percentage { get; set; }
//I have omitted Device, Replacement, Use_profile, Longitude, Latitude, Battery
}
我尝试在我的 SQL 数据库中的表中添加一个新行,方法是从我的页面中的 cs 中调用以下代码:
var data = new entry{ Longitude = await GetLongitude(), Latitude = await GetLatitude(), Percentage = bpm }; // initialise new data entry
await AddItem (data);
调用此方法时,应用程序崩溃。
这是抛出异常时日志的gist。它给出了一个Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOpperationException has been thrown
解释:
The resource you are looking for has been removed, had it's name changed, or is temporarily unavailable
这是在 ios 项目下 main.cs 中的UIApplication.Main (args, null, "AppDelegate"); 行抛出的。
任何关于为什么会发生这种情况的想法将不胜感激。
更新:
只是为了添加更多信息,我在http://project.azurewebsites.net 有一个 Web 服务设置,这是我在 xamarin 中构建的移动应用程序的常量部分中引用的地址。但是,SQL 数据库位于 http://project-db.database.windows.net 我该如何解决这个问题?我可以在原始域上创建一个数据库,或者在应用程序中更改引用吗?
【问题讨论】: