Bug 24064 - LinkAssemblies task failing with Reference to metadata item 'System.IO.MonoIOError' could not be resolved
Summary: LinkAssemblies task failing with Reference to metadata item 'System.IO.MonoIO...
Status: CLOSED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android ()
Version: 3.7
Hardware: PC Windows
: Highest blocker
Target Milestone: 3.8
Assignee: Emanuel
URL:
Depends on:
Blocks:
 
Reported: 2014-10-26 22:51 UTC by Peter Collins
Modified: 2014-11-11 11:03 UTC (History)
10 users (show)

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


Attachments
repro project (12.16 KB, application/octet-stream)
2014-10-26 23:06 UTC, Peter Collins
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:
CLOSED FIXED

Description Peter Collins 2014-10-26 22:51:17 UTC
The following failure occurs on windows only for the attached project. This does not appear to be a regression from the current Stable XA 4.18.0.39.

C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1006,5): error MSB4018: Xamarin.Android.XamarinAndroidException: error XA2006: Reference to metadata item 'System.IO.MonoIOError' (defined in 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e') from 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' could not be resolved. ---> Mono.Cecil.ResolutionException: Failed to resolve System.IO.MonoIOError

Diagnostic build output:
https://gist.github.com/pjcollins/9a0236f1077574741325

Environment:
Windows 7x64
XVS 3.7 (c18100ef) / XA 4.18.1.1 (ef5be128)
Comment 1 Peter Collins 2014-10-26 23:06:02 UTC
Created attachment 8510 [details]
repro project
Comment 2 Arpit Jha 2014-10-30 05:16:40 UTC
We have checked this issue and unable to reproduce it.
We tried to reproduce with the help of bug description and observed that attached sample project working fine without any error.

Screencast regarding same:
http://screencast.com/t/25Bm5bxB6


Let me If I missed anything to reproduce it?

Environment Info:
Microsoft Visual Studio Professional 2012
Version 11.0.50727.1 RTMREL
Microsoft .NET Framework
Version 4.5.50938

Installed Version: Professional

Xamarin   3.7.230.0 (e78d10d6993f95fc3ebe791aeb4aacff165bf8bb)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   4.18.0.39 (0ef616ae42005ece52f6df7aa1e093ceb11998f8)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   8.4.0.0 (209abebbd8f1a292d042420edb45fa5fbd3f017b)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 3 Radek Doulik 2014-10-30 10:55:25 UTC
I am able to reproduce it on Windows/XS with XA 4.18.1.

Looking into it.
Comment 4 Radek Doulik 2014-10-30 10:57:20 UTC
Arpit, you might be able to reproduce it when you choose Release configuration. I see in the screencast that you used Debug configuration.
Comment 5 Radek Doulik 2014-10-30 11:08:54 UTC
The problem seems to be that the mscorlib is resolved to MS .NET one, C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll in my case.

When I build only for arm architecture, it builds OK and when I then build for all architectures again, it works as well.

There's also a warning issued about non-functional runtime, which was the case. So I am not sure if this is expected and whether it is a bug after all.

The warning is even in the Peter's log

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. [C:\Users\XamarinQA\QABot\data\lanes\1144\c18100ef\source\QualityAssurance\Samples\android\Bug23167\Scratch.UpdateAllXmlRefs\Scratch.UpdateAllXmlRefs.csproj]
Comment 6 Radek Doulik 2014-10-30 11:15:32 UTC
It looks like the <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> in the original project causes that. Once it is corrected to v4.4, the project builds OK.

So it looks like problem with resolving assemblies (mscorlib in this case)
Comment 7 Radek Doulik 2014-10-30 11:56:24 UTC
Jonathan says that the installer should create v4.5 framework => reassigning.
Comment 8 Arpit Jha 2014-10-31 03:31:50 UTC
@Radek, We have checked this issue with the help of comment 2 and unable to reproduce it.
We observed that application working fine with Release configuration.

Note : I checked with XA 4.18.0,4.18.1 both and getting same

Screencast regarding Same:
http://screencast.com/t/lEeLPxEfi

Environment Info:
Microsoft Visual Studio Professional 2012
Version 11.0.50727.1 RTMREL
Microsoft .NET Framework
Version 4.5.50938

Installed Version: Professional

Xamarin   3.7.230.0 (e78d10d6993f95fc3ebe791aeb4aacff165bf8bb)
Visual Studio extension to enable development for Xamarin.iOS and
Xamarin.Android.

Xamarin.Android   4.18.0.39 (0ef616ae42005ece52f6df7aa1e093ceb11998f8)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   8.4.0.0 (209abebbd8f1a292d042420edb45fa5fbd3f017b)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 9 Peter Collins 2014-11-06 12:06:57 UTC
I'm still seeing the same behavior on 4.20-series (v3.8 / ed4553ed53). I do have a v4.5 framework version installed on disk.

Diagnostic build:
https://gist.github.com/pjcollins/0d23fa4373aef560ce5b

@Arpit, please try to build the solution from command line:
> msbuild Scratch.UpdateAllXmlRefs\Scratch.UpdateAllXmlRefs.csproj
Comment 10 Arpit Jha 2014-11-07 11:03:47 UTC
I have checked this issue and with the help of "Comment 4", I am able to reproduce this issue.

I am getting this error when I try to run the attached project in "Release" mode. I am not getting any error when I try the same on "Debug" mode.


Screencast: http://www.screencast.com/t/SIdK8JaZQdm

Error Detail: https://gist.github.com/anonymous/fc527ef632596e3e18ab
Build Output: https://gist.github.com/anonymous/62753eda8a412ac6cc1d

Environment Info:

Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.50938
Installed Version: Professional
Xamarin   3.7.248.0 (8ca7d11db8a6f874c6cd2de6d9ca0f511867ce91)
Xamarin.Android   4.18.1.3 (5474129af31e9d3a86cb7482c7c5c7a30ad315f1)
Xamarin.iOS   8.4.0.0 (209abebbd8f1a292d042420edb45fa5fbd3f017b)
Comment 11 Radek Doulik 2014-11-07 11:38:29 UTC
I am unable to reproduce it :( Here's my log for comparison.

https://gist.github.com/radekdoulik/2dc4a932244538a7309d

Jonathan is also trying to reproduce it.
Comment 12 Radek Doulik 2014-11-07 11:40:34 UTC
To clarify, I cannot reproduce it with XA 4.20.0.
Comment 13 Jonathan Pryor 2014-11-07 12:46:36 UTC
This is an installer bug.

The problem is that this file does not exist:

%ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\MonoAndroid\v4.5\RedistList\FrameworkList.xml

Without that file, there is no way for MSBuild to continue the assembly search to the other MonoAndroid\v* directories and ultimately find mscorlib.dll.
Comment 14 Jose Gallardo 2014-11-07 14:41:42 UTC
Fixed on v3.8 and master.

v3.8:
Wrench: a75afb0b98755e7775ea7eb1cef1cc3da9402a74
Commit: 1324b27e5c7cfaff2f767cc10ac1da1a2b6fec6b
Comment 15 Mohit Kheterpal 2014-11-10 09:56:25 UTC
I have checked this issue with XVS 3.8.132 + X.iOS 8.4.0.29 and this issue is working fine as shown in screencast : http://screencast.com/t/ExsToP1NUO

Hence closing this issue.
Comment 16 Ian Ceicys 2014-11-11 11:03:42 UTC
This bug has been verified by QA on 3.8 and is fixed.