Bug 52704 - Regression: the Xamarin Forms Previewer now requires empty constructors for pages
Summary: Regression: the Xamarin Forms Previewer now requires empty constructors for p...
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Xamarin.Forms Previewer ()
Version: unspecified
Hardware: PC Windows
: --- critical
Target Milestone: ---
Assignee: Bugzilla
: 51228 ()
Depends on:
Reported: 2017-02-23 12:58 UTC by Dimitar Dobrev
Modified: 2017-07-07 18:41 UTC (History)
8 users (show)

Tags: Cycle9R
Is this bug a regression?: Yes
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Dimitar Dobrev 2017-02-23 12:58:05 UTC
# Steps to reproduce

1. Create a Xamarin Forms page;
2. Add some components to it;
3. Add any parameter to its constructor;
4. Rebuild the solution so that the Xamarin Forms Previewer works with the latest assemblies;
4. Try previewing the page.

# Expected behaviour

The page is previewed.

# Actual behaviour

 A message appears saying a parameterless constructor is required.

# Supplemental info (logs, images, videos)

# Test environment (full version information)

Microsoft Visual Studio Community 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01055

Installed Version: Community

Visual Basic 2015   00322-20000-00000-AA017
Microsoft Visual Basic 2015

Visual C# 2015   00322-20000-00000-AA017
Microsoft Visual C# 2015

Visual C++ 2015   00322-20000-00000-AA017
Microsoft Visual C++ 2015

ASP.NET and Web Tools 2015.1   14.1.21111.0
ASP.NET and Web Tools 2015.1

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/

Azure App Service Tools v2.9.6   14.0.21111.0
Azure App Service Tools v2.9.6

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.2.2100.0
Microsoft Azure Data Lake Tools for Visual Studio

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


GhostDoc   5.4.16325.0
GhostDoc automatically generates XML documentation comments.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

Merq   1.1.14-alpha (21c13c9)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft .NET Core Tools (Preview 2)   14.1.21111.0
Microsoft .NET Core Tools (Preview 2)

Microsoft Azure Hive Query Language Service   2.2.2100.0
Language service for Hive query

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2015 - v2.9.41104.6

Mono Debugging for Visual Studio   Mono.Debugging.VisualStudio
Support for debugging Mono processes with Visual Studio.

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

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

Refactoring Essentials   1.0
Refactoring Essentials Extension Details

SQL Server Data Tools   14.0.61021.0
Microsoft SQL Server Data Tools

SQLite & SQL Server Compact Toolbox   4.6.0
SQLite & SQL Server Compact Toolbox adds scripting, import, export, rename, query execution and much more to SQL Server Compact & SQLite Data Connections.

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript tools for Visual Studio

Xamarin (73f58d6)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android (9578cdc)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS (35d1ccd)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 1 Paul DiPietro [MSFT] 2017-02-23 17:17:05 UTC
Reassigning to Previewer team to look at this.
Comment 2 Alan McGovern 2017-02-23 17:40:23 UTC
This is expected behaviour. It is not possible to instantiate the correct class unless there's a constructor we can invoke. We can't invoke a constructor with arbitrary values as we have no generic way to create objects of the correct type.
Comment 3 Dimitar Dobrev 2017-02-23 17:57:14 UTC
No, it's not because it's a regression. It used to work in the version just prior to this one.
Comment 4 Adam Hill 2017-02-23 20:49:10 UTC
I can confirm this works in my Cycle 8 VS.
Comment 7 Paul DiPietro [MSFT] 2017-03-02 17:04:15 UTC
*** Bug 51228 has been marked as a duplicate of this bug. ***
Comment 8 Pierce Boggan [MSFT] 2017-07-07 18:41:51 UTC
Thanks so much for taking the time to file this bug @Dimitar! :) As stated previously, this is the expected behavior for the Forms Previewer. It was _not_ intended that this worked in Cycle 8, because it could cause some unintended consequences.

Think of this as similar to UWP's `DesignMode2Enabled`, allowing you to set properties and metadata for the Previewer to render. I typically use this constructor just setting up some design-time data for my data bindings.