0

I have a Xamarin application with Visual Studio 2017 for Android. I have added Parse.NETStandard2 version 2.0.0 to the main app.

I have another .NET core app that uses Parse 1.7, all the below works on the .NET core version.

If I add the standard Parse to the Xamarin code it complains that not NET Standard 2 compatable which is why I switch to the other version of Parse.

Question: Any idea why it can't find the entry point? Note the ParseClient is not throwing an error.

Xamarin version:

I added the following to the main App to initialize the parse connection:

ParseClient.Initialize(new ParseClient.Configuration
{
    ApplicationId = "...",
    WindowsKey = "...",
    Server = @"http://...:80/parse/"
 });

When I run this code:

try
{
    var q = ParseObject.GetQuery("Category");
    var t = q.FirstOrDefaultAsync();
    t.Wait();
    System.Diagnostics.Debug.WriteLine(t.Result);
}
catch (Exception ex)
{
    System.Diagnostics.Debug.WriteLine(ex);
}

I get this error:

[0:] System.AggregateException: One or more errors occurred. ---> System.EntryPointNotFoundException: GetModuleFileName
  at (wrapper managed-to-native) StandardStorage.StorageUtilities.GetModuleFileName(System.Runtime.InteropServices.HandleRef,System.Text.StringBuilder,int)
  at StandardStorage.StorageUtilities.GetModuleFileNameLongPath (System.Runtime.InteropServices.HandleRef hModule) [0x00042] in <492e9128255c4fa2885761586862f4f3>:0 
  at StandardStorage.StorageUtilities.get_ExecutablePath () [0x00021] in <492e9128255c4fa2885761586862f4f3>:0 
  at StandardStorage.StorageUtilities.GetAppFileVersionInfo () [0x00046] in <492e9128255c4fa2885761586862f4f3>:0 
  at StandardStorage.StorageUtilities.get_CompanyName () [0x00042] in <492e9128255c4fa2885761586862f4f3>:0 
  at StandardStorage.StorageUtilities.GetAppSpecificStoragePathFromBasePath (System.String basePath) [0x00000] in <492e9128255c4fa2885761586862f4f3>:0 
  at StandardStorage.FileSystem.get_LocalStorage () [0x00007] in <492e9128255c4fa2885761586862f4f3>:0 
  at Parse.Common.Internal.StorageController+<>c.<.ctor>b__5_1 (System.Threading.Tasks.Task _) [0x00006] in <bafb02353d284fa488514259b803efcb>:0 
  at System.Threading.Tasks.ContinuationResultTaskFromTask`1[TResult].InnerInvoke () [0x00024] in <fe08c003e91342eb83df1ca48302ddbb>:0 
  at System.Threading.Tasks.Task.Execute () [0x00000] in <fe08c003e91342eb83df1ca48302ddbb>:0 
--- End of stack trace from previous location where exception was thrown ---
  at Parse.Common.Internal.InternalExtensions+<>c__DisplayClass7_0`1[TResult].<OnSuccess>b__0 (System.Threading.Tasks.Task t) [0x0003c] in <bafb02353d284fa488514259b803efcb>:0 
  at System.Threading.Tasks.ContinuationResultTaskFromTask`1[TResult].InnerInvoke () [0x00024] in <fe08c003e91342eb83df1ca48302ddbb>:0 
  at System.Threading.Tasks.Task.Execute () [0x00000] in <fe08c003e91342eb83df1ca48302ddbb>:0 
   --- End of inner exception stack trace ---
  at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <fe08c003e91342eb83df1ca48302ddbb>:0 
  at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00043] in <fe08c003e91342eb83df1ca48302ddbb>:0 
  at System.Threading.Tasks.Task.Wait () [0x00000] in <fe08c003e91342eb83df1ca48302ddbb>:0 
  at Parse.ParseUser.get_CurrentUser () [0x00007] in <bafb02353d284fa488514259b803efcb>:0 
  at Parse.ParseQuery`1[T].FirstOrDefaultAsync (System.Threading.CancellationToken cancellationToken) [0x0000d] in <bafb02353d284fa488514259b803efcb>:0 
  at Parse.ParseQuery`1[T].FirstOrDefaultAsync () [0x00006] in <bafb02353d284fa488514259b803efcb>:0 
  at TheBabyQuoteApp.Views.MainPage..ctor () [0x0001b] in D:\WebSites\TheBabyQuote_Projects\TheBabyQuoteApp\TheBabyQuoteApp\TheBabyQuoteApp\Views\MainPage.xaml.cs:22 
---> (Inner Exception #0) System.EntryPointNotFoundException: GetModuleFileName
  at (wrapper managed-to-native) StandardStorage.StorageUtilities.GetModuleFileName(System.Runtime.InteropServices.HandleRef,System.Text.StringBuilder,int)
  at StandardStorage.StorageUtilities.GetModuleFileNameLongPath (System.Runtime.InteropServices.HandleRef hModule) [0x00042] in <492e9128255c4fa2885761586862f4f3>:0 
  at StandardStorage.StorageUtilities.get_ExecutablePath () [0x00021] in <492e9128255c4fa2885761586862f4f3>:0 
  at StandardStorage.StorageUtilities.GetAppFileVersionInfo () [0x00046] in <492e9128255c4fa2885761586862f4f3>:0 
  at StandardStorage.StorageUtilities.get_CompanyName () [0x00042] in <492e9128255c4fa2885761586862f4f3>:0 
  at StandardStorage.StorageUtilities.GetAppSpecificStoragePathFromBasePath (System.String basePath) [0x00000] in <492e9128255c4fa2885761586862f4f3>:0 
  at StandardStorage.FileSystem.get_LocalStorage () [0x00007] in <492e9128255c4fa2885761586862f4f3>:0 
  at Parse.Common.Internal.StorageController+<>c.<.ctor>b__5_1 (System.Threading.Tasks.Task _) [0x00006] in <bafb02353d284fa488514259b803efcb>:0 
  at System.Threading.Tasks.ContinuationResultTaskFromTask`1[TResult].InnerInvoke () [0x00024] in <fe08c003e91342eb83df1ca48302ddbb>:0 
  at System.Threading.Tasks.Task.Execute () [0x00000] in <fe08c003e91342eb83df1ca48302ddbb>:0 
--- End of stack trace from previous location where exception was thrown ---
  at Parse.Common.Internal.InternalExtensions+<>c__DisplayClass7_0`1[TResult].<OnSuccess>b__0 (System.Threading.Tasks.Task t) [0x0003c] in <bafb02353d284fa488514259b803efcb>:0 
  at System.Threading.Tasks.ContinuationResultTaskFromTask`1[TResult].InnerInvoke () [0x00024] in <fe08c003e91342eb83df1ca48302ddbb>:0 
  at System.Threading.Tasks.Task.Execute () [0x00000] in <fe08c003e91342eb83df1ca48302ddbb>:0 <---

Error if I add Parse 1.7.0 to the Xamarin app:

Warning NU1701  Package 'Parse 1.7.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.
John Hughes
  • 367
  • 1
  • 3
  • 20
  • If the sdk don’t use one of the 43 api’s framework provides and standard don’t,We can silence the warning, https://stackoverflow.com/questions/45738982/how-to-hide-net-core-compatibility-warnings-when-referencing-net-4-6-nuget-pac . – Lucas Zhang Dec 10 '18 at 05:30
  • @LucasZhang-MSFT I ended up having too many other problems. Parse-server worked great with Android studio but not with Xamarin. I have switched to Azure as the backend for the Xamarin project. – John Hughes Dec 14 '18 at 16:36

0 Answers0