Jump to content

Failed to set "target framework" to .Net v3.5 in VS on Mac OS


Recommended Posts

Hi, 

I'm a software engineer with 9 years experience on Java and 2 years on Golang. I have also been a KSP player for 4 years. Now I get some ideas and decide to go one step further.

So I spent several days learning about C# basics and how to develop a KSP plugin.

At first, I followed a tutorial, and succeeded to run a demo on Windows(had some trouble installing .NET 3.5 on Windows 10 though).

Then I tried to do the same thing on my Mac. Unfortunately, I failed to set "target framework" to v3.5 in Visual Studio 2017.
I imported UnityEngine.dll, UnityEngine.UI.dll, Assembly-Csharp.dll and Assembly-Csharp-firstpass.dll. But the IDE reports this error: "The type or namespace name 'MonoBehaviour' could not be found (are you missing a using directive or an assembly reference?)".
The oldest version in the list is 4.5. I googled, read and tried many times, but none worked.
At last, I found this page, I'm now doubting that whether it's possible to dev plugins on Mac OS at all?

Environment:

Mac OS Mojave v10.14.2
Mono 5.18.1 (versions older than 5.10 is not compatible with the OS)
Visual Studio for Mac, Community, v7.8.3

Here're my questions:

1, What's the version of .Net framework supported by KSP currently? Is it still version 3.5?

2, How to set the target framework to v3.5 in VS on Mac OS?

3, Is there anybody developing plugins on Mac OS? Should I just give up and move to Windows?

Thanks a lot!

Link to comment
Share on other sites

1 hour ago, Xavier513 said:

What's the version of .Net framework supported by KSP currently? Is it still version 3.5?

As far as I can see Unity 2017 (and thus KSP >=1.4) uses .NET 4.5, but I can't get anything to actually load in game when compiled with mono 5.16 / .NET 4.5 (Gentoo). Dunno whether it's my environment or me.
I never had any issues in the past with U5 and mono 3.x / .NET 3.5 (Debian GNU/Linux), but I don't have the patience to write an ebuild for / compile / install a fossilised mono release to try it again.

I hate .NET with a passion anyway, so for the little time I need to spend with it I just load up VS in a windoze VM. ¯\_(ツ)_/¯

 

1 hour ago, Xavier513 said:

How to set the target framework to v3.5 in VS on Mac OS?

Mono stopped packaging the .NET 3.5 assemblies with v4.0. You might try grabbing them from here, but YMMV. My patience expired long before I got that far.

 

Granted I'm not talking about MacOS specifically here (as I don't own one), but mono is mono is mono, and *nix is *nix to a certain extent. Someone with Mac specific knowledge might yet emerge from the woodwork, I'm sure there are plenty here.

Edited by steve_v
Link to comment
Share on other sites

Unity 2017 supports .NET 4.6 as an "experimental setting" in its Player Settings menu, but I don't think KSP uses this (I'm fairly sure that Unity 2017.1 was when this option was added, so it's doubtful that such a complex game like KSP would jump on an experimental feature like that at such an early stage). 

I continue to always set the target as .NET 3.5 for KSP mods. As for how it works on MacOS, I have no idea. :blush:

Edited by DMagic
Link to comment
Share on other sites

On 3/30/2019 at 7:38 AM, DMagic said:

I continue to always set the target as .NET 3.5 for KSP mods.

Right then, that'll be why nothing works here. So nice of Unity/Squad to target a framework so old that no sensible OS packages it any more. :mad:

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...