2017-09-04 2 views
0

Nach Migration mein XamarinForm Projekt verwenden Shared .net starddard Projekt statt pcl (Folowing diesen Link https://blog.xamarin.com/building-xamarin-forms-apps-net-standard/)Prism Template Pack - Fehler beim Xamarin.Forms Content Vorlage Artikel in .net Standard Scherbe Projekt

hinzufügen Wenn Ich klicke mit der rechten Maustaste auf das freigegebene Projekt (.net stardard proj), um eine Xamarin.Forms ContentPage mit Prism ViewModel mit Prism Template Pack zu erstellen. Dieser Fehler lautet:

Das Projektsystem hat einen Fehler festgestellt. Objektverweis nicht auf eine Instanz eines Objekts festgelegt. Ein Diagnoseprotokoll wurde an den folgenden Speicherort geschrieben: "C: \ Benutzer \ toomir \ AppData \ Local \ Temp \ VsProjectFault_7c3ce3c8-085f-4531-99cf-85d9a8b8ceee.failure.txt".

Protokolldatei Inhalt

04-09-2017 09:05:10 
Recoverable 
System.NullReferenceException: Object reference not set to an instance of an object. 
    at Prism.VisualStudio.Wizards.CreateViewModelForViewWizard.RunFinished() 
    at Microsoft.VisualStudio.TemplateWizard.Wizard.Execute(Object application, Int32 hwndOwner, Object[]& ContextParams, Object[]& CustomParams, wizardResult& retval) 
    at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) 
    at Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(Int32 hr, Int32[] expectedHRFailure) 
    at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode.RunWizard(SimpleHierarchyNode parentNode, String itemName, String wizardToRun, IntPtr dlgOwner) 
    at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode.<AddItemWithSpecificAsync>d__602.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode.<>c__DisplayClass468_0.<<AddItem>b__0>d.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread() 
    at Microsoft.VisualStudio.Threading.JoinableTask`1.CompleteOnCurrentThread() 
    at Microsoft.VisualStudio.Threading.JoinableTaskFactory.Run[T](Func`1 asyncMethod, JoinableTaskCreationOptions creationOptions) 
    at Microsoft.VisualStudio.ProjectSystem.ProjectMultiThreadedService.ExecuteSynchronously[T](Func`1 asyncAction) 
    at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode.<>c__DisplayClass559_0.<HrInvoke>b__0() 
    at Microsoft.VisualStudio.ProjectSystem.VS.HResult.Invoke(Func`1 action, IServiceProvider vsShellServiceProvider, IProjectFaultHandlerService projectFaultHandlerService, UnconfiguredProject project) 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
    at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex) 
    at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0.<SubmitErrorReport>b__0() 
    at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>b__0() 
    at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2) 

und noch ein weiteres Meldungsfeld zeigt diese Meldung: „Der Objektverweis wurde nicht auf eine Instanz eines Objekts festgelegt“

FYI:

  • Es gibt kein Problem, wenn PCL Projekt
  • Meine App-Klasse von PrismApplication abgeleitet

Kann uns jemand anleitet? Vielen Dank im Voraus

+0

Mögliches Duplikat von [Was ist eine NullReferenceException und wie behebe ich sie?] (Https://StackOverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix -it) – Enigmativity

Antwort

2

Das Prism Template Pack unterstützt derzeit offiziell nicht das .NET Standard-Projektformat. Xamarin wird nicht mit .NET Standard-kompatiblen Projektvorlagen ausgeliefert, und Xamarin selbst ist kein .NET Standard. Wenn Xamarin auf .NET Standard aktualisiert wird, folgt das Prism Template Pack.

+0

Verstanden, danke Sir Brian – toumir

Verwandte Themen