1

I have a C# Android app that connect to a SQL Server database. I noticed that if I build in Release mode, the connection to the database is not working. But if I build in Debug mode, it works fine. What could be causing this?

I already set the user permission

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> 
<uses-permission android:name="android.permission.INTERNET" />

And this is my settings

enter image description here

And this is my Sql Server connection

enter image description here

Noyti
  • 121
  • 2
  • 11
  • 1
    See https://forums.xamarin.com/discussion/124846/xamarin-android-sql-connection-works-in-debug-but-sql-connection-does-not-work-in-release, https://forums.xamarin.com/discussion/82933/sql-connection-working-on-debug-mode-not-on-release and https://forums.xamarin.com/discussion/3164/release-mode-sql-server-connection-error – Martheen Jan 27 '21 at 04:03
  • The first 2 I already applied but still now working But the 3rd i can't apply because i cannot find the **Internationalization section, select the [X] mideast checkbox.** This is the suggestion on step 3 can you assist me on this. Thank a lot I really appreciate your response Click Project > Project Name Options In the left-pane, click Build > Android Build. In the right-panel, click the Advanced tab. In the Internationalization section, select the [X] mideast checkbox. Click OK, then rebuild your app. – Noyti Jan 27 '21 at 04:17
  • Update your question with the exception thrown and the logcat – Martheen Jan 27 '21 at 04:19
  • im sorry but how can i get the exception thrown in release mode? – Noyti Jan 27 '21 at 04:24
  • https://stackoverflow.com/questions/38748170/xamarin-android-print-to-the-application-output-in-release-mode – Martheen Jan 27 '21 at 04:28
  • Thanks for your response it help me a lot. – Noyti Jan 27 '21 at 06:58

1 Answers1

6

I solve the issue by setting up the

Linkers properties to SDK ASSSEMBLIES ONLY

and

Additional support encodings to MIDEAST,WEST

enter image description here

Noyti
  • 121
  • 2
  • 11