locked
How to downgrade Visual Studio for Mac? RRS feed

  • Question

  • User2823 posted

    I need to downgrade from 7.2 to 7.1.5.2 Transitive project.json dependencies are broken in 7.2

    Tuesday, October 10, 2017 8:46 AM

Answers

  • User18049 posted

    Good point. Not sure why VS Mac is not available there. Older Xamarin.iOS and Xamarin.Android versions are available there.

    The main releases page only shows the first release for VS Mac 7.1.

    Here is a download for VS Mac 7.1.5 which was the last stable 7.1 version released.

    https://dl.xamarin.com/VsMac/VisualStudioForMac-7.1.5.2.dmg

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Tuesday, October 10, 2017 10:23 AM

All replies

  • User18049 posted

    You should be able to get previous versions from the account page.

    What is the problem with transitive project.json dependencies in VS Mac 7.2?

    Tuesday, October 10, 2017 9:00 AM
  • User29525 posted

    @mattward From what I can see the account page only has Xamarin Studio, not Visual Studio for Mac. @RobLander Did you find the installation you needed?

    Tuesday, October 10, 2017 10:07 AM
  • User18049 posted

    Good point. Not sure why VS Mac is not available there. Older Xamarin.iOS and Xamarin.Android versions are available there.

    The main releases page only shows the first release for VS Mac 7.1.

    Here is a download for VS Mac 7.1.5 which was the last stable 7.1 version released.

    https://dl.xamarin.com/VsMac/VisualStudioForMac-7.1.5.2.dmg

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Tuesday, October 10, 2017 10:23 AM
  • User29525 posted

    Thanks @mattward

    Tuesday, October 10, 2017 10:34 AM
  • User2823 posted

    Thanks @mattward.

    About regression: - I have portable project with project.json file referencing Xamarin.Forms - I have iOS project with "empty" project.json file, that references portable project - In VS 7.1 iOS compiles fine because Xamarin.Forms dependency is transitioned to iOS project - In VS 7.2 I have tonns of "The type or namespace 'Xamarin' could not be found" errors

    Tuesday, October 10, 2017 10:46 AM
  • User2823 posted

    I've also tried to downgrade Xamarin.iOS and Mononpackages leaving VS 7.2 but that doesn't help. So it seems like it is VS related.

    Tuesday, October 10, 2017 10:48 AM
  • User18049 posted

    Looks like something has changed in NuGet 4.3 maybe. I created a new Xamarin.Forms project using VS Mac 7.2, then uninstalled the Xamarin.Forms NuGet package and added a project.json file to the PCL project (also removed the :

    { "dependencies": { "Xamarin.Forms": "2.4.0.280" }, "frameworks": { ".NETPortable,Version=v4.5,Profile=Profile111": {} } }

    Then uninstalled the NuGet package from the iOS project and added a project.json file:

    ``` { "frameworks": { "xamarin.ios10": { "imports": "portable-net45+win81+wp80+wpa81" } }, "runtimes": {"win-x86" : {} } }

    ```

    Then reloaded the solution. The build fails in VS Mac 7.2 due to missing Xamarin.Forms types but works in VS Mac 7.1. The problem seems to be that the generated project.lock.json file does not have any Xamarin.Forms information when the NuGet restore is run using VS Mac 7.2. The main difference between VS Mac 7.1 and 7.2 is that NuGet was updated from 4.0 to 4.3.1.

    However using NuGet.exe 4.3.0 from the command line and running a restore, or using msbuild /t:restore, both seem to generated project.lock.json files with Xamarin.Forms information in them. Just VS Mac 7.2 does not.

    A potential workaround here would be to disable automatic package restore and run the restore outside VS Mac using msbuild /t:restore or nuget.exe.

    Wednesday, October 11, 2017 5:46 PM
  • User2823 posted

    So, it's a some kind of regression in newer nuget. Is it going to be fixed in Visual Studio for Mac updates?

    Wednesday, October 25, 2017 9:55 AM
  • User18049 posted

    Looks like a bug in VS for Mac. On upgrading to a more recent NuGet version some code in VS for Mac was removed due to a restructuring of various classes in NuGet itself. So it looks like project reference information is not being correctly setup when a restore is happening. I believe this then causes the transitively referenced NuGet packages to not be added to the project.lock.json. The lock file is also missing project references.

    Wednesday, October 25, 2017 10:59 AM
  • User18049 posted

    @RobLander - I have created a patch NuGet addin dll that should fix the problem with project.json files for VS Mac 7.2. You can download it from GitHub.

    Download that MonoDevelop.PackageManagement.dll file from GitHub. You may need to unblock it:

    xattr -d -r com.apple.quarantine MonoDevelop.PackageManagement.dll
    

    Then you can replace the existing NuGet addin .dll. I tested this locally by doing the following:

    // Make backup of NuGet addin .dll cp /Applications/Visual\ Studio.app/Contents/Resources/lib/monodevelop/AddIns/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.dll /Applications/Visual\ Studio.app/Contents/Resources/lib/monodevelop/AddIns/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.dll-backup

    // Replace existing NuGet addin .dll with new one. cp MonoDevelop.PackageManagement.dll /Applications/Visual\ Studio.app/Contents/Resources/lib/monodevelop/AddIns/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.dll

    Then the iOS project I was using for testing was building successfully and the project.lock.json file had the expected project references.

    Wednesday, October 25, 2017 9:07 PM
  • User2823 posted

    Btw maybe 15.4.2 service release contains this fix?

    Wednesday, November 1, 2017 9:46 AM
  • User18049 posted

    @RobLander - A fix will be in Visual Studio for Mac 7.3 at some point, not released currently. There is no fix for VS Mac 7.2 apart from using the patched binaries I linked to.

    Wednesday, November 1, 2017 9:48 AM
  • User253803 posted

    I updated to version 7.6.11 and it broke my project. I contacted support via visualstudio.com and was told there is no way to downgrade VS for MAC now. I'm posting here in the hopes that someone can point me to a repo or link somewhere to previous VS for mac versions?

    Wednesday, November 7, 2018 4:14 PM
  • User18049 posted

    @"RonanA.7363" How did it break your project?

    Wednesday, November 7, 2018 9:54 PM
  • User253803 posted

    @mattward In fairness, it didn't break the project. I can still build it, I just can't deploy it to simulator or device. The options (Project > Configuration > Device) that are usually there are disabled. If I set the start up project to the android project, the options are populated and work. If i then use the drop down to change project from android to iOS, the application crashes with the message:

    "A fatal error has occurred Details of this error have been automatically sent to Microsoft for analysis. Visual Studio will now close."

    I've tried updating xcode and then opening xcode and it installed some extensions. I restarted the machine but no change. Resintalled VS For mac and no change.

    I tried creating a new Xamarin Forms project and the same issues as my own project.

    Xcode version: 10.0 (10A255)

    If you have any ideas, I'm definitively willing to try it as right now I have no way to test my project.

    Thursday, November 8, 2018 9:19 AM
  • User18049 posted

    Can you attach the IDE log after reproducing the error? Thanks.

    Thursday, November 8, 2018 11:23 AM
  • User253803 posted

    I've pulled this out of the logs that seems to be the problem:

    FATAL ERROR [2018-11-09 09:59:38Z]: Visual Studio failed to start. Some of the assemblies required to run Visual Studio (for example gtk-sharp)may not be properly installed in the GAC. System.InvalidOperationException: Failed to compare two elements in the array. ---> System.ArgumentOutOfRangeException: Length cannot be less than zero. Parameter name: length at System.String.Substring (System.Int32 startIndex, System.Int32 length) [0x00087] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/string.cs:1257 at MonoDevelop.IPhone.IPhoneSimulatorExecutionTargetGroup.ParseIPhone (System.String name, System.String& device, System.Int32& version, System.String& subversion, MonoDevelop.IPhone.IPhoneSimulatorExecutionTargetGroup+IPhoneDeviceType& type) [0x00022] in /Users/vsts/agent/2.141.1/work/1/s/md-addins/MonoDevelop.IPhone/MonoDevelop.IPhone/Execution/IPhoneSimulatorExecutionTarget.cs:190

    In case I'm wrong, I'm attached the full log

    Friday, November 9, 2018 10:23 AM
  • User18049 posted

    The crash looks like it is the same as that reported on the developer community site. This bug is fixed in Visual Studio for Mac 7.7.0.1552. There is also a workaround mentioned in the developer community forum post. I believe the problem is that more recent versions of Xcode one of the simulators is 'X' which breaks Visual Studio for Mac. As far as I am aware downgrading Visual Studio for Mac will not help in this case. A workaround is to rename the simulators in Xcode so that no iOS simulator name begins with a number (i.e. 0-9) or the letter X or S.

    Friday, November 9, 2018 1:47 PM
  • User253803 posted

    @mattward spot on sir. well played

    I had a custom simulator set up called "11.4 iPhone 5". Once i renamed that to "iPhone 5 11.4", everything worked.

    Thanks very much for the help

    Sunday, November 11, 2018 8:50 PM