Bug 24756 - System.EntryPointNotFoundException: monodroid_get_system_property when connecting to MSSQL
Summary: System.EntryPointNotFoundException: monodroid_get_system_property when connec...
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 5.1
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Peter Collins
URL:
Depends on:
Blocks:
 
Reported: 2014-11-23 03:52 UTC by 胡玮文
Modified: 2017-08-29 09:00 UTC (History)
7 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description 胡玮文 2014-11-23 03:52:52 UTC
I get System.EntryPointNotFoundException when trying to connect to MSSQL

System.EntryPointNotFoundException: monodroid_get_system_property
  at (wrapper managed-to-native) System.TimeZoneInfo/AndroidTimeZones:monodroid_get_system_property (string,intptr&)
  at System.TimeZoneInfo+AndroidTimeZones.GetDefaultTimeZoneName () [0x00000] in <filename unknown>:0
  at System.TimeZoneInfo+AndroidTimeZones.get_Default () [0x00000] in <filename unknown>:0
  at System.TimeZoneInfo.CreateLocal () [0x00000] in <filename unknown>:0
  at System.TimeZoneInfo.get_Local () [0x00000] in <filename unknown>:0
  at Android.Runtime.AndroidCurrentSystemTimeZone..ctor () [0x00000] in <filename unknown>:0
  at Android.Runtime.AndroidEnvironment.GetCurrentSystemTimeZone () [0x00000] in <filename unknown>:0
  at System.AndroidPlatform.GetCurrentSystemTimeZone () [0x00000] in <filename unknown>:0
  at System.TimeZone.get_CurrentTimeZone () [0x00000] in <filename unknown>:0
  at System.DateTime.get_Now () [0x00000] in <filename unknown>:0
  at Mono.Data.Tds.Protocol.Tds..ctor (System.String dataSource, Int32 port, Int32 packetSize, Int32 timeout, Int32 lifeTime, TdsVersion tdsVersion) [0x00000] in <filename unknown>:0
  at Mono.Data.Tds.Protocol.Tds70..ctor (System.String server, Int32 port, Int32 packetSize, Int32 timeout, Int32 lifeTime, TdsVersion version) [0x00000] in <filename unknown>:0
  at Mono.Data.Tds.Protocol.Tds80..ctor (System.String server, Int32 port, Int32 packetSize, Int32 timeout, Int32 lifeTime) [0x00000] in <filename unknown>:0
  at Mono.Data.Tds.Protocol.TdsConnectionPoolManager.CreateConnection (Mono.Data.Tds.Protocol.TdsConnectionInfo info) [0x00000] in <filename unknown>:0
  at Mono.Data.Tds.Protocol.TdsConnectionPool.GetConnection () [0x00000] in <filename unknown>:0
  at System.Data.SqlClient.SqlConnection.Open () [0x00000] in <filename unknown>:0
  at StockQueryMobile.StockModel.Refresh () [0x00023] in d:\Codes\StockQuery\StockQueryMobile\StockQueryMobile\Model.cs:53
  at StockQueryMobile.UpdatePage+<startButton_Clicked>d__2.MoveNext () [0x00053] in d:\Codes\StockQuery\StockQueryMobile\StockQueryMobile\UpdatePage.cs:43

Android 4.4.4
Xamarin 3.7.248.0
Comment 1 Jonathan Pryor 2014-11-26 20:30:38 UTC
> I get System.EntryPointNotFoundException when trying to connect to MSSQL

That's...very odd; it suggests a mismatch between your mscorlib.dll and your libmonodroid.so. I have no idea how that could happen.

@PeterC: Please try to repro.
Comment 2 glucose1e 2014-12-02 21:22:22 UTC
It is not MSSQL problem, it is the old Android GetDefaultTimeZoneName problem, I guess.

System.EntryPointNotFoundException: monodroid_get_system_property
0x26 in object.583db1cb-61fc-413a-bc94-2723d110abc8	C#
0x12 in System.TimeZoneInfo.AndroidTimeZones.monodroid_get_system_property	C#
0x1E in System.TimeZoneInfo.AndroidTimeZones.GetDefaultTimeZoneName	C#
0x0 in Android.Runtime.AndroidEnvironment.GetCurrentSystemTimeZone	C#
0x25 in System.TimeZoneInfo.AndroidTimeZones.get_Default	C#
0x25 in System.DateTime.get_Now	C#

The DateTime.Now will cause System.EntryPointNotFoundException. 

Maybe you guys should check the latest Xamarin.VisualStudio_Setup-3.8.150.msi (Win7). The initial Xamarin.Forms Portable project will repo this. Just modify the example to

Content = new Label
                {
                    Text = "Hello, Forms !" + DateTime.Now.ToString(),

And then debug it in Android, the EntryPointNotFoundException shows.
Comment 3 Peter Collins 2014-12-03 15:17:36 UTC
I am unable to reproduce this exception on Xamarin 3.8.150 after modifying a new PCL Forms template as per Comment #2.

What is the timezone of the device that is experiencing this issue?
Comment 4 glucose1e 2014-12-03 21:54:32 UTC
Should be China, UTC/GMT+08:00, the submitter is also a Chinese name.
I have this issue in my English Genymotion simulator and my Chinese real android phone.   
Environment: Xamarin.VisualStudio_Setup-3.8.150.msi + Visual Studio 2013 + Win7 + Android 4.2 + China timezone

Downgrade to Xamarin.VisualStudio_Setup-3.3.47.msi seems have no such problem.
Comment 5 arition 2015-02-10 02:41:32 UTC
I am in China and meet this problem, too. I tried to change the timezone to GMT-8 on my Android Phone, but it still gives the same error. 

The Android version is 4.3 .

I also mention that code file
https://github.com/mono/mono/blob/master/mcs/class/corlib/System/TimeZoneInfo.Android.cs

It seems that the monodroid_get_system_property will only use in the system under the 4.3 version, I have no idea if that's why it goes wrong.
Comment 6 Jonathan Pryor 2015-02-26 10:30:10 UTC
The only way this EntryPointNotFoundException can occur is if mscorlib.dll and libmonodroid.so are from different Xamarin.Android versions.

I'm starting to wonder if there's something screwy with the updater/installer.

For "fun", please check and report the file timestamps for the following files:

> %ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll
> %ProgramFiles(x86)%\MSBuild\Xamarin\Android\mandroid.exe

Please try uninstalling Xamarin.Android, rebooting, and reinstalling to ensure that the SDK is consistent.

Related: https://bugzilla.xamarin.com/show_bug.cgi?id=27339#c6
Comment 7 Cody Beyer (MSFT) 2017-08-23 21:32:22 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!
Comment 8 胡玮文 2017-08-29 09:00:51 UTC
I have not encountered this problem for a long time. I don't remember how it is fixed