Bug 45053 - Xamarin Studio auto update broke my project today (5th Oct 2016)
Summary: Xamarin Studio auto update broke my project today (5th Oct 2016)
Status: VERIFIED FIXED
Alias: None
Product: Tools
Classification: Mono
Component: xbuild ()
Version: unspecified
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: 15.2
Assignee: Ankit Jain
URL:
Depends on:
Blocks:
 
Reported: 2016-10-05 13:00 UTC by tim
Modified: 2017-05-08 20:57 UTC (History)
9 users (show)

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

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 GitHub or 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:
VERIFIED FIXED

Description tim 2016-10-05 13:00:07 UTC
I had a working Xamarin iOS project until I accepted an auto-update to 4 components of Tamarin Studio on Mac today.
After the update, a 3rd party package (Renci SSH.NET) no longer worked.

var sftp = new Renci.SshNet.SftpClient(servername, sp, {username}, {password});
started generating the following error

Users/timjones/Projects/B9Eye/App11/ViewController.cs(41,41): Error CS0012: The type `System.IDisposable' is defined in an assembly that is not referenced. Consider adding a reference to assembly `System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' (CS0012) (App11)

using (sftp)
started generating the following error

/Users/timjones/Projects/B9Eye/App11/ViewController.cs(20,20): Error CS1674: `Renci.SshNet.SftpClient': type used in a using statement must be implicitly convertible to `System.IDisposable' (CS1674) (App11)

This is incredibly annoying. Can I roll back on the updates until the issue is resolved?
Or can you advise me what I should do with the existing project?
Comment 1 Timothy Risi 2016-10-06 00:27:27 UTC
You can download old versions of from xamarin.com until the issue is resolved:

1)  At xamarin.com click on your account name
2)  Select Dashboard
3)  Select Downloads
4)  For the tools you want to download the old version for (such as Xamarin.iOS), click the OS X or Windows button then choose a version to download.

I am seeing the same error when I try to build a project with SSH.NET, but I've tried a couple older versions of Xamarin.iOS and Mono and am still seeing the error on those too.  Could you provide the environment info (mono, XI, xamarin studio, etc versions) for your setup when it was working (or if you revert to an older version and get it working again).

The easiest way to get exact version information is to use the "Xamarin Studio" menu, "About Xamarin Studio" item, "Show Details" button and copy/paste the version informations (you can use the "Copy Information" button).
Comment 2 Rolf Bjarne Kvinge [MSFT] 2016-10-13 11:28:20 UTC
I can reproduce this with Mono 4.6 and Mono 4.8:

> mono --version
Mono JIT compiler version 4.8.0 (mono-4.8.0-branch/f07d3d7 Wed Oct 12 15:58:31 EDT 2016)

However it only fails when building with xbuild, it works with msbuild:

xbuild log: https://gist.github.com/rolfbjarne/3d484ffe611f9d871addfffc22c0d59c
msbuild log: https://gist.github.com/rolfbjarne/8d4349c8bf792c87c24b9f7d06fb8fc8

@Marek, can you have a look? Or is something for Ankit?
Comment 3 Marek Safar 2016-10-13 14:58:42 UTC
This is xbuild issue which looks like is missing version auto compatibility for FX facades.

Relavant info

>>>

Dependency "System.Runtime.Extensions, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". (TaskId:15)
      Could not resolve this reference. Could not locate the assembly "System.Runtime.Extensions, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".

......

Considered "/work/maccore/master/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Facades/System.Runtime.Extensions.dll", but its name "System.Runtime.Extensions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" didn't match. (TaskId:15)
<<<<

This should still be resolved but it's not.
Comment 4 Ankit Jain 2016-10-14 21:49:46 UTC
- msbuild is the one failing to resolve `System.Runtime.Extensions`
- But that is not what causes the build to fail

- Build(xbuild) is failing because of a missing `System.Runtime` reference
  - xbuild is able to resolve `System.Runtime`, but for some reason none of the "dependent" assembly references are being passed to the compiler! So, there are lot of references missing on the compiler command line.

@Rolf, how can I reproduce this?
Comment 5 Rolf Bjarne Kvinge [MSFT] 2016-10-17 08:39:26 UTC
@Ankit, to reproduce checkout the bug45053 branch in this repo: https://github.com/rolfbjarne/TestApp (https://github.com/rolfbjarne/TestApp/tree/bug45053) and then just run "nuget restore && xbuild" in the root directory.
Comment 6 Ankit Jain 2016-10-17 19:12:06 UTC
Do we know which release/version of Xamarin.iOS this worked with?

smcs is being passed all the primary references, but since they are being resolved from the TargetFrameworkDirectory, their dependent assemblies are not being passed to smcs. I don't see any related changes in xbuild, so I am wondering whether this worked earlier or not. If it did, then looking at the logs from that build would be helpful.
Comment 7 Rolf Bjarne Kvinge [MSFT] 2016-10-18 08:38:42 UTC
(In reply to Ankit Jain from comment #6)
> Do we know which release/version of Xamarin.iOS this worked with?

Unfortunately we do not (my guess would be Mono 4.4 + XI 9.8 though).
Comment 8 Luis Aguilera 2017-02-18 00:21:36 UTC
C9 is now closed. We'll move this bug to the next scheduled milestone, "15.1". We'll continue working on these issues, and will attempt to resolve them ASAP.
Comment 9 Luis Aguilera 2017-03-27 15:12:50 UTC
We've carrying this bug for quite some time... we need to determine whether this is an issue.
@ankit can you please check whether this can be reproduced?

Moving to 15.2 for the time being.
Comment 10 Ankit Jain 2017-03-27 18:35:04 UTC
The original issue was fixed some time back in msbuild. But I see another issue there.
Comment 11 Ankit Jain 2017-04-20 16:32:52 UTC
I'll open a new bug for the issue I mentioned in comment #10. Closing this.
Comment 12 Saurabh Paunikar 2017-05-08 09:42:57 UTC
@Ankit can you please mark this bug as verified
Comment 13 Ankit Jain 2017-05-08 20:57:57 UTC
@Saurabh,

I couldn't really reproduce this issue. Looking at the logs, the issue was fixed in `msbuild` some time back. But without being able to reproduce, it's difficult to "verify" this particular instance, but considering that the core bug was already fixed, I am marking this as Verified.