Visual Studio 2019 or 2022 doesn't recognize active provision profiles for Xamarin.iOS. My activities to resolve the issue:
- Removed bin and obj folder at Visual Studio Project.
- Removed old profiles on Windows from here: %LOCALAPPDATA%\Xamarin\iOS\Provisioning\Profiles
- Removed profiles on Mac OS: ~/Library/MobileDevice/Provisioning\ Profiles
- Removed certificates from Keychain Access on Mac OS.
- Created new certificates and provision profiles at Apple Developer site.

- Download and install certificates and profiles for XCode
- Created new project at MacOS with the same identifier like in Visual Studio project.

- Open in Visual Studio my project and connecting to MacOS.
And I observe, that Visual studio not found Developer Profile and for Release mode set old removed profile.
The option with automatic preparing is not fit, because VS just create yet a new profile.
Are there any idia to resolve it?
CodePudding user response:
Here are all the steps you can try: 1.Modify the "Scheme" to "Automatic Provisioning" and check if it works.
2.Clear all provisioning profiles under path ~/Library/MobileDevice/Provisioning Profiles.
3.Check if the bundle ID in the Mac is consistent with the bundle ID of your project.
Bundle ID must be the same like in Visual Studio project in Info.plist.
<key>CFBundleIdentifier</key>
<string>com.your_identifier</string>
Xamarin.iOS: https://aka.ms/xvs/pkg/macios/15.0.0.18
Xamarin.Mono: https://aka.ms/xvs/pkg/mono/6.12.0.107
- Restart Mac OS and Re-connected to Mac from Visual Studio. Now Release profiles were updated in VS.
For Debug provision profile:
Developer profile was not recognized, and I choose "Automatic Provisioning" in Visual studio.
The project was successfully launched for debugging.
A very important problem remained - push notifications did not work in debug and release mode.
The problem was resolved when I removed Xamarin folder from cache on Mac OS:
~/Library/Caches/Xamarin
When I rebuilt the application, push messages began work in debug and release.



