microsoft / TemplateStudio

Template Studio accelerates the creation of new WinUI 3, WPF, and UWP apps using a wizard-based experience.
Other
2.68k stars 458 forks source link

Method not found on download #328

Closed ghost closed 7 years ago

ghost commented 7 years ago

I get a method not found error when templates are about to download.

mrlacey commented 7 years ago

Can you provide any additional information to help identify the cause of this:

AustinWinstanley commented 7 years ago

I'm getting the same:

Error generated in VS Community 2017 15.3-Pre

System.MissingMethodException: Method not found: 'System.Func`3<Microsoft.TemplateEngine.Abstractions.ITemplateInfo,System.String,System.Nullable`1<Microsoft.TemplateEngine.Edge.Template.MatchInfo>> Microsoft.TemplateEngine.Edge.Template.WellKnownSearchFilters.LanguageFilter(System.String)'.
   at Microsoft.Templates.Core.TemplatesRepository.GetAll()
   at Microsoft.Templates.UI.GenComposer.GetSupportedFx(String projectType)
   at Microsoft.Templates.UI.ViewModels.ProjectSetupViewModel.LoadFrameworks(MetadataInfoViewModel projectType, MetadataInfoViewModel orgFramework)
   at Microsoft.Templates.UI.ViewModels.ProjectSetupViewModel.set_SelectedProjectType(MetadataInfoViewModel value)
   at Microsoft.Templates.UI.ViewModels.ProjectSetupViewModel.<InitializeAsync>d__22.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.Templates.UI.Views.ProjectSetupView.<<-ctor>b__3_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Window.ShowHelper(Object booleanBox)
   at System.Windows.Window.Show()
   at System.Windows.Window.ShowDialog()
   at Microsoft.Internal.VisualStudio.PlatformUI.WindowHelper.ShowModal(Window window, IntPtr parent)
   at Microsoft.Templates.UI.VisualStudio.VsGenShell.ShowModal(Window dialog)
   at Microsoft.Templates.UI.GenController.GetUserSelection()

Yes

UPDATE

Ok, the first time it failed in VS 2017 15.2 Enterprise, then I tried in 15.3-preview (Enterprise and Community) then tried in 15.2 Enterprise again and it worked fine the second time.

ghost commented 7 years ago
crutkas commented 7 years ago

we saw something like this on preview the night before our session but couldn't repro on RTM. I got the same stack trace.

100% issue, i'm going to say this is a 1.01 issue to stabilize but VS non-preview does work with that error.

crutkas commented 7 years ago

Ok, i can repro this VS Preview with the VSIX but I cannot repro this in code.

crutkas commented 7 years ago

I've compiled and installed locally, doesn't seem to have an issue. I thought it may due to an outdated nuget to the template engine but the fact the dev branch won't cause this makes me wonder

crutkas commented 7 years ago

Ok, release mode compile local VSIX confirmed to cause this.

crutkas commented 7 years ago

Fix ready. Updating the nuget reference to the VS template generator fixed this in #344

mrlacey commented 7 years ago

@crutkas Why does updating the NuGet package fix this? Would be good to understand what the actual issue is and why it only affected some people. What's to stop this new version affecting a different set of people?

crutkas commented 7 years ago

VS 15.3 Preview updated a reference and they have a bug where they weren't rev'ing the Assembly. We referenced an older assembly and we exploded.

https://github.com/dotnet/templating/issues/804

mrlacey commented 7 years ago

Hmm. reported as affecting VS15.2 as well though. Hopefully a reporting error. A good argument for getting more (system) info added to the error dialog.

crutkas commented 7 years ago

@mrlacey who reported this exact issue on 15.2?

mrlacey commented 7 years ago

@crutkas it's in this thread above

Ok, the first time it failed in VS 2017 15.2 Enterprise

crutkas commented 7 years ago

@AustinWinstanley can you reach out to me. the fact this happend on a 15.2 install worries me but every other report seems to be 15.3.

crutkas commented 7 years ago

Fix is in production