-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Platform' does not contain a definition for 'Init' (iOS) #23145
Comments
Added repro repo (tho it was created with just the 3 steps listed above) |
Ok, I had to do 2 things:
When the issue is present, if I go to the definition of Microsoft.Maui.ApplicationModel, I can see that it's because the |
My best guess would be it depends on what dotnet workloads you have, and what target framework you have selected in the IDE (As in, in the Editor dropdown, did you select ios, catalyst, or android). If your code compiles in CLI but the IDE shows errors then some wires are crossed in the IDE with what it thinks it can build and run. In any case, those are more fundamental issues with target framework support in dotnet and the IDE/Editor your using, and not something that's specific to the MAUI UI framework. That can't be addressed here. I would direct that to VSFeedback. |
Description
I'm seeing the same issue as #21253, but in iOS rather than Android. Responses to the previous issue say he was using the wrong namespace & needs to use
Microsoft.Maui.ApplicationModel
...however...his original post states that he was using exactly that namespace (?). To eliminate any ambiguity, I'm using the full namespace inline:net7.0-ios
. It works perfectly, including Maui.Essentialsnet8.0-ios16.1
, the same code no longer builds. The error is'Platform' does not contain a definition for 'Init'
on the lineMicrosoft.Maui.ApplicationModel.Platform.Init(() => window.RootViewController);
Microsoft.Maui.Essentials
8.0.60.<UseMauiEssentials>true</UseMauiEssentials>
, but I tried adding it after the error appeared in .Net 8. The behavior was the same.Steps to Reproduce
CS0117 'Platform' does not contain a definition for 'Init'
Link to public reproduction project repository
link
Version with bug
8.0.60 SR6
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: