[英]How do I debug a Xamarin app + webapi + SQL Server set-up?
I'm brand new to Xamarin.Forms and Visual Studio (2017 on PC). 我是Xamarin.Forms和Visual Studio的全新用户(2017年在PC上)。 I'm working with code another (experienced) dev wrote in C# and .NET.
我正在使用另一个用C#和.NET编写的(经验丰富的)开发人员的代码。
I have a Xamarin app. 我有一个Xamarin应用程序。 The app asks me to input data.
该应用要求我输入数据。 Then, it saves that data to a SQL Server database via a Web API.
然后,它通过Web API将数据保存到SQL Server数据库中。 Next, later, the app gets that data back from the database to do something.
接下来,稍后,该应用将从数据库中获取该数据以执行某些操作。
I can build and publish all projects and the app runs on Android simulator. 我可以构建和发布所有项目,并且该应用程序可以在Android模拟器上运行。 However, it looks like the data I input is either:
但是,看来我输入的数据是:
I can tell because when I get the data back from the database, the "something" is wrong. 我可以说出来,因为当我从数据库取回数据时,“某事”是错误的。
So here's my question: how do I debug that set-up? 所以这是我的问题:如何调试该设置? I'm familiar with debugging my Xamarin app inside VS 2017, but I don't know how to debug the Web API, or how to look inside the database to see if the data I input are recorded correctly.
我熟悉在VS 2017中调试Xamarin应用程序的知识,但是我不知道如何调试Web API或如何查看数据库内部以查看输入的数据是否正确记录。
At this point, I'm not sure where the bug is, or how to find it. 在这一点上,我不确定错误在哪里,或如何找到它。 Thanks for your help!
谢谢你的帮助!
Xamarin application: Xamarin应用程序:
As you already mentioned, you can debug your Xamarin app in Visual Studio just like you would any other .Net projects. 如前所述,您可以像在任何其他.Net项目中一样在Visual Studio中调试Xamarin应用程序。
Web API: Web API:
Similarly, you can also debug your Web API project in Visual Studio. 同样,您也可以在Visual Studio中调试Web API项目。
SQL Server Database: SQL Server数据库:
You cannot technically 'debug' a database, but you can verify the CRUD operations using SQL Server Management Studio (or SSMS ) provided you have the necessary access/credentials. 从技术上讲,您不能“调试”数据库,但可以使用SQL Server Management Studio(或SSMS )验证CRUD操作,前提是您具有必要的访问/凭据。
To find where the error is, I would suggest: 为了找到错误所在,我建议:
Refer the following links: 请参考以下链接:
https://www.c-sharpcorner.com/article/asp-net-web-api-with-fiddler-and-postman/ https://www.c-sharpcorner.com/article/asp-net-web-api-with-fiddler-and-postman/
https://docs.microsoft.com/en-us/azure/sql-database/sql-database-connect-query-ssms https://docs.microsoft.com/en-us/azure/sql-database/sql-database-connect-query-ssms
Hope it helps. 希望能帮助到你。 Cheers!
干杯!
Found out you can debug a web API using Visual Studio almost the same way you debug a Xamarin app. 发现您可以使用调试Xamarin应用程序几乎相同的方式使用Visual Studio调试Web API。 Here's a nice tutorial for that:
这是一个很好的教程:
https://docs.microsoft.com/en-us/azure/app-service/web-sites-dotnet-troubleshoot-visual-studio#remotedebug https://docs.microsoft.com/en-us/azure/app-service/web-sites-dotnet-troubleshoot-visual-studio#remotedebug
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.