Bug 40229 - Not hitting breakpoints (reproducible)
Summary: Not hitting breakpoints (reproducible)
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Debugger ()
Version: 4.0.0 (C6)
Hardware: PC Windows
: --- normal
Target Milestone: 4.3.0 (C9)
Assignee: Joaquin Jares
URL:
Depends on:
Blocks:
 
Reported: 2016-04-08 09:58 UTC by Sebastian Span
Modified: 2016-12-29 13:45 UTC (History)
8 users (show)

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


Attachments
Example (11.69 KB, application/x-zip-compressed)
2016-04-08 09:58 UTC, Sebastian Span
Details


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:
Status:
VERIFIED FIXED

Description Sebastian Span 2016-04-08 09:58:36 UTC
Created attachment 15652 [details]
Example

Visual Studio will not hit any breakpoints if <OutputPath> is definied in generic <PropertyGroup> section in .csproj using build variables.

Visual Studio 2015
Xamarin 4.0.4.214
Xamarin.Android 6.0.3.5

NOT WORKING (was working in Xamarin <4.x):
<PropertyGroup>
 ...
 <OutputPath>bin\$(Configuration)\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
 ...
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
 ...
</PropertyGroup>

WORKING
<PropertyGroup>
 ...
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
 <OutputPath>bin\$(Configuration)\</OutputPath>
 ...
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
 <OutputPath>bin\$(Configuration)\</OutputPath>
 ...
</PropertyGroup>

Example (s. attachment):
1. Add a breakpoint at first line in MainActivity.OnCreate 
2. Run application
3. VisualStudio is not hitting breakpoint

4. Change csproj. as above
5. Run application
6. VisualStudio is hitting breakpoint
Comment 1 Daniel Cazzulino 2016-05-09 21:28:07 UTC
Looks like an oversight when retrieving the output path property while initializing the debugger. We'll investigate.

Thanks!
Comment 2 Joaquin Jares 2016-11-30 15:21:43 UTC
This is now fixed in master.
Comment 3 Sachin Saini 2016-12-02 11:38:42 UTC
I have checked this issue with latest master  builds following by the step given in bug description and observed that its working fine on that with the following code also in .csproj file.
<PropertyGroup>
 ...
 <OutputPath>bin\$(Configuration)\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
 ...
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
 ...
</PropertyGroup>

Screencast: http://www.screencast.com/t/tzG1wWQA7Tal
Env info : https://gist.github.com/sachins360/af0b144256405c7b57e66078fb6270a3

I will verify this issue once changes get merge in cycle9 builds.

Thanks!
Comment 5 Jatin 2016-12-28 12:59:32 UTC
I have checked this issue with latest C9 build i.e. Xamarin.VisualStudio_4.3.0.508_f7d05dd4edccb2839a012cf9e14552ca82dc037e
and still facing this issue.

Supplement Info:
Screencast: http://www.screencast.com/t/stJ56SgT4g 
Envt Info: https://gist.github.com/sachins360/c6b849e2f9f9a11fdf16b1ace1f1cc39

So for now I am reopening this issue and will retest this issue when it will be fixed in C9.

Thanks!
Comment 6 Joaquin Jares 2016-12-28 13:06:20 UTC
Fix now commited to C9. Will be available after a debugger bump.
Comment 7 Sunil Kumar 2016-12-29 13:45:46 UTC
I have checked this issue with latest C9 Xamarin.VisualStudio_4.3.0.513_44aa1bca4fba08d44cedcfbfd0da171d5d13982f and observed that now this issue is working fine.

Screencast: https://www.screencast.com/t/aw5aF5MO

Hence closing this issue.

Environment info:
Microsoft Visual Studio Enterprise 2015
Version 14.0.23107.0 D14REL
Microsoft .NET Framework
Version 4.6.01586

Xamarin   4.3.0.513 (44aa1bc)
Xamarin.Android   7.1.0.16 (4ce2ebd)
Xamarin.iOS   10.4.0.63 (4c3a702)