Bug 41966 - Wrong mdb Copied When Projects Have the Same Assembly Name
Summary: Wrong mdb Copied When Projects Have the Same Assembly Name
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 4.1.0 (C7)
Hardware: PC Windows
: High normal
Target Milestone: 4.4.0 (C10)
Assignee: Joaquin Jares
URL:
Depends on:
Blocks:
 
Reported: 2016-06-17 23:17 UTC by Jimmy [MSFT]
Modified: 2017-05-29 14:10 UTC (History)
5 users (show)

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


Attachments
repro solution (293.20 KB, application/x-zip-compressed)
2016-06-17 23:17 UTC, Jimmy [MSFT]
Details
build output (3.68 MB, text/plain)
2016-06-17 23:18 UTC, Jimmy [MSFT]
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 FIXED

Description Jimmy [MSFT] 2016-06-17 23:17:14 UTC
Created attachment 16387 [details]
repro solution

### Overview

Given a solution where:

1. TestApp.iOS references TestApp PCL and ClassLibrary1_iOS

2. TestApp (PCL) references ClassLibrary1 PCL

3. ClassLibrary1 (PCL) and ClassLibrary1_iOS have the same assembly name, default namespace, and methods

when the iOS project is built, the ClassLibrary1_iOS project dll gets copied to app's bin/ directory, but with the wrong mdb file. Instead the mdb file for the ClassLibrary1 PCL project is present resulting in not being able to debug the iOS library project and this error in the debug output:

> 2016-06-17 15:48:17.581 TestAppiOS[41586:3406222] warning: Symbol file /Users/jimmygarrido/Library/Developer/CoreSimulator/Devices/B1576E8F-C010-4CF1-A86A-30DD6B80BEAF/data/Containers/Bundle/Application/53EDC9EB-41D6-40C0-8F8E-2EDF34D0791E/TestAppiOS.app/.monotouch-64/ClassLibrary1.dll.mdb doesn't match image /Users/jimmygarrido/Library/Developer/CoreSimulator/Devices/B1576E8F-C010-4CF1-A86A-30DD6B80BEAF/data/Containers/Bundle/Application/53EDC9EB-41D6-40C0-8F8E-2EDF34D0791E/TestAppiOS.app/.monotouch-64/ClassLibrary1.dll


Note, the Android project does not have this issue even with the same project structure as above. Also, this seems to only be an issue with Visual Studio as testing on XS resulted in the correct mdb being copied for the iOS project.

However, given that both library projects have the same assembly name and methods, I'm not 100% sure what the expected behavior is in this case. 


### Steps to Reproduce
1. Run the "TestApp.iOS" project in the attached repro solution


### Expected Results
The breakpoint set in "Class1.cs" inside ClassLibrary_iOS will be hit as this is the method that is called during runtime.


### Actual Results
The breakpoint is not hit


### Environment Info
Microsoft Visual Studio Professional 2015
Version 14.0.25123.00 Update 2
Microsoft .NET Framework
Version 4.6.01584

Installed Version: Professional

Visual Basic 2015   00322-40000-00000-AA362
Microsoft Visual Basic 2015

Visual C# 2015   00322-40000-00000-AA362
Microsoft Visual C# 2015

Visual C++ 2015   00322-40000-00000-AA362
Microsoft Visual C++ 2015

Windows Phone SDK 8.0 - ENU   00322-40000-00000-AA362
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   5.2.60328.3
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1 (Beta8)   14.1.11106.0
ASP.NET and Web Tools 2015.1 (Beta8)

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/

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

GitHub.VisualStudio   1.0
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

NuGet Package Manager   3.4.3
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.

SQL Server Data Tools   14.0.60311.1
Microsoft SQL Server Data Tools

TypeScript   1.8.31.0
TypeScript tools for Visual Studio

Visual Studio Tools for Universal Windows Apps   14.0.25219.00
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Xamarin   4.1.0.530 (2e39740)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   6.1.0.71 (4e27558)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   9.8.0.323 (39ebb77)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 1 Jimmy [MSFT] 2016-06-17 23:18:59 UTC
Created attachment 16388 [details]
build output
Comment 2 Daniel Cazzulino 2016-06-19 05:05:57 UTC
Thank you for a very thorough investigation of the issue and a beautifully clean repro!

We'll take a look. It seems like this wouldn't be an uncommon scenario for developers creating bait&switch PCLs, so I think it's worth investigating and documenting an expected behavior.
Comment 3 Jose Gallardo 2016-08-17 16:35:51 UTC
Updating Target Milestone to C8SR1.
Comment 5 Jose Gallardo 2017-01-02 19:43:05 UTC
This bug will be addressed on Cycle10 when we switch to using PPDB instead of MDB for Visual Studio 2015+.
Comment 6 Joaquin Jares 2017-05-29 14:10:29 UTC
Fixed in 4.6.0.168