0

I have been using Xamarin Studio on a Mac to write an app, and am sharing a lot of the code and projects with a Linux Mono project. For this reason I have to target the Mono / .NET 4.5 framework.

In the Mac project settings for target framework, Mono / .NET 4.5 is under "Unsupported Framework" and has a yellow caution symbol. I understand and accept this, since I need to also support Linux and the older Mono 4 framework.

However, I think Visual Studio preview for Mac changed my installed Mono runtime. When I opened the same project in VS4M, it gave an error:

could not find System.Runtime 4.0.0.0

I tried to run my project in Xamarin Studio and got the same error, but within a couple minutes received a notification to Xamarin. After updating, my app ran again.

I then opened VS4M to see if that worked, and now I get:

Could not launch Visual Studio
This application requires a newer version (4.8+) of the mono framework.

Is there a better way to deal with this? I need to be able to build and debug this project in Linux using the open source Linux tools that are a bit out of date from Xamarin and apparently are not compatible.

Will downloading 4.8 Mono mess up Xamarin again?

ashley
  • 576
  • 3
  • 22
user856232
  • 1,073
  • 2
  • 14
  • 40
  • I would break out all the non-`Xamarin.Mac` bits into a .NetStandard 1.5(-) lib (or PCL if you have dependancies that do not support .NetStandard yet) and then you can consume those libraries in a `Xamarin.Mac` project that is based on one of the supported `Xamarin.Mac` .Net 4.5 or Mobile frameworks. Those .NetStandard-based libraries can than be consumed in a .Net 4.5 framework based app on Linux.... Or go to Shared Project design and then reference that shared project in your Xamarin.Mac project and .Net4.5 project – SushiHangover Nov 17 '16 at 19:58
  • Thank you for the comment. I guess I will have to byte that bullet then. I was hoping not to because that is a huge refactor. There are 40 projects in the solutions shared with a windows solution. – user856232 Nov 18 '16 at 17:24
  • 40... What is your UI on Linux? GTK#? Just wondering if you can wrap your .Net 4.5 libs in a service pattern and under your `Xamarin.Mac` Cocca GUI communicate with the service vs. embedding/referencing those libraries directly.. The same pattern could be done for your Linux GUI (and Windows) – SushiHangover Nov 18 '16 at 17:32
  • I am back to trying to deal with this only in a different way. I updated Xamarin Studio and now my app won't run. It builds fine, but won't run. I get the following error: Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. File name: 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' – user856232 Mar 09 '17 at 17:41

0 Answers0