"A valid provisioning profile for this executable was not found" deploying app from Visual Studio 2019

Jalza 736 Reputation points
2021-09-22T15:05:32.27+00:00

I get this error when I want to deploy Xamarin.Forms iOS app in my device:

Deploy Error: Could not install the application 'C:\Users\{myuser}\AppData\Local\Temp\Xamarin\HotRestart\Signing\{MyApp}.iOS.app\out\{MyApp}.iOS.ipa' on the device {My iPhone}. Details: ApplicationVerificationFailed({10 digits number}) - Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.OzsrZN/extracted/Payload/{MyApp}.iOS.app : 0xe8008015 (A valid provisioning profile for this executable was not found.)
2>Deploy failed. The app '{MyApp}.iOS.app' could not be deployed to the device '{My iPhone}'. Please check the logs for more details.

I'm using Visual Studio Professional 2019 Version 16.11.3 ​on Windows 10 Pro laptop. One month earlier I didn't have problems to deploy the app. My company (developer account) and my (individual account) certificates expired, so I created a new ones (development and distribution) and installed them in the macbook I use to pair with Visual Studio. Then I created provisioning profiles (development and distribution). I think that I installed the profiles using Xcode in the macbook.

In iOS project properties > iOS Bundle Signing > Bundle Signing > Scheme: Automatic Provisioning is selected. I have selected the only team I have (with my company name in it). In Custom Entitlements I have
Entitlements.plist
file.

As the error I get is about provisioning profiles I think that something is wrong with the provisioning profiles. How can I check if everything is correct in apple accounts o in the macbook?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,292 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Jalza 736 Reputation points
    2021-12-21T07:44:08.527+00:00

    @Cliff @Igor Kravchenko

    I'm not very sure how I resolved this problem, but I did it somehow.

    I created the profile (and I don't know if a certificate was created too) using Xcode. I created a new project using the same ID of the Xamarin project and then I ran it on a device. Also I archive it using Xcode. I these process Xcode creates a valid profile. After that, Xcode project should be opened to deploy the app from Visual Studio.

    I'm very sorry I can't explain it well, but I don't really know how I did it.

    0 comments No comments

  2. Rob Caplan - MSFT 5,412 Reputation points Microsoft Employee
    2022-03-02T04:28:36.687+00:00

    Closing as there are multiple issues mixed here on out-of-date versions of Visual Studio.
    Please report tooling issues such as this on the Visual Studio Developer Community via the Visual Studio's Help.Send Feedback... menu.