小编Kis*_*zló的帖子

如何使用Xamarin.Forms的Azure移动服务?

我尝试使用我的简单Forms应用程序中的Azure移动服务,它不起作用.最后一个命令只是永远运行.我用WebClient检查了互联网连接,没关系.该代码在简单的Windows控制台应用程序中工作正常.

    var ms = new MobileServiceClient(
            @"https://xxx.azure-mobile.net/",
            @"xxx"
        );

    IMobileServiceTable<TodoItem> todoTable =
        ms.GetTable<TodoItem>();
    List<TodoItem> items = todoTable
        .Where(todoItem => todoItem.Complete == false).ToListAsync().Result;
Run Code Online (Sandbox Code Playgroud)

编辑:我使用Xamarin Studio因为我只有独立许可证.为了调试我尝试了三星Galaxy S3和华为Ascend P7,结果是一样的.我已经更新了Xamarin,现在如果我使用async-await来获得结果,它会产生一个有趣的异常.

Java.Lang.RuntimeException: java.lang.reflect.InvocationTargetException
  at --- End of managed exception stack trace ---
  at java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
  at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:675)
  at at dalvik.system.NativeStart.main(Native Method)
  at Caused by: java.lang.reflect.InvocationTargetException
  at at java.lang.reflect.Method.invokeNative(Native Method)
  at at java.lang.reflect.Method.invoke(Method.java:515)
  at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:859)
  at ... 2 more
  at Caused by: md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable: System.NullReferenceException: Object reference not set to an instance of an …
Run Code Online (Sandbox Code Playgroud)

c# azure xamarin azure-mobile-services xamarin.forms

11
推荐指数
1
解决办法
960
查看次数

如何从TFS构建过程将参数传递给PowerShell脚本?

我创建了一个小的PowerShell脚本来更改web.config中的连接字符串.

param([string]$webConfigPath, [string]$connectionStringName, [string]$connectionStringValue)

# get the full path of the web config file
$webConfigFile = [IO.Path]::Combine($webConfigPath, 'Web.config')
# load the XML
$webConfig = [xml](cat $webConfigFile)

#change the appropriate config
$webConfig.configuration.connectionStrings.add | foreach {
    if($_.name -eq  $connectionStringName){
        $_.connectionString = $connectionStringValue
    }
}

#save the file
$webConfig.Save($webConfigFile)
Run Code Online (Sandbox Code Playgroud)

我将它添加到我的构建过程中.如何将构建的变量传递给脚本?

(我使用基于新脚本的构建过程,所以我只有一个内置的"Arguments"字段用于参数)

powershell tfs build

8
推荐指数
1
解决办法
6033
查看次数

如何从字符串中获取html元素?

我正在创建一个ASP.NET MVC 4站点,并且有一个函数可以通过Pop3协议解析电子邮件.因此,在我收到电子邮件后,我将html编码的电子邮件放在一个字符串中.我想使用类和id-s等html DOM元素从电子邮件中获取数据.如果我可以使用jQuery会很简单,但我找不到任何方法来使用它.有没有什么解决方案可以使用MVC Controller中的jQuery来选择合适的数据?

c# asp.net asp.net-mvc jquery dom

3
推荐指数
1
解决办法
7363
查看次数