Prism 模板包 - 在 .net 标准分片项目中添加 Xamarin.Forms ContentPage 模板项时出错
Prism Template Pack - Error when Adding Xamarin.Forms ContentPage template item in .net standard shard project
在 迁移 我的 Xamarin.Forms 项目以使用共享 .NET Standard 项目而不是 PCL 之后(在此 link https://blog.xamarin.com/building-xamarin-forms-apps-net-standard/)
当我右键单击共享项目(.NET Standard proj)以使用 Prism 模板包使用 Prism ViewModel 创建 Xamarin.Forms ContentPage
时,我收到此错误:
The project system has encountered an error. Object reference not set
to an instance of an object. A diagnostic log has been written to the
following location:
"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 )
还有另一个消息框显示此消息:
Object reference not set to an instance of an object.
仅供参考:
- 使用PCL项目时没有问题
- 我的应用程序 class 来自
PrismApplication
谁能指导我们?
提前致谢
Prism 模板包目前不正式支持 .NET Standard 项目格式。 Xamarin 不附带任何与 .NET Standard 兼容的项目模板,并且 Xamarin 本身不是 .NET Standard。当 Xamarin 更新到 .NET Standard 时,Prism 模板包将随之更新。
在 迁移 我的 Xamarin.Forms 项目以使用共享 .NET Standard 项目而不是 PCL 之后(在此 link https://blog.xamarin.com/building-xamarin-forms-apps-net-standard/)
当我右键单击共享项目(.NET Standard proj)以使用 Prism 模板包使用 Prism ViewModel 创建 Xamarin.Forms ContentPage
时,我收到此错误:
The project system has encountered an error. Object reference not set to an instance of an object. A diagnostic log has been written to the following location: "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 )
还有另一个消息框显示此消息:
Object reference not set to an instance of an object.
仅供参考:
- 使用PCL项目时没有问题
- 我的应用程序 class 来自
PrismApplication
谁能指导我们? 提前致谢
Prism 模板包目前不正式支持 .NET Standard 项目格式。 Xamarin 不附带任何与 .NET Standard 兼容的项目模板,并且 Xamarin 本身不是 .NET Standard。当 Xamarin 更新到 .NET Standard 时,Prism 模板包将随之更新。