Bug 60162 - XamlC Failed error MSB4018: System.IO.FileNotFoundException: Could not find file MyApp.dll.mdb
Summary: XamlC Failed error MSB4018: System.IO.FileNotFoundException: Could not find f...
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.4.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-10-12 19:53 UTC by Jerome Laban
Modified: 2017-12-15 21:29 UTC (History)
2 users (show)

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

Stacktrace (7.51 KB, text/plain)
2017-10-12 19:53 UTC, Jerome Laban
vs version (2.16 KB, text/plain)
2017-10-12 19:54 UTC, Jerome Laban

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 Jerome Laban 2017-10-12 19:53:45 UTC
Created attachment 25290 [details]

Using Xamarin VS4Mac 7.2, Xamarin.iOS and Xamarin.Forms, an Xamarin.Forms app fails to build with the following: 

/Users/***/agent01/_work/.nuget/xamarin.forms/,3): error MSB4018: System.IO.FileNotFoundException: Could not find file "/Users/admin/vsts-nventive/agent01/_work/4/s/***.Android/obj/Release/***.dll.mdb" [/Users/admin/vsts-nventive/agent01/_work/4/s/***.Android/***.Android.csproj] 

This seems to be related to the fact that this variable https://github.com/xamarin/Xamarin.Forms/blob/7cb7c2a3d8b5e92ee9217c3b8c23bf8b5fbda50f/.nuspec/Xamarin.Forms.targets#L108 is forcibly set to "portable" by an environment variable, even though the project sets it to "Full".
Comment 1 Jerome Laban 2017-10-12 19:54:04 UTC
Created attachment 25291 [details]
vs version
Comment 2 Paul DiPietro [MSFT] 2017-10-13 04:56:55 UTC
Does this occur with any new project? Only on VS Mac (assuming you can also test with VS Windows)? I think we may have had a some issues involving Xamarin.Forms.targets in the past, but more information on your situation in particular can possibly help look into it further. Typical clean/rebuild and deletion of bin/obj folders along with validating that package versions are aligned can possibly help as well.
Comment 3 Jerome Laban 2017-10-13 12:41:16 UTC
After trying to get a repro, this issue is actually caused by Cecil.

Cecil has been on version 0.10.0-betaXX for quite a long time, and features have been added, such as the support for portable pdbs if I'm not mistaken, and I have an msbuild tool that runs before XamlC task that loads an ealier version of Mono.Cecil.

The XamlC task ends up using a version of the binary that's not appropriate, hence this issue.

I'll adjust this on my end, obviously, but the fact that Mono.Cecil stays this long on the same version is getting problematic, maybe making an interim release would help :)

Comment 4 Paul DiPietro [MSFT] 2017-12-15 21:29:57 UTC
Marking as resolved for upkeep per the above comment -- I don't have any exact insight at this moment as to the Cecil versioning, but I imagine it's set for a specific reason. That said, any further issues should be filed on GitHub issues as we have moved to there from Bugzilla.