Not able to add new view controller to Xamarin ios storyboard kept getting error.

Shraddha Chauhan 0 Reputation points
2023-11-17T15:57:10.2533333+00:00
{MvvmCross.Exceptions.MvxException: Loading view of type ResultsViewController from storyboard Main failed: 
Specified cast is not valid.
 

 at MvvmCross.Platforms.Ios.Views.MvxIosViewsContainer.CreateViewOfType (System.Type viewType, MvvmCross.ViewModels.MvxViewModelRequest request) [0x0003e] in D:\a\1\s\MvvmCross\Platforms\Ios\Views\MvxIosViewsContainer.cs:53 
  at MvvmCross.Platforms.Ios.Views.MvxIosViewsContainer.CreateView (MvvmCross.ViewModels.MvxViewModelRequest request) [0x0003f] in D:\a\1\s\MvvmCross\Platforms\Ios\Views\MvxIosViewsContainer.cs:29 
  at MvvmCross.Platforms.Ios.Views.MvxCanCreateIosViewExtensions.CreateViewControllerFor (MvvmCross.Platforms.Ios.Views.IMvxCanCreateIosView view, MvvmCross.ViewModels.MvxViewModelRequest request) [0x00000] in D:\a\1\s\MvvmCross\Platforms\Ios\Views\MvxCanCreateIosViewExtensions.cs:46 
  at MvvmCross.Platforms.Ios.Presenters.MvxIosViewPresenter.<RegisterAttributeTypes>b__25_1 (System.Type viewType, MvvmCross.Platforms.Ios.Presenters.Attributes.MvxChildPresentationAttribute attribute, MvvmCross.ViewModels.MvxViewModelRequest request) [0x00000] in D:\a\1\s\MvvmCross\Platforms\Ios\Presenters\MvxIosViewPresenter.cs:101 
  at MvvmCross.Presenters.MvxPresentationAttributeExtensions+<>c__DisplayClass4_0`1[TMvxPresentationAttribute].<Register>b__0 (System.Type view, MvvmCross.Presenters.Attributes.IMvxPresentationAttribute attribute, MvvmCross.ViewModels.MvxViewModelRequest request) [0x00000] in D:\a\1\s\MvvmCross\Presenters\MvxPresentationAttributeExtensions.cs:56 
  at MvvmCross.Presenters.MvxAttributeViewPresenter.Show (MvvmCross.ViewModels.MvxViewModelRequest request) [0x00000] in D:\a\1\s\MvvmCross\Presenters\MvxAttributeViewPresenter.cs:175 
  at MvvmCross.Platforms.Ios.Views.MvxIosViewDispatcher+<>c__DisplayClass2_0.<ShowViewModel>b__0 () [0x0001d] in D:\a\1\s\MvvmCross\Platforms\Ios\Views\MvxIosViewDispatcher.cs:29 
  at MvvmCross.Base.MvxMainThreadAsyncDispatcher+<>c__DisplayClass1_0.<ExecuteOnMainThreadAsync>b__0 () [0x00011] in D:\a\1\s\MvvmCross\Base\MvxMainThreadAsyncDispatcher.cs:27 
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1021 
  at Foundation.NSAsyncSynchronizationContextDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/16.4.0.18/src/Xamarin.iOS/Foundation/NSAction.cs:176 
  at (wrapper managed-to-native) UIKit.UIApplication.xamarin_UIApplicationMain(int,intptr,intptr,intptr,intptr&)
  at UIKit.UIApplication.UIApplicationMain (System.Int32 argc, System.String[] argv, System.IntPtr principalClassName, System.IntPtr delegateClassName) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/16.4.0.18/src/Xamarin.iOS/UIKit/UIApplication.cs:58 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00013] in /Library/Frameworks/Xamarin.iOS.framework/Versions/16.4.0.18/src/Xamarin.iOS/UIKit/UIApplication.cs:84 
  at PatientApp.Application.Main (System.String[] args) [0x00001] in C:\vssdata\solutions\eMDAccess\eMDAccessPrimary\eMD-Mobile\iOSPatientApp\Main.cs:20 }
Developer technologies .NET Xamarin
{count} votes

2 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2023-11-29T16:34:02.2933333+00:00

    as Xamarin support ends May 1, 2024, you probably should start porting your app to Maui.

    0 comments No comments

Your answer

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