XAML: .NET Runtime version currently executing is 8.0.5, but version 8.0.10 or later is required.

Dani_S 5,581 Reputation points
2025-01-28T13:18:35.1766667+00:00

Hi,

im in net 9, i run my poject in mac and got this error when running.

2025-01-28 15:12:08.725 [error]  XAML: Error starting Hot Reload connection listener: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.

 ---> Interop+AppleCrypto+AppleCommonCryptoCryptographicException: The specified item is no longer valid. It may have been deleted from the keychain.

   at Interop.AppleCrypto.X509CopyWithPrivateKey(SafeSecCertificateHandle certHandle, SafeSecKeyRefHandle privateKeyHandle, SafeKeychainHandle targetKeychain)

   at System.Security.Cryptography.X509Certificates.AppleCertificatePal.CopyWithPrivateKey(SafeSecKeyRefHandle privateKey)

   at System.Security.Cryptography.X509Certificates.AppleCertificatePal.CopyWithPrivateKey(RSA privateKey)

   at System.Security.Cryptography.X509Certificates.RSACertificateExtensions.CopyWithPrivateKey(X509Certificate2 certificate, RSA privateKey)

   at System.Security.Cryptography.X509Certificates.CertificateRequest.CreateSelfSigned(DateTimeOffset notBefore, DateTimeOffset notAfter)

   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)

   at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)

   --- End of inner exception stack trace ---

   at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)

   at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

   at Microsoft.VisualStudio.DesignTools.DiagnosticsMobile.Utility.SelfSignedCertGenerator.Generate()

   at Microsoft.VisualStudio.DesignTools.DiagnosticsMobile.HotReloadConnectionInitializer.CreateTcpDataBridge(IPAddress ipAddress, String sessionId, Action1 logMessageHandler, Func3 registerAdditional, CancellationToken cancellationToken)

   at Microsoft.VisualStudioCode.DesignTools.Diagnostics.LanguageService.VisualDiagnosticsLanguageService.Microsoft.VisualStudio.Maui.Contracts.IMauiLaunchCustomizer.GetCustomLaunchSettingsAsync(LaunchInfo launchInfo, CancellationToken token)

2025-01-28 15:12:08.725 [error]  XAML: .NET Runtime version currently executing is 8.0.5, but version 8.0.10 or later is required.

2025-01-28 15:12:13.755 [error]  XAML: Error starting Hot Reload connection listener: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.

 ---> Interop+AppleCrypto+AppleCommonCryptoCryptographicException: The specified item is no longer valid. It may have been deleted from the keychain.

   at Interop.AppleCrypto.X509CopyWithPrivateKey(SafeSecCertificateHandle certHandle, SafeSecKeyRefHandle privateKeyHandle, SafeKeychainHandle targetKeychain)

   at System.Security.Cryptography.X509Certificates.AppleCertificatePal.CopyWithPrivateKey(SafeSecKeyRefHandle privateKey)

   at System.Security.Cryptography.X509Certificates.AppleCertificatePal.CopyWithPrivateKey(RSA privateKey)

   at System.Security.Cryptography.X509Certificates.RSACertificateExtensions.CopyWithPrivateKey(X509Certificate2 certificate, RSA privateKey)

   at System.Security.Cryptography.X509Certificates.CertificateRequest.CreateSelfSigned(DateTimeOffset notBefore, DateTimeOffset notAfter)

   at InvokeStub_CertificateRequest.CreateSelfSigned(Object, Span`1)

   at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

   --- End of inner exception stack trace ---

   at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

   at Microsoft.VisualStudio.DesignTools.DiagnosticsMobile.Utility.SelfSignedCertGenerator.Generate()

   at Microsoft.VisualStudio.DesignTools.DiagnosticsMobile.HotReloadConnectionInitializer.CreateTcpDataBridge(IPAddress ipAddress, String sessionId, Action1 logMessageHandler, Func3 registerAdditional, CancellationToken cancellationToken)

   at Microsoft.VisualStudioCode.DesignTools.Diagnostics.LanguageService.VisualDiagnosticsLanguageService.Microsoft.VisualStudio.Maui.Contracts.IMauiLaunchCustomizer.GetCustomLaunchSettingsAsync(LaunchInfo launchInfo, CancellationToken token)

2025-01-28 15:12:13.756 [error]  XAML: .NET Runtime version currently executing is 8.0.5, but version 8.0.10 or later is required.

2025-01-28 15:13:06.285 [error]  XAML: Error starting Hot Reload connection listener: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.

 ---> Interop+AppleCrypto+AppleCommonCryptoCryptographicException: The specified item is no longer valid. It may have been deleted from the keychain.

   at Interop.AppleCrypto.X509CopyWithPrivateKey(SafeSecCertificateHandle certHandle, SafeSecKeyRefHandle privateKeyHandle, SafeKeychainHandle targetKeychain)

   at System.Security.Cryptography.X509Certificates.AppleCertificatePal.CopyWithPrivateKey(SafeSecKeyRefHandle privateKey)

   at System.Security.Cryptography.X509Certificates.AppleCertificatePal.CopyWithPrivateKey(RSA privateKey)

   at System.Security.Cryptography.X509Certificates.RSACertificateExtensions.CopyWithPrivateKey(X509Certificate2 certificate, RSA privateKey)

   at System.Security.Cryptography.X509Certificates.CertificateRequest.CreateSelfSigned(DateTimeOffset notBefore, DateTimeOffset notAfter)

   at InvokeStub_CertificateRequest.CreateSelfSigned(Object, Span`1)

   at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

   --- End of inner exception stack trace ---

   at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

   at Microsoft.VisualStudio.DesignTools.DiagnosticsMobile.Utility.SelfSignedCertGenerator.Generate()

   at Microsoft.VisualStudio.DesignTools.DiagnosticsMobile.HotReloadConnectionInitializer.CreateTcpDataBridge(IPAddress ipAddress, String sessionId, Action1 logMessageHandler, Func3 registerAdditional, CancellationToken cancellationToken)

   at Microsoft.VisualStudioCode.DesignTools.Diagnostics.LanguageService.VisualDiagnosticsLanguageService.Microsoft.VisualStudio.Maui.Contracts.IMauiLaunchCustomizer.GetCustomLaunchSettingsAsync(LaunchInfo launchInfo, CancellationToken token)

2025-01-28 15:13:06.286 [error]  XAML: .NET Runtime version currently executing is 8.0.5, but version 8.0.10 or later is required.

2025-01-28 15:13:40.365 [error]  XAML: Error starting Hot Reload connection listener: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.

 ---> Interop+AppleCrypto+AppleCommonCryptoCryptographicException: The specified item is no longer valid. It may have been deleted from the keychain.

   at Interop.AppleCrypto.X509CopyWithPrivateKey(SafeSecCertificateHandle certHandle, SafeSecKeyRefHandle privateKeyHandle, SafeKeychainHandle targetKeychain)

   at System.Security.Cryptography.X509Certificates.AppleCertificatePal.CopyWithPrivateKey(SafeSecKeyRefHandle privateKey)

   at System.Security.Cryptography.X509Certificates.AppleCertificatePal.CopyWithPrivateKey(RSA privateKey)

   at System.Security.Cryptography.X509Certificates.RSACertificateExtensions.CopyWithPrivateKey(X509Certificate2 certificate, RSA privateKey)

   at System.Security.Cryptography.X509Certificates.CertificateRequest.CreateSelfSigned(DateTimeOffset notBefore, DateTimeOffset notAfter)

   at InvokeStub_CertificateRequest.CreateSelfSigned(Object, Span`1)

   at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

   --- End of inner exception stack trace ---

   at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

   at Microsoft.VisualStudio.DesignTools.DiagnosticsMobile.Utility.SelfSignedCertGenerator.Generate()

   at Microsoft.VisualStudio.DesignTools.DiagnosticsMobile.HotReloadConnectionInitializer.CreateTcpDataBridge(IPAddress ipAddress, String sessionId, Action1 logMessageHandler, Func3 registerAdditional, CancellationToken cancellationToken)

   at Microsoft.VisualStudioCode.DesignTools.Diagnostics.LanguageService.VisualDiagnosticsLanguageService.Microsoft.VisualStudio.Maui.Contracts.IMauiLaunchCustomizer.GetCustomLaunchSettingsAsync(LaunchInfo launchInfo, CancellationToken token)

2025-01-28 15:13:40.365 [error]  XAML: .NET Runtime version currently executing is 8.0.5, but version 8.0.10 or later is required.

 

Developer technologies | .NET | .NET MAUI
{count} votes

Answer accepted by question author
  1. Harry Vo (WICLOUD CORPORATION) 4,750 Reputation points Microsoft External Staff Moderator
    2025-08-14T06:20:13.34+00:00

    Hi @Dani_S , my name is Harry, a Support Engineer specializing in UWP and MAUI. Thank you for reaching out on Microsoft Q&A!

    From what you’ve described, your application is failing to launch because it’s running on the .NET 8.0.5 runtime, while one of your dependencies (likely Microsoft.Maui.Controls.Xaml) requires at least .NET 8.0.10.

    You can quickly fix this issue by updating your .NET 8 runtime to version 8.0.10 or higher from our official download page.

    Additionally, fully migrating your project to .NET 9 can also resolve this problem. To do this:

    • Change <TargetFramework>net8.0</TargetFramework> in your .csproj to <TargetFramework>net9.0</TargetFramework>.
    • Update all NuGet dependencies to versions compatible with .NET 9.
    • Clean and rebuild your project (dotnet clean & dotnet build).

    I hope this helps you get things back on track quickly! If my suggestions can solve your issue, feel free to interact with the system accordingly! Thank you!

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.