Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS2019 iOS Designer not working with custom controls #5677

Closed
arivoir opened this issue Feb 27, 2019 · 7 comments
Closed

VS2019 iOS Designer not working with custom controls #5677

arivoir opened this issue Feb 27, 2019 · 7 comments
Labels
external-designer Issues affecting the Xamarin iOS Designer and are not specific to Xamarin.iOS or Xamarin.Mac
Milestone

Comments

@arivoir
Copy link

arivoir commented Feb 27, 2019

Steps to Reproduce

1.Open iOS Main.storyboard containing custom controls in VS2019 Preview3 for Windows.

Expected Behavior

It should display the controls in the designer and the properties in the properties panel.

Actual Behavior

"Custom components are not being rendererd because problems were detected" message appear in the designer, and the following error in the log "ERROR: Unexpected error while populating the toolbox"

Environment

`Microsoft Visual Studio Enterprise 2019 Preview
Version 16.0.0 Preview 3.0
VisualStudio.16.Preview/16.0.0-pre.3.0+28608.199
Microsoft .NET Framework
Version 4.7.03190

Installed Version: Enterprise

Visual C++ 2019 00435-10000-00000-AA094
Microsoft Visual C++ 2019

Application Insights Tools for Visual Studio Package 9.0.20206.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2019 16.0.12185.18740
ASP.NET and Web Tools 2019

Azure App Service Tools v3.0.0 16.0.12185.18740
Azure App Service Tools v3.0.0

C# Tools 3.0.0-beta3-19105-04+f9fc5ea40f861ac30e7ad1a322b7517d4af5d47b
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus 1.1.77 (master@24013d5)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards 1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio VC Package 1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio 16.0.300 (573eda3)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager 5.0.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

ResourcePackage Extension 1.0
ResourcePackage Visual Studio Extension Detailed Info

ResourcePackage Extension 1.0
ResourcePackage Visual Studio Extension Detailed Info

TypeScript Tools 16.0.10206.2003
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 3.0.0-beta3-19105-04+f9fc5ea40f861ac30e7ad1a322b7517d4af5d47b
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.4 for F# 4.6 16.0.0.0. Commit Hash: b5c01b8cc65af6381d2dd558ee63a4aa9e0e98d5.
Microsoft Visual F# Tools 10.4 for F# 4.6

Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

VisualStudio.Mac 1.0
Mac Extension for Visual Studio

Xamarin 16.0.0.433 (d16-0@949c8f6c5)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 4.17.287 (feb5c9860)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 16.0.330 (e66cdf3)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 9.1.103.12 (HEAD/7e1c4688)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: mono/mono@725ba2a2523
Java.Interop: xamarin/java.interop@c987483
LibZipSharp: grendello/LibZipSharp/master@44de300
LibZip: nih-at/libzip@b95cf3f
MXE: xamarin/mxe@b9cbb535
ProGuard: xamarin/proguard@905836d
SQLite: xamarin/sqlite@325e91a
Xamarin.Android Tools: xamarin/xamarin-android-tools@f05c0aa

Xamarin.iOS and Xamarin.Mac SDK 12.6.0.16 (bc9c674)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.``


### Build Logs

[2019-02-27 11:24:13.8] ERROR: Unexpected error while populating the toolbox
MonoTouch.Design.Client.InvalidSessionException: Error in the application.
   at MonoTouch.Design.Client.ServerProcessConnection.SendRequest(CommandRequest req, Boolean throwIfNotRunning)
   at MonoTouch.Design.Client.ServerProcessConnection.SendRequest[TResponse](CommandRequest req, Boolean throwIfNotRunning)
   at MonoTouch.Design.Client.ServerProcessConnection.PostXml(DesignSession session, String xml, String[] viewsToHide)
   at MonoTouch.Design.Client.ServerProcessConnection.PostBatchedXml(DesignSession session, XElement documentContext, XElement[] individualViews)
   at MonoTouch.Design.Client.IPhoneDesignerSession.RenderCore(ServerProcessConnection c, XElement documentContext, XElement[] elements, CancellationToken token)
   at MonoTouch.Design.Client.IPhoneDesignerSession.<>c__DisplayClass234_0.<Render>b__0()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- 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 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at MonoTouch.Design.Client.IPhoneToolbox.<ReloadCore>d__11.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 MonoTouch.Design.Client.IPhoneToolbox.<MonoTouch-Design-Client-ISessionReloadable-Reload>d__10.MoveNext()

[iOSDesigner-2019-02-27__11-23-55.8444.log](https://github.com/xamarin/xamarin-macios/files/2910681/iOSDesigner-2019-02-27__11-23-55.8444.log)

> VS bug [#803932](https://devdiv.visualstudio.com/DevDiv/_workitems/edit/803932)
@mandel-macaque mandel-macaque added the external-designer Issues affecting the Xamarin iOS Designer and are not specific to Xamarin.iOS or Xamarin.Mac label Feb 28, 2019
@mandel-macaque mandel-macaque added this to the Future milestone Feb 28, 2019
@mandel-macaque
Copy link
Member

@arivoir thanks for the report. I have tagged the issue so that the correct ends take a look.

@viniciusjarina
Copy link

Hi @arivoir what is the custom control your trying to load?

@arivoir
Copy link
Author

arivoir commented Mar 1, 2019

Any of the GrapeCity controls I'm working on.

@viniciusjarina
Copy link

@arivoir can you give more details on how to use the GrapeCity controls? or create a step by step way to repro the issue? Thank you

@arivoir
Copy link
Author

arivoir commented Jun 1, 2019

Sure, here are the steps

  • Open Visual Studio 2019 for Mac 8.0.9 build5
  • File-New solution
  • Choose iOS-App-Single View App
  • Chose whatever name and directory you want for the project
  • Add Nuget Packages
  • Enter "C1.iOS.Grid"
  • Accept licenses
  • Open Main.storyboard
  • Right there it shows a message saying "Custom components are not being rendered because problems were detected" even before adding the controls to the interface

@arivoir
Copy link
Author

arivoir commented Jun 1, 2019

Here there is the exception I got from the log file

[2019-06-01 12:44:02.6] ERROR: Unexpected error while populating the toolbox
MonoTouch.Design.Client.InvalidSessionException: Error in the application.
at MonoTouch.Design.Client.ServerProcessConnection.SendRequest (MonoTouch.Design.CommandRequest req, System.Boolean throwIfNotRunning) [0x000ac] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/Connection/ServerProcessConnection.cs:248
at MonoTouch.Design.Client.ServerProcessConnection.PostXml (MonoTouch.Design.DesignSession session, System.String xml, System.String[] viewsToHide) [0x00016] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/Connection/ServerProcessConnection.cs:193
at MonoTouch.Design.Client.ServerProcessConnection.PostBatchedXml (MonoTouch.Design.DesignSession session, System.Xml.Linq.XElement documentContext, System.Xml.Linq.XElement[] individualViews) [0x00071] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/Connection/ServerProcessConnection.cs:130
at MonoTouch.Design.Client.IPhoneDesignerSession.RenderCore (MonoTouch.Design.Client.ServerProcessConnection c, System.Xml.Linq.XElement documentContext, System.Xml.Linq.XElement[] elements, System.Threading.CancellationToken token) [0x00001] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/IPhoneDesignerSession.cs:1666
at MonoTouch.Design.Client.IPhoneDesignerSession+<>c__DisplayClass243_0.b__0 () [0x00000] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/IPhoneDesignerSession.cs:1661
at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0000f] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-08/external/bockbuild/builds/mono-x64/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Future.cs:544
at System.Threading.Tasks.Task.Execute () [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-08/external/bockbuild/builds/mono-x64/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:2343
--- End of stack trace from previous location where exception was thrown ---

at MonoTouch.Design.Client.IPhoneToolbox.ReloadCore (MonoTouch.Design.IModelObjectContext context, MonoTouch.Design.Client.ServerProcessConnection connection, System.Threading.CancellationToken token) [0x001ee] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/IPhoneToolbox.cs:83
at MonoTouch.Design.Client.IPhoneToolbox.MonoTouch.Design.Client.ISessionReloadable.Reload (MonoTouch.Design.IModelObjectContext context, MonoTouch.Design.Client.ServerProcessConnection connection, System.Threading.CancellationToken token) [0x0003b] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/IPhoneToolbox.cs:50
[2019-06-01 12:44:02.6] INFO: Invalidating all connections
[2019-06-01 12:44:02.6] INFO: Recycled process with pid 4615
[2019-06-01 12:44:02.6] ERROR: EnsureSession (counter 1): System.AggregateException: One or more errors occurred. (Exception of type 'MonoTouch.Design.Client.InvalidSessionException' was thrown.) (Exception of type 'MonoTouch.Design.Client.InvalidSessionException' was thrown.) ---> MonoTouch.Design.Client.InvalidSessionException: Exception of type 'MonoTouch.Design.Client.InvalidSessionException' was thrown. ---> MonoTouch.Design.Client.InvalidSessionException: Error in the application.
at MonoTouch.Design.Client.ServerProcessConnection.SendRequest (MonoTouch.Design.CommandRequest req, System.Boolean throwIfNotRunning) [0x000ac] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/Connection/ServerProcessConnection.cs:248
at MonoTouch.Design.Client.ServerProcessConnection.PostXml (MonoTouch.Design.DesignSession session, System.String xml, System.String[] viewsToHide) [0x00016] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/Connection/ServerProcessConnection.cs:193
at MonoTouch.Design.Client.ServerProcessConnection.PostBatchedXml (MonoTouch.Design.DesignSession session, System.Xml.Linq.XElement documentContext, System.Xml.Linq.XElement[] individualViews) [0x00071] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/Connection/ServerProcessConnection.cs:130
at MonoTouch.Design.Client.IPhoneDesignerSession.RenderCore (MonoTouch.Design.Client.ServerProcessConnection c, System.Xml.Linq.XElement documentContext, System.Xml.Linq.XElement[] elements, System.Threading.CancellationToken token) [0x00001] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/IPhoneDesignerSession.cs:1666
at MonoTouch.Design.Client.IPhoneDesignerSession+<>c__DisplayClass243_0.b__0 () [0x00000] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/IPhoneDesignerSession.cs:1661
at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0000f] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-08/external/bockbuild/builds/mono-x64/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Future.cs:544
at System.Threading.Tasks.Task.Execute () [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-08/external/bockbuild/builds/mono-x64/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:2343
--- End of stack trace from previous location where exception was thrown ---

at MonoTouch.Design.Client.IPhoneToolbox.ReloadCore (MonoTouch.Design.IModelObjectContext context, MonoTouch.Design.Client.ServerProcessConnection connection, System.Threading.CancellationToken token) [0x001ee] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/IPhoneToolbox.cs:83
at MonoTouch.Design.Client.IPhoneToolbox.MonoTouch.Design.Client.ISessionReloadable.Reload (MonoTouch.Design.IModelObjectContext context, MonoTouch.Design.Client.ServerProcessConnection connection, System.Threading.CancellationToken token) [0x0003b] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/IPhoneToolbox.cs:50
--- End of inner exception stack trace ---
at MonoTouch.Design.Client.IPhoneToolbox.MonoTouch.Design.Client.ISessionReloadable.Reload (MonoTouch.Design.IModelObjectContext context, MonoTouch.Design.Client.ServerProcessConnection connection, System.Threading.CancellationToken token) [0x000e8] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/IPhoneToolbox.cs:55
at MonoTouch.Design.Client.IPhoneDesignerSession.SetupSession (MonoTouch.Design.DesignSession session, Xamarin.Designer.Telemetry.ITelemetryCorrelation correlation, System.Threading.CancellationToken token) [0x004f0] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/IPhoneDesignerSession.cs:2170
--- End of inner exception stack trace ---
---> (Inner Exception #0) MonoTouch.Design.Client.InvalidSessionException: Exception of type 'MonoTouch.Design.Client.InvalidSessionException' was thrown. ---> MonoTouch.Design.Client.InvalidSessionException: Error in the application.
at MonoTouch.Design.Client.ServerProcessConnection.SendRequest (MonoTouch.Design.CommandRequest req, System.Boolean throwIfNotRunning) [0x000ac] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/Connection/ServerProcessConnection.cs:248
at MonoTouch.Design.Client.ServerProcessConnection.PostXml (MonoTouch.Design.DesignSession session, System.String xml, System.String[] viewsToHide) [0x00016] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/Connection/ServerProcessConnection.cs:193
at MonoTouch.Design.Client.ServerProcessConnection.PostBatchedXml (MonoTouch.Design.DesignSession session, System.Xml.Linq.XElement documentContext, System.Xml.Linq.XElement[] individualViews) [0x00071] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/Connection/ServerProcessConnection.cs:130
at MonoTouch.Design.Client.IPhoneDesignerSession.RenderCore (MonoTouch.Design.Client.ServerProcessConnection c, System.Xml.Linq.XElement documentContext, System.Xml.Linq.XElement[] elements, System.Threading.CancellationToken token) [0x00001] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/IPhoneDesignerSession.cs:1666
at MonoTouch.Design.Client.IPhoneDesignerSession+<>c__DisplayClass243_0.b__0 () [0x00000] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/IPhoneDesignerSession.cs:1661
at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0000f] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-08/external/bockbuild/builds/mono-x64/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Future.cs:544
at System.Threading.Tasks.Task.Execute () [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-08/external/bockbuild/builds/mono-x64/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:2343
--- End of stack trace from previous location where exception was thrown ---

at MonoTouch.Design.Client.IPhoneToolbox.ReloadCore (MonoTouch.Design.IModelObjectContext context, MonoTouch.Design.Client.ServerProcessConnection connection, System.Threading.CancellationToken token) [0x001ee] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/IPhoneToolbox.cs:83
at MonoTouch.Design.Client.IPhoneToolbox.MonoTouch.Design.Client.ISessionReloadable.Reload (MonoTouch.Design.IModelObjectContext context, MonoTouch.Design.Client.ServerProcessConnection connection, System.Threading.CancellationToken token) [0x0003b] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/IPhoneToolbox.cs:50
--- End of inner exception stack trace ---
at MonoTouch.Design.Client.IPhoneToolbox.MonoTouch.Design.Client.ISessionReloadable.Reload (MonoTouch.Design.IModelObjectContext context, MonoTouch.Design.Client.ServerProcessConnection connection, System.Threading.CancellationToken token) [0x000e8] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/IPhoneToolbox.cs:55
at MonoTouch.Design.Client.IPhoneDesignerSession.SetupSession (MonoTouch.Design.DesignSession session, Xamarin.Designer.Telemetry.ITelemetryCorrelation correlation, System.Threading.CancellationToken token) [0x004f0] in /Users/vsts/agent/2.150.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/IPhoneDesignerSession.cs:2170 <---

@viniciusjarina
Copy link

Hello @arivoir thank you for the detailed report.

I've tested here with the latest version of VS4M. From the logs it seems the problem is on the C1.iOS.Grid component side.

com.xamarin.MTHosting.19154a1.stderr: 2019-06-14 16:00:31.726 MonoTouchDesignServerUnified[841:24744] [2019-06-14 16:00:31.7] ERROR: Runtime.MarshalManagedException: 
System.NullReferenceException: Object reference not set to an instance of an object
  at C1.iOS.Grid.GridManipulationLayer.Layout (CoreGraphics.CGSize finalSize) [0x00030] in <e6cb1dac6dd44c629ab2d900289971fa>:0 
  at C1.iOS.Grid.GridManipulationLayer.LayoutSubviews () [0x0006c] in <e6cb1dac6dd44c629ab2d900289971fa>:0 

@xamarin xamarin locked as resolved and limited conversation to collaborators May 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
external-designer Issues affecting the Xamarin iOS Designer and are not specific to Xamarin.iOS or Xamarin.Mac
Projects
None yet
Development

No branches or pull requests

3 participants