question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Object.GetType returns Null

See original GitHub issue

Description

I’m not sure if this is a bug in VS, my code or in .NET MAUI. However, I always get Null when I use GetType() on an object.

image

Even the string object returns me Null.

string Test = "";
var t2 = Test.GetType();

Steps to Reproduce

  1. Create a string object
  2. Call GetType()

Version with bug

Release Candidate 3 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS, I was not able test on other platforms

Affected platform versions

15

Did you find any workaround?

Not net

Relevant log output

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
VincentBucommented, May 24, 2022

repro with vs main build(32523.339.main) on IOS. works fine on Windows and Android.

0reactions
jfversluiscommented, Jun 15, 2022

Duplicate of #7009

Read more comments on GitHub >

github_iconTop Results From Across the Web

Type.GetType("namespace.a.b.ClassName") returns null
GetType returns null because the type is not found, with typeof, the compiler may help you to find out the error. Share.
Read more >
Type.GetType Method (System)
If the assembly has not been saved to disk when GetType is called, the method returns null . GetType does not understand transient...
Read more >
Using Type.GetType with .NET Core / Dynamically Loading ...
Returns a Type object ... If the assembly is not already loaded, GetType() returns null; If the assembly is already loaded, GetType() ...
Read more >
System.Type.GetType returns null in Unity C# code
When programming in Unity in C#(.NET), I've been using System.Type.GetType in the test code or from another library, but it returns null.
Read more >
[Solved]-Type.GetType("namespace.a.b.ClassName") returns ...
GetType returns null because the type is not found, with typeof, the compiler may help you to find out the error. Guillaume 12529....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found