Bug 56296 - xamlc does not update the corresponding .pdb file
Summary: xamlc does not update the corresponding .pdb file
Status: VERIFIED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: unspecified
Hardware: Macintosh Mac OS
: High critical
Target Milestone: 15.3
Assignee: Bugzilla
URL:
: 56248 56253 56281 56431 56659 56758 57580 58378 ()
Depends on: 53805
Blocks:
  Show dependency tree
 
Reported: 2017-05-12 15:32 UTC by Kamesh Pareek
Modified: 2017-08-31 23:19 UTC (History)
25 users (show)

Tags:
Is this bug a regression?: Yes
Last known good build: works with mono 4.8 (before portable pdb)


Attachments
Build Log (460.69 KB, text/plain)
2017-05-12 16:30 UTC, Kamesh Pareek
Details
DLL (137.50 KB, application/x-msdownload)
2017-05-12 17:59 UTC, Kamesh Pareek
Details
PDB (22.99 KB, application/octet-stream)
2017-05-12 18:00 UTC, Kamesh Pareek
Details
iOS Project File (24.00 KB, text/plain)
2017-05-18 14:18 UTC, Kamesh Pareek
Details
Attached are the logs generated during defect verification (4.84 KB, application/x-zip-compressed)
2017-06-05 10:07 UTC, Saurabh Paunikar
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 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:
Status:
VERIFIED FIXED

Description Kamesh Pareek 2017-05-12 15:32:17 UTC
With the last Xamarin Studio Update 6.3 Build 864, I am not able to build my project in Release and Debug mode when Linker options are set to Link Framework SDK Only and Link All. 

I can successfully build when I select Linker Options to = Don't Link.  But I think that's not the best option when we are planning to publish production version.  Everything was working fine before this upgrade.  

Here is the Error I am getting:
Errors:

/Users/kpareek1/Documents/workspace/TFSWorkspace/Xamarin Apps/HFHS.PCL/HFHS.PCL/HFHS.PCL.iOS/HFHS.PCL.iOS.csproj (Build) ->
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets (_CompileToNative target) ->

                MTOUCH: error MT2001: Could not link assemblies.


Find below my system settings:
Xamarin Studio Enterprise
Version 6.3 (build 864)
Installation UUID: d74ca951-6bd2-4bf5-ac8e-0c54abe3a83f
Runtime:
                Mono 5.0.0.100 (2017-02/9667aa6) (64-bit)
                GTK+ 2.24.23 (Raleigh theme)

                Package version: 500000100

NuGet
Version: 3.5.0.0

Xamarin.Profiler
Version: 1.5.4
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Apple Developer Tools
Xcode 8.3.2 (12175)
Build 8E2002

Xamarin.iOS
Version: 10.10.0.33 (Visual Studio Enterprise)
Hash: 3e5ac5ff
Branch: d15-2
Build date: 2017-05-05 18:11:38-0400

Xamarin.Android
Version: 7.3.0.13 (Visual Studio Enterprise)
Android SDK: /Users/kpareek1/Library/Developer/Xamarin/android-sdk-macosx
                Supported Android versions:
                                6.0 (API level 23)

SDK Tools Version: 25.1.2
SDK Platform Tools Version: 24.0.0
SDK Build Tools Version: 23.0.2

Java SDK: /usr
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

Xamarin Inspector
Version: 1.2.2
Hash: b71b035
Branch: d15-1
Build date: Fri, 21 Apr 2017 17:57:12 GMT

Build Information
Release ID: 603000864
Git revision: 6c2f6737278ccc3e81e12276d49c0d92f975f189
Build date: 2017-04-24 11:26:01-04
Xamarin addins: d8d46e577d8507c35260ce9d73df3c33415bb214
Build lane: monodevelop-lion-d15-1

Operating System
Mac OS X 10.12.4




Thanks,
Kamesh
Comment 1 Sebastien Pouliot 2017-05-12 16:05:01 UTC
@Kamesh can you please add "-v -v -v -v" to your "Additional mtouch arguments" and attach the complete build log to this bug report ? thanks.
Comment 2 Kamesh Pareek 2017-05-12 16:30:37 UTC
Created attachment 22132 [details]
Build Log

Please find attached Build Log.  Also this issue is happening only when I do Build in Release mode.  Debug is fine.
Comment 3 Sebastien Pouliot 2017-05-12 17:23:20 UTC
Thanks! This is an issue when loading portable pdb and likely a dupe of #56253.

Can you share with us the `HFHS.PCL.dll` and `HFHS.PCL.pdb` files ? (in this this is not an exact duplicate) If so then please attach them to the bug report. Thanks!


c.c. @JB

                                  at Mono.Cecil.Cil.InstructionOffset..ctor (Mono.Cecil.Cil.Instruction instruction) [0x00003] in <f600880ba02c4bfa9f6f865ec45cc869>:0 
                                  at Mono.Cecil.Cil.CodeReader.ReadAsyncMethodBody (Mono.Cecil.Cil.AsyncMethodBodyDebugInformation async_method) [0x0005c] in <f600880ba02c4bfa9f6f865ec45cc869>:0 
                                  at Mono.Cecil.Cil.CodeReader.ReadCustomDebugInformations (Mono.Cecil.MethodDefinition method) [0x00032] in <f600880ba02c4bfa9f6f865ec45cc869>:0 
                                  at Mono.Cecil.Cil.CodeReader.ReadDebugInfo () [0x0004d] in <f600880ba02c4bfa9f6f865ec45cc869>:0 
                                  at Mono.Cecil.Cil.CodeReader.ReadMethodBody () [0x00091] in <f600880ba02c4bfa9f6f865ec45cc869>:0 
                                  at Mono.Cecil.Cil.CodeReader.ReadMethodBody (Mono.Cecil.MethodDefinition method) [0x00014] in
Comment 4 Kamesh Pareek 2017-05-12 17:59:32 UTC
Created attachment 22138 [details]
DLL
Comment 5 Kamesh Pareek 2017-05-12 18:00:06 UTC
Created attachment 22139 [details]
PDB
Comment 6 Brendan Zagaeski (Xamarin Team, assistant) 2017-05-12 18:19:27 UTC
## Status update

The files as requested in Comment 3 are now attached, so I am updating the status back to NEW.  Thanks!
Comment 7 Sebastien Pouliot 2017-05-12 19:52:41 UTC
This is an issue with Xamarin.Form xamlc which does not process the .pdb, leaving it in an out-of-sync state (after it's modified)

>                Target XamlC:
>                                Compiling Xaml
>                                Assembly: obj/Release/HFHS.PCL.dll

This is actually a dupe of #53805 but since it's a private bug I'll keep this one open.
Comment 8 Kamesh Pareek 2017-05-12 20:05:00 UTC
But everything was working day before, do you think this was introduce with recent update only.
Comment 9 Sebastien Pouliot 2017-05-12 20:10:40 UTC
@Kamesh, yes it's related to this week update.

Mono 5.0 now uses `csc` (Roslyn) as the C# compiler and this comes with the new portable .pdb format.

Earlier Mono (4.8) was using `mcs` (Mono's compiler) and the .mdb format.

The current `xamlc` modify the .dll without updating the .pdb - which makes the debugging symbols out-of-sync and invalid.
Comment 10 Sebastien Pouliot 2017-05-12 20:14:32 UTC
*** Bug 56248 has been marked as a duplicate of this bug. ***
Comment 11 Sebastien Pouliot 2017-05-12 21:54:22 UTC
*** Bug 56253 has been marked as a duplicate of this bug. ***
Comment 12 Kamesh Pareek 2017-05-15 13:17:26 UTC
Hello,

Can you provide any ETA on this or some workaround to build the code in release mode.  We have Beta release date coming very soon.  

Thanks,
Kamesh
Comment 13 Fred 2017-05-15 13:37:18 UTC
Hi Kamesh,

The workaround that allowed me to build my app was to downgrade Mono (and only Mono) all the way down to the latest 4.8.1 version, clean all rebuild all.

You should give it a try.

That being said, I would also be interested in any ETA Sebastien could give us.
Comment 14 Sebastien Pouliot 2017-05-15 14:58:30 UTC
*** Bug 56431 has been marked as a duplicate of this bug. ***
Comment 18 Sebastien Pouliot 2017-05-16 12:51:58 UTC
https://bugzilla.xamarin.com/show_bug.cgi?id=56281#c9
Comment 20 Kamesh Pareek 2017-05-18 14:18:51 UTC
Created attachment 22269 [details]
iOS Project File

Please find attached iOS project file.
Comment 21 Vincent Dondain [MSFT] 2017-05-19 11:26:35 UTC
*** Bug 56659 has been marked as a duplicate of this bug. ***
Comment 22 Kamesh Pareek 2017-05-22 14:28:09 UTC
Can you please provide the link to downgrade Mono to 4.8.1:

The workaround that allowed me to build my app was to downgrade Mono (and only Mono) all the way down to the latest 4.8.1 version, clean all rebuild all.
Comment 23 Hines Vaughan III 2017-05-22 14:31:05 UTC
@Kamesh Pareek

I was able to build by just setting Mono 4.8.1 to be my default. On Xamarin Studio and VS for Mac, you can do this via Preferences -> .NET Runtime -> select 4.8.1 and choose Set as Default

Though I had to do a few other things to make everything work after doing that.
Comment 24 Kamesh Pareek 2017-05-22 17:05:29 UTC
Thanks, this helped.
Comment 25 Alex Soto [MSFT] 2017-05-23 13:55:17 UTC
*** Bug 56758 has been marked as a duplicate of this bug. ***
Comment 26 David Ortinau [MSFT] 2017-05-23 14:22:45 UTC
Fixed by https://github.com/xamarin/Xamarin.Forms/pull/925
Comment 27 Fred 2017-05-23 15:37:11 UTC
Ahhhh!

So this seems to be fixed in latest Xamarin Forms V2.3.4.247 (which is seven days ago!!)

This is what I did:
- reverted to Mono 5.0.0.100
- re-opened my solution with VS for Mac
- upgraded all relevant Xamarin.Forms (& Xamarin.Forms.Maps) packages

I also had to:
- clean all
- quit VS for Mac once projects were upgraded
- remove bin & old folders for relevant projects
- restart VS for Mac

otherwise I was stumbling on the error message: "error MSB4064: The "DebugType" parameter is not supported by the "XamlCTask" task. Verify the parameter exists on the task, and it is a settable public instance property."

cf https://bugzilla.xamarin.com/show_bug.cgi?id=56640

And now it builds successfully either in Debug and Release.
Damn!
Comment 28 Kamesh Pareek 2017-05-24 14:33:56 UTC
Yes updating nuget - Xamarin.Forms.Pages 2.3.4.24 solved the issue.
Comment 29 Jacky Waswani 2017-05-26 05:54:22 UTC
For verifying the fix of this bug, the steps I followed are as,

1. Created a Forms application
2. Set linker behaviour of Android app to link All
3. build the solution
4. Set the linker behaviour of Android app to link sdk frameworks only and Rebuild the solution

The build succeeded for both configuration 

Screencast : https://www.screencast.com/t/FAGQpT0u
Build info  : https://gist.github.com/alok-kulkarni/bac81548c0303b4eeeeafceedcb74c6e 

From my understanding the issue is resolved,@Kamesh Pareek kindly confirm if I am missing out something 

Thanks
Comment 30 Peter Major 2017-05-26 12:44:32 UTC
What version is this fixed for?

I've updated to Xamarin Forms 2.3.4.247 and I still can't build the iOS solution in Release configuration. I get the error:

snip: error MSB4018: The "XamlCTask" task failed unexpectedly.
snip: error MSB4018: System.InvalidOperationException: Operation is not valid due to the current state of the object.
snip: error MSB4018: 
snip: error MSB4018: 
snip: error MSB4018: Server stack trace: 
snip: error MSB4018:   at Mono.Cecil.ModuleDefinition.ProcessDebugHeader () [0x0001c] in <fc739723e5a84499ae9c2d77c0b7f0fd>:0 
snip: error MSB4018:   at Mono.Cecil.ModuleDefinition.ReadSymbols (Mono.Cecil.Cil.ISymbolReader reader) [0x00015] in <fc739723e5a84499ae9c2d77c0b7f0fd>:0 
snip: error MSB4018:   at Mono.Cecil.ModuleReader.ReadSymbols (Mono.Cecil.ModuleDefinition module, Mono.Cecil.ReaderParameters parameters) [0x0004a] in <fc739723e5a84499ae9c2d77c0b7f0fd>:0 
snip: error MSB4018:   at Mono.Cecil.ModuleReader.CreateModule (Mono.Cecil.PE.Image image, Mono.Cecil.ReaderParameters parameters) [0x00081] in <fc739723e5a84499ae9c2d77c0b7f0fd>:0 
snip: error MSB4018:   at Mono.Cecil.ModuleDefinition.ReadModule (Mono.Disposable`1[T] stream, System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x0000d] in <fc739723e5a84499ae9c2d77c0b7f0fd>:0 
snip: error MSB4018:   at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x0006c] in <fc739723e5a84499ae9c2d77c0b7f0fd>:0 
snip: error MSB4018:   at Mono.Cecil.AssemblyDefinition.ReadAssembly (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00000] in <fc739723e5a84499ae9c2d77c0b7f0fd>:0 
snip: error MSB4018:   at Xamarin.Forms.Build.Tasks.XamlCTask.Execute (System.Collections.Generic.IList`1[System.Exception]& thrownExceptions) [0x0026e] in <238d10a4df434b2a927a049a46837b68>:0 
snip: error MSB4018:   at Xamarin.Forms.Build.Tasks.XamlTask.Execute () [0x00017] in <238d10a4df434b2a927a049a46837b68>:0 
snip: error MSB4018:   at (wrapper xdomain-dispatch) Xamarin.Forms.Build.Tasks.XamlTask:Execute (object,byte[]&,byte[]&)
snip: error MSB4018: 
snip: error MSB4018: Exception rethrown at [0]: 
snip: error MSB4018:   at (wrapper xdomain-invoke) Xamarin.Forms.Build.Tasks.XamlTask:Execute ()
snip: error MSB4018:   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00023] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/msbuild-15.0/src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs:632 
snip: error MSB4018:   at Microsoft.Build.BackEnd.TaskBuilder+<ExecuteInstantiatedTask>d__26.MoveNext () [0x00249] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/msbuild-15.0/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs:787 

where snip is:
/Users/petermajor/Source/microsec/AzaanMobile/packages/Xamarin.Forms.2.3.4.247/build/portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20/Xamarin.Forms.targets(62,3)


Jacky Waswani, it's the iOS project that  causing an issue, not the Android project.
Comment 31 Kamesh Pareek 2017-05-26 13:28:31 UTC
@Jacy - Yes this resolved the issue for me.

@Peter: Update Xamarin.Forms.Pages Nuget to 2.3.4.24, than clean and rebuild the solution.

https://www.nuget.org/packages/Xamarin.Forms.Pages/
Comment 32 Peter Major 2017-05-26 13:53:24 UTC
2.3.4.24?

I assume you mean 2.3.4.247?

Which I have done.
Comment 33 Kamesh Pareek 2017-05-26 14:23:17 UTC
Yes, That resolved the build issue for me.

Have you updated the Nuget in all the solution (PCL + iOS + Android), I am sure you did but just to verify.

One of the user published additional steps those you can follow (not needed in my case)-

This is what I did:
- reverted to Mono 5.0.0.100
- re-opened my solution with VS for Mac
- upgraded all relevant Xamarin.Forms (& Xamarin.Forms.Maps) packages

I also had to:
- clean all
- quit VS for Mac once projects were upgraded
- remove bin & old folders for relevant projects
- restart VS for Mac
Comment 34 Peter Major 2017-05-30 08:02:17 UTC
I have absolutely cleaned, deleted etc.

v2.3.4.247 is not fixed for me on iOS. See above error.
Comment 35 Rolf Bjarne Kvinge [MSFT] 2017-06-01 14:34:19 UTC
*** Bug 56281 has been marked as a duplicate of this bug. ***
Comment 36 Stephane Delcroix 2017-06-01 18:44:56 UTC
@Peter: make sure ALL of the projects in your solution are up-to-date. also make sure you restart your IDE.

if it still doesn't work, please attach a project triggering the problem. Thanks
Comment 37 Brendan Zagaeski (Xamarin Team, assistant) 2017-06-01 18:50:29 UTC
> Please attach a project triggering the problem

Just as a quick general tip for any users watching this bug, I would recommend submitting any new test case from a user who is not the original reporter of the bug (from Comment 0) onto a fresh bug report to ensure a clean thread of investigation for that particular scenario.  Submitting a new bug report for the new test case will have the added advantages that the original reporter of the bug can adjust the Status of the bug and can optionally mark the bug as private when filing it to keep the information non-public.

Best,
Brendan
Comment 38 Saurabh Paunikar 2017-06-05 10:07:58 UTC
Created attachment 22688 [details]
Attached are the logs generated during defect verification
Comment 39 Saurabh Paunikar 2017-06-05 10:09:43 UTC
Verified the bug on the master build with following build versions:-

Visual Studio Enterprise 2017 for Mac Version 7.1 Preview (7.1 build 1141
Xamarin.Android ===Version: 7.3.99.72 (Visual Studio Enterprise)
Xamarin.iOS ===Version: 10.13.0.0 (Visual Studio Enterprise)
Xamarin.Mac ===Version: 3.7.0.0 (Visual Studio Enterprise)

Build Info:
https://gist.github.com/saurabh-paunikar/de69935d2a80d0bb2881a57d85915139

ScreenCast links: https://www.screencast.com/t/GazgFBMNZ
Comment 40 Alex Soto [MSFT] 2017-06-19 14:10:32 UTC
*** Bug 57580 has been marked as a duplicate of this bug. ***
Comment 41 Jon Dick 2017-06-19 14:12:42 UTC
This is working fine for me on iOS with 2.3.4.247, however using the prerelease 2.3.5.239-pre3 is still exhibiting this error for me.
Comment 42 Stephane Delcroix 2017-06-21 09:10:33 UTC
@Jon I can't reproduce the issue with 2.3.5.239-pre3
Comment 43 Blonski 2017-06-28 07:47:50 UTC
We updated xamarin.form 2.4.3.231 to 2.4.3.247 and our jenkins (on mackin cloud) bug occured.
Works fine, on dev local enviroment, but not on CI on macincloud.

Fix for us was temporarily editing the Xamarin.Forms.targets file, which for us lived in:
packages\Xamarin.Forms.2.3.4.247\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20
and removed the DebugType = "$(DebugType)" line.

Sorry not mine enviroment, can't give you propper steps to reproduce.
but maybe this will help you:
https://support.macincloud.com/support/solutions/articles/8000032728-xamarin-updated-to-6-3-0-864
Comment 44 Stephane Delcroix 2017-06-28 08:15:25 UTC
@Bloonsky. you probably have your nuget packages checked in source control, and forgot to update that.
Comment 45 Blonski 2017-06-28 08:35:15 UTC
NO. Stephane Delcroix: 
We don't commit package folder. 

-before doing anything, I cleaned up bin/obj of all projects
-plus de package folder
-download the lastest version
-and it doesn't works

Fix is not there.
Comment 46 Blonski 2017-06-28 08:36:11 UTC
and I performed the described workaround  which worked . Fix is not there.
Comment 47 Brendan Zagaeski (Xamarin Team, assistant) 2017-06-28 17:26:40 UTC
Comment 43 through Comment 46 sound like they might be talking about Bug 56640.  If indeed those comments are about error messages similar to "The "DebugType" parameter is not supported", then I would recommend that the conversation on that topic be continued on Bug 56640 rather than this bug.  Thanks!
Comment 48 Vincent Dondain [MSFT] 2017-08-31 23:19:52 UTC
*** Bug 58378 has been marked as a duplicate of this bug. ***