Error creating event handler in for Swift WPF app

I’m a first time user of RemObjects, but I haven’t been successful in getting through the WPF Windows App (for Swift) tutorial because of installation issues.

I’ve just created a new virtual machine with a clean version of Windows 10 (Version 1909), installed Visual Studio 2019 Community edition and latest release of RemObjects Water (with support for Visual Studio).

All seems good until I try to create an event handler for the button (in the tutorial). When I double-click on the button I receive the following Visual Studio dll error:

System.TypeLoadException
Could not load type 'Microsoft.VisualStudio.DesignTools.Utility.ITypeNameFormatter' from assembly 'Microsoft.VisualStudio.DesignTools.Utility, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
   at RemObjects.Oxygene.VisualStudio.OxygeneProject.DesignerContextProviders.OxygeneEventBindingProvider.EVParamInfo..ctor(EventParameter aParam, CodeCompletionCompiler aCompiler)
   at RemObjects.Oxygene.VisualStudio.OxygeneProject.DesignerContextProviders.OxygeneEventBindingProvider.<GetCompatibleMethods>d__1.<MoveNext>b__1(EventParameter a)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at RemObjects.Oxygene.VisualStudio.OxygeneProject.DesignerContextProviders.OxygeneEventBindingProvider.<GetCompatibleMethods>d__1.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.RemoteHostCodeContext.<>c__DisplayClass18_0.<Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.IRemoteHostCodeContext.GetCompatibleMethods>b__0()
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass48_0`1.<MarshalIn>b__0()
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()

System.TypeLoadException
Could not load type 'Microsoft.VisualStudio.DesignTools.Utility.ITypeNameFormatter' from assembly 'Microsoft.VisualStudio.DesignTools.Utility, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

Server stack trace: 
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.MarshalInSynchronous(Action action, Int32 targetApartmentId, CancellationToken cancelToken, CallModality callModality, String methodName, String filePath, Int32 lineNumber)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.MarshalIn(Action action, Int32 targetApartmentId, CancellationToken cancelToken, CallSynchronizationMode syncMode, CallModality callModality, String methodName, String filePath, Int32 lineNumber)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.ThreadMarshaler.MarshalIn(IRemoteObject targetObject, Action action, CallSynchronizationMode syncMode, CallModality callModality, ApartmentState apartmentState, String memberName, String filePath, Int32 lineNumber)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.ThreadMarshaler.MarshalIn[TResult](IRemoteObject targetObject, Func`1 func, CallModality callModality, ApartmentState apartmentState, String memberName, String filePath, Int32 lineNumber)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.RemoteHostCodeContext.Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.IRemoteHostCodeContext.GetCompatibleMethods(String eventName, RemoteHostParameter[] parameters, String returnType)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.IRemoteHostCodeContext.GetCompatibleMethods(String eventName, RemoteHostParameter[] parameters, String returnType)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.LocalHostCodeContext.<>c__DisplayClass19_0.<Microsoft.VisualStudio.DesignTools.DesignerContract.IHostCodeContext.GetCompatibleMethods>b__0(IRemoteHostCodeContext cxt)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass32_0`2.<MarshalOut>b__0()
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()

System.TypeLoadException
Could not load type 'Microsoft.VisualStudio.DesignTools.Utility.ITypeNameFormatter' from assembly 'Microsoft.VisualStudio.DesignTools.Utility, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.MarshalOutSynchronous(Action action, Int32 targetApartmentId, WaitHandle aborted, WaitHandle timeoutSignal, CancellationToken cancelToken, String methodName, String filePath, Int32 lineNumber)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.MarshalOut(Action action, Int32 targetApartmentId, WaitHandle aborted, CancellationToken cancelToken, CallSynchronizationMode syncMode, WaitHandle timeoutSignal, String methodName, String filePath, Int32 lineNumber)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.ThreadMarshaler.MarshalOut[TValue](RemoteHandle`1 targetObject, Action action, CallSynchronizationMode syncMode, ApartmentState apartmentState, String methodName, String filePath, Int32 lineNumber)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.ThreadMarshaler.MarshalOut[TResult,TValue](RemoteHandle`1 targetObject, Func`2 func, CallSynchronizationMode syncMode, ApartmentState apartmentState, String methodName, String filePath, Int32 lineNumber)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.LocalHostCodeContext.Microsoft.VisualStudio.DesignTools.DesignerContract.IHostCodeContext.GetCompatibleMethods(IHostCodeEvent codeEvent)
   at Microsoft.VisualStudio.DesignTools.Designer.UI.PropertyInspector.CodeContext.CreateEventHandler(ISourceItemContext item, String typeName, IEvent eventKey, String methodName)
   at Microsoft.VisualStudio.DesignTools.Designer.UI.PropertyInspector.EventHandlerProvider.CreateEventHandler(IEvent eventKey, String methodName)
   at Microsoft.VisualStudio.DesignTools.Designer.UI.PropertyInspector.EventHandlerModel.SetMethodName(String newName)
   at Microsoft.VisualStudio.DesignTools.Designer.UI.PropertyInspector.EventHandlerModel.GenerateAndCommit()
   at Microsoft.VisualStudio.DesignTools.Designer.Tools.Selection.ElementEditorBehavior.ProcessDoubleClick(Boolean setDefaultHandler, SceneNode clickedElement)
   at Microsoft.VisualStudio.DesignTools.XamlDesigner.Tools.XamlElementEditorBehavior.ProcessDoubleClick(Boolean setDefaultHandler, SceneNode clickedElement)
   at Microsoft.VisualStudio.DesignTools.Designer.Tools.Selection.ElementEditorBehavior.OnClickEnd(Point pointerPosition, Int32 clickCount)
   at Microsoft.VisualStudio.DesignTools.Designer.Tools.EventRouter.ScopeElement_MouseUp(Object sender, MouseButtonEventArgs args)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(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.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.DesignerProcess.RunApplication()
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.DesignerProcess.<>c__DisplayClass3_0.<Main>b__0()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   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 System.Threading.ThreadHelper.ThreadStart()

It also happens if I merely type the name of the event handler into the properties of the button. I’ve run a repair from both the visual studio installation and the RemObjects installation, but that doesn’t seem to help.

Surely someone has gotten RemObjects Swift up and running in Visual Studio on Windows, so any advice on solving this installation issue of RemObjects would be greatly appreciated.

Thanks,

  • Ron

Ron,

I’m sorry about this, this definitely sounds like a bug on our side. I am assuming you are using build .2525, right?

I’ve uploaded the more recent build .2539 from Friday to you Personal Downloads page. Can you see if the problem persists for you with that version? In either case, I’ll log a bug and will try to get this addressed this coming week.

thanx,
marc

Thanks, logged as bugs://84781

Hi Marc,

Thanks for looking at this on a Sunday. Yep, it was version 2525. I’ll try the latest build and let you know.

Best,

  • Ron
1 Like

Cool, thanx!

Hi Marc,

I just went looking for that build in my personal downloads but didn’t see it. Not wanting to push you on a Sunday, so just let me know when it’s there and I’ll give it a try. In the meantime, I’m going to uninstall Visual Studio 2019 community and install Visual Studio 2017 community to see if there is any difference.

Thanks,

  • Ron

Hi Mark,

Just wanted to let you know that version 2525 does work as expected with Visual Studio 2017 Community edition. I’ll just stick with that for now. Let me know if you want me to test your latest build with the latest version of Visual Studio.

Thanks,

  • Ron

Strange. your login is yout gmail address, right? Or do you have a second account?

No worries. What are weekdays? :wink:

Interesting. That’s good info to have, that it’s 2019-specifc; its will help narrow this down.

—marc

Confirmed the issue with VS2019, even in the latest.

Sorry, you’'re totally correct in that yes I forgot I had created 2 accounts and I had just looked at my business email.

I saw that you had independently confirmed the issue even with the latest build. Please let me know if there is anything else I can do to help the effort.

1 Like

bugs://84781 got closed with status fixed.