parse-community / parse-community/Parse-SDK-dotNET

Preventing initialization exceptions in Xamarin client

Open
#358 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:bug
Dominant language
C#
Stars
335
Forks
258
PR merge metrics
No merged PRs in 30d

Description

Issue Description

Special configuration is required to prevent the following exception from being thrown during ParseClient initialization on Xamarin platform:

Value cannot be null. Parameter name: element

The issue is caused by an assumption encoded into the HostManifestData.Inferred property (Assembly.GetEntryAssembly() is non-null) that is not true on Xamarin. This has been noted in various issues such as #344.

Suggestions

Two suggestions come to mind to improve the situation:

  1. Modify HostManifestData.Inferred so that it populates the Version, Name, and ShortVersion properties with some kind of reasonable default value (empty strings?) if Assembly.GetEntryAssembly() is missing instead of throwing an exception.
  2. Modify HostManifestData.Inferred to throw an exception with a more meaningful error message to help Xamarin users realize that special configuration is needed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with HostManifestData.Inferred and the ParseClient initialization path described in the issue. Review issue #344 for the existing Xamarin context and verify the behavior when Assembly.GetEntryAssembly() is unavailable. Done means choosing and implementing a defined fallback or a more useful exception without breaking normal initialization.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.