我创建了一个公开 REST 端点的 Azure 逻辑应用程序。
当我通过邮递员调用以下 JSON 正文时,它可以正常工作。
{
"to": "ggtest@yahoo.com",
"subject": "Hello there",
"message": "Hello there!!!!!"
}
Run Code Online (Sandbox Code Playgroud)
我能够看到传入的请求很好地形成
{
"headers": {
"Cache-Control": "no-cache",
"Connection": "keep-alive",
"Accept": "*/*",
"Accept-Encoding": "gzip,deflate",
"Host": "maskedout.northcentralus.logic.azure.com:443",
"User-Agent": "PostmanRuntime/6.4.1",
"Content-Length": "99",
"Content-Type": "application/json"
},
"body": {
"to": "ggtest@yahoo.com",
"subject": "Hello there",
"message": "Hello there!!!!!"
}
}
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试使用 C# PostAsJsonAsync 和以下代码进行相同的调用时:
var email = new Email
{
to = "gg@live.com.sg",
subject = "from webapp",
message = "hello world"
};
var client = new HttpClient();
var uri …Run Code Online (Sandbox Code Playgroud) 我在Visual Studio中使用Xamarin.
我创建了一个样板android应用程序(点击我),我尝试了以下内容:
场景1:
切换到发布模式
右键单击项目>导出Android包(.apk)
侧载生成.apk到我的手机上
应用程序启动没有问题
情景2
切换到发布模式
工具> Android>发布Android应用程序
创建私钥商店后签名APK
侧面负载生成.apk(在发布文件夹中)到手机上
应用程序启动后立即关闭(没有错误消息,没有)
这可能是什么问题?
签署包裹后是否还需要做其他事情?
在这两种情况下,输出apk的大小相同,为5227kb
更新:
我已尝试在Android模拟器上运行相同的东西.结果相同.该应用程序在模拟器上以调试模式运行正常.一旦我将其切换到发布,我得到"不幸的是,App1已停止"
这是错误日志http://pastebin.com/4j1Vwtgf
更新2:
这是我在发布模式下部署时的日志:
1>Starting deploy 5" KitKat (4.4) XXHDPI Phone ...
1>Deploying 5" KitKat (4.4) XXHDPI Phone ...
1>Build started.
1>C:\Program Files (x86)\MSBuild\14.0\bin\csc.exe /noconfig /nowarn:1701,1702,2008 /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE;__XAMARIN_ANDROID_v1_0__;__MOBILE__;__ANDROID__;__ANDROID_1__;__ANDROID_2__;__ANDROID_3__;__ANDROID_4__;__ANDROID_5__;__ANDROID_6__;__ANDROID_7__;__ANDROID_8__;__ANDROID_9__;__ANDROID_10__;__ANDROID_11__;__ANDROID_12__;__ANDROID_13__;__ANDROID_14__;__ANDROID_15__;__ANDROID_16__;__ANDROID_17__;__ANDROID_18__;__ANDROID_19__;__ANDROID_20__;__ANDROID_21__;__ANDROID_22__;__ANDROID_23__ /errorendlocation /preferreduilang:en-US /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v6.0\Mono.Android.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.Linq.dll" /debug:pdbonly /filealign:512 /optimize+ /out:obj\Release\App1.dll …Run Code Online (Sandbox Code Playgroud) 我有以下代码段
if (hasRegistrations)
{
RedirectToAction("Manage");
}
return View();
Run Code Online (Sandbox Code Playgroud)
即使RedirectToAction执行了思想,执行仍然会流向return View();
应如何正确处理?