Object.GetType returns Null
See original GitHub issueDescription
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.
Even the string object returns me Null.
string Test = "";
var t2 = Test.GetType();
Steps to Reproduce
- Create a string object
- 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:
- Created a year ago
- Comments:8 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
repro with vs main build(32523.339.main) on IOS. works fine on Windows and Android.
Duplicate of #7009