Bug 56778 - Xamarin.iOS doesn't hit breakpoints with VS2017
Summary: Xamarin.iOS doesn't hit breakpoints with VS2017
Status: RESOLVED DUPLICATE of bug 55515
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Debugger ()
Version: 4.5.0 (15.2)
Hardware: PC Windows
: --- blocker
Target Milestone: ---
Assignee: Joaquin Jares
URL:
Depends on:
Blocks:
 
Reported: 2017-05-23 23:17 UTC by Ruben Buniatyan
Modified: 2017-05-30 21:31 UTC (History)
10 users (show)

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


Attachments
Logs (53.16 KB, application/x-zip-compressed)
2017-05-30 14:13 UTC, Philipp Sumi
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:
RESOLVED DUPLICATE of bug 55515

Description Ruben Buniatyan 2017-05-23 23:17:13 UTC
# Steps to reproduce
Simply set a breakpoint in a newly created iOS project

# Expected behavior
Debugger must hit the breakpoint

# Actual behavior
Debugger ignores any breakpoint

# Supplemental info (logs, images, videos)


# Test environment (full version information)
Microsoft Visual Studio Enterprise 2017 
Version 15.2 (26430.6) Release
VisualStudio.15.Release/15.2.0+26430.6
Microsoft .NET Framework
Version 4.7.02046

Installed Version: Enterprise

Visual Basic 2017   00369-90000-00000-AA049
Microsoft Visual Basic 2017

Visual C# 2017   00369-90000-00000-AA049
Microsoft Visual C# 2017

Application Insights Tools for Visual Studio Package   8.6.00404.2
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2017   15.0.30503.0
ASP.NET and Web Tools 2017

ASP.NET Web Frameworks and Tools 2017   5.2.50303.0
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   15.0.30209.0
Azure App Service Tools v3.0.0

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

JavaScript Language Service   2.0
JavaScript Language Service

JetBrains ReSharper Ultimate 2017.1.2    Build 108.0.20170428.75743
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2017 JetBrains, Inc.

KofePackagePackage Extension   1.0
KofePackagePackage Visual Studio Extension Detailed Info

Merq   1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

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

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

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

SQL Server Data Tools   15.1.61702.140
Microsoft SQL Server Data Tools

TypeScript   2.2.2.0
TypeScript tools for Visual Studio

Xamarin   4.5.0.443 (c871575)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK   7.3.0.13 (448f54f)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK   10.10.0.30 (30b6e87)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Comment 1 Sherlock 2017-05-24 13:47:37 UTC
I have this issue too, it is driving me mad.
Comment 2 Emanuel 2017-05-24 14:08:27 UTC
Hi All, I'm sorry you're facing this issue. There's a known issue on Xamarin 4.5.0.443 that prevents users to hit breakpoints on iOS on certain environments, but I cannot ensure that's your case with the given information.

This is a workaround to the mentioned known issue:
1- On Windows, open the Visual Studio 2017 installation folder. (Default: C:\Program Files (x86)\Microsoft Visual Studio\2017\<Edition>\)
2- Navigate to MSBuild\Xamarin.
3- Open the Xamarin.Apple.Sdk.targets file in an editor with Administrator privileges.
4- At the end of the file you'll find a PropertyGroup (line 100), between the PropertyGroup tags add the following line:
<FrameworkPathOverride>$(TargetFrameworkRootPath)$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)</FrameworkPathOverride>

Please, let me know if this workaround works for you. In case you're still able to reproduce this bug, please attach a Detailed build output and the Xamarin Logs (Help -> Xamarin -> Zip Logs...)

Thanks!
Comment 3 Homero Lara 2017-05-24 15:10:53 UTC
Hi Emanuel,

I'm having the same issue but it's happening for me on Android. Should I follow these same steps to correct the issue?

Thanks,
Homero
Comment 4 Ruben Buniatyan 2017-05-24 15:38:26 UTC
The workaround works. Thank you much, Emanuel.

@Homero Did you check the bug 56225?
Comment 5 Homero Lara 2017-05-24 15:42:46 UTC
@Ruben,

I'll check out the details on that bug. Thanks for the reply.
Comment 6 Emanuel 2017-05-24 17:05:51 UTC
@Ruben that's great! The issue is already fixed and that fix will be published in the next release. Thanks!

@Homero, this bug and the workaround are specific of iOS projects.

*** This bug has been marked as a duplicate of bug 55515 ***
Comment 7 Philipp Sumi 2017-05-30 14:12:57 UTC
@Emanuel - that didn't work for me unfortunately (VS 2017 Enterprise, Win10 x64) Attaching the logs now...
Comment 8 Philipp Sumi 2017-05-30 14:13:46 UTC
Created attachment 22550 [details]
Logs
Comment 9 Philipp Sumi 2017-05-30 21:14:38 UTC
FYI, I just installed the latest VS2017 15.2 update, and now the app crashes when about to hit the breakpoint, and VS shows the following dialog:

---------------------------
Microsoft Visual Studio
---------------------------
EXCEPTION: Mono.Debugging.Soft.DisconnectedException: The connection with the debugger has been lost. The target application may have exited. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. The system cannot find the file specified.

   at Mono.Debugging.Soft.SoftDebuggerSession.ResolveSymbolicLink(String path)

   at Mono.Debugging.Soft.SoftDebuggerSession.PathsAreEqual(String p1, String p2)

   at Mono.Debugging.Soft.SoftDebuggerSession.FindLocationByMethod(MethodMirror method, String file, Int32 line, Int32 column, Boolean& insideTypeRange)

   at Mono.Debugging.Soft.SoftDebuggerSession.FindLocationByType(TypeMirror type, String file, Int32 line, Int32 column, Boolean& genericMethod, Boolean& insideTypeRange)

   at Mono.Debugging.Soft.SoftDebuggerSession.ResolveBreakpoints(TypeMirror type)

   at Mono.Debugging.Soft.SoftDebuggerSession.HandleTypeLoadEvents(TypeLoadEvent[] events)

   at Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet(EventSet es)

   at Mono.Debugging.Soft.SoftDebuggerSession.EventHandler()

   --- End of inner exception stack trace ---
---------------------------
OK   
---------------------------
Comment 10 Emanuel 2017-05-30 21:31:26 UTC
Hi @Philipp,
You're hitting a different issue, please refer to this bug https://bugzilla.xamarin.com/show_bug.cgi?id=56787.

Thanks!