Bug 56895 - VS2017 stable - previewer exception crash- no method found Button_click on type
Summary: VS2017 stable - previewer exception crash- no method found Button_click on type
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.4
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Stephane Delcroix
Depends on:
Reported: 2017-05-26 22:01 UTC by Stanley Broo
Modified: 2017-07-07 04:47 UTC (History)
6 users (show)

Tags: AC
Is this bug a regression?: ---
Last known good build:

printscreen that the clicked event actually exists :-) ..previewer cant see it? (352.58 KB, application/pdf)
2017-05-26 22:01 UTC, Stanley Broo

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 or GitHub 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 Stanley Broo 2017-05-26 22:01:12 UTC
Created attachment 22524 [details]
printscreen that the clicked event actually exists :-) ..previewer cant see it?

Exception occured An exception occured when rendering the control, No method found Button_Clicked.
Comment 1 Alan McGovern 2017-05-29 10:05:30 UTC
Can we adjust forms to silently ignore missing event handlers when running under the previewer?
Comment 2 Stanley Broo 2017-05-30 12:25:30 UTC
Very easy to reproduce the bug

vs2017 proffessional 
Xamarin updater - latest Form templates
latest everyting..

1. Create new Xamarin Forms PCL
2. In the MainPage.xaml paste som XAML code that includes a Button Clicked eventhandler.
3. The previewer will throw an exception ..no handler found
4. Add the clicked eventhandler from XAML page ..navigate to eventhandler.
5. check that the handler is in the codebehind ..save all files.

..Exception still there.

..remove the handlers from XAML
..previewer now works
..add the clicked handlers for the buttons again
..previewer now works with the handlers in the XAML
Comment 3 Stephane Delcroix 2017-05-30 13:49:29 UTC
this is a previewer issue, but we can workaround it in XF

Comment 4 Stanley Broo 2017-05-30 14:58:57 UTC
Same for Tapped Image ...PREVIEWER CANT FIND THE HANDLER?, It is there and we can navigate to it?

But for Tapped ..we can't do the workaround as for Button Clicked events
 ..removing and adding tappedevent wont make the previewer refresh
..the previewer never finds the tapped event in codebehind?

<Image x:Name="img1" HeightRequest="32" Margin="10" Source="map.png" >
                                NumberOfTapsRequired="1" />
Comment 5 Stanley Broo 2017-05-30 15:13:25 UTC
Some weird stuff going on with the background process of the previewer also.
This happens all the time working with the previewer in VS2017 proffessional
latest XF nuget STABLE and latest XF updater.

cxpf.dll is our xamarin PCL project 

Error list:

Severity	Code	Description	Project	File	Line	Suppression State
Error		Unable to copy file "obj\Debug\cxpf.dll" to "bin\Debug\cxpf.dll". The process cannot access the file 'bin\Debug\cxpf.dll' because it is being used by another process.	cxpf			

Severity	Code	Description	Project	File	Line	Suppression State
Error		Could not copy "obj\Debug\cxpf.dll" to "bin\Debug\cxpf.dll". Exceeded retry count of 10. Failed.	cxpf
Comment 6 Stephane Delcroix 2017-06-01 07:25:24 UTC
this will be included in 2.3.6-pre1, 2.3.5 and in services releases for 2.3.4 (if any)
Comment 7 Saurabh Paunikar 2017-06-30 13:13:17 UTC
I have used code 

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"

	<Label Text="Welcome to Xamarin Forms!" 
           HorizontalOptions="Center" />
    <Button Text="Click ME" Clicked="Button_Clicked">


And event Handler is not available in code behind,Still I am able to render Previewer. Is this expected behavior

Verified on Xamarin.form version
Comment 8 Jason Smith [MSFT] 2017-07-06 16:36:23 UTC
This is expected now yes
Comment 9 Saurabh Paunikar 2017-07-07 04:47:10 UTC
Verified on Xamarin.form version