【发布时间】:2017-09-04 08:27:44
【问题描述】:
迁移我的 Xamarin.Forms 项目以使用共享的 .NET Standard 项目而不是 PCL 之后(点击此链接 https://blog.xamarin.com/building-xamarin-forms-apps-net-standard/)
当我右键单击共享项目 (.NET Standard proj) 以使用 Prism 模板包创建带有 Prism ViewModel 的 Xamarin.Forms ContentPage 时,我收到此错误:
项目系统遇到错误。未设置对象引用 到一个对象的实例。诊断日志已写入 以下位置: “C:\Users\toumir\AppData\Local\Temp\VsProjectFault_7c3ce3c8-085f-4531-99cf-85d9a8b8ceee.failure.txt”。
日志文件内容:
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 )
还有另一个显示此消息的消息框:
对象引用未设置为对象的实例。
仅供参考:
- 使用PCL项目时没有问题
- 我的 App 类派生自
PrismApplication
谁能指导我们? 提前致谢
【问题讨论】:
标签: xamarin.forms prism .net-standard