Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to compile on Mono due to System.Collections.Concurrent #25

Closed
ido-ran opened this issue Feb 16, 2015 · 9 comments
Closed

Fail to compile on Mono due to System.Collections.Concurrent #25

ido-ran opened this issue Feb 16, 2015 · 9 comments

Comments

@ido-ran
Copy link

ido-ran commented Feb 16, 2015

Hi,
I manage to compile the source code of the ProtoBuf generator on Mono on Mac OS but after I build the message source code I get a compilation error due to this line:
using System.Collections.Concurrent

Is it possible to add switch to not use this feature because AFAIK .NET 4 is not available on Mono at this point.

@hultqvist
Copy link
Collaborator

I'll see if we can get a conditional flag there.

Otherwise you can pretty safely remove that part of the code since you're not going to use it. The "generated" protocolparser.cs is always the same for any given version of this project, that is, not dependent on the proto specs you pass into the generator.

Although i do believe mono has supported .NET 4/c#4.5 for some time now. I've compiled it on Linux using mono(that is also where i develop it).
My guess is that there is at least a newer version included with Xamarin Studio.

Let me know if that fixes it or if I should get on the conditional flag solution.

@ido-ran
Copy link
Author

ido-ran commented Feb 21, 2015

Hi,
I've currently workaround this by doing what you suggested and removing the using statement as well as the experimental new class.
I'm know the .NET inside out but on the mono side I'm still pretty newbe, I've yet to understand why the Mono team decide on such different version numbers. Also I'm developing in Mono for Unity 4 and the Unity team is using very old Mono version so I'm afraid I'm stuck in this situation even if .NET 4 support exist for Mono.

I guess my need is an edge case, I'll understand if this not worth the effort.

Thank you,
Ido.

@hultqvist
Copy link
Collaborator

Do you know if Unity by default add any flag that I could use to exclude the code?

For example

#if !UNITY
using System.Collections.Concurrent;
#endif

@ido-ran
Copy link
Author

ido-ran commented Feb 25, 2015

Unity does add flags but I'm writing a plugin to Unity so it's not a Unity project by itself.
What do you think about opt-in the experimental class instead of opt-out of it?

@guileen
Copy link

guileen commented Mar 30, 2015

I have same feature request for unity project.

@hultqvist
Copy link
Collaborator

I hope this is OK.
I rather make the newer .NET versions/features the default so the flag must be added for targeting older versions of the framework.

@guileen
Copy link

guileen commented Apr 8, 2015

Sometimes it is hard to compile on mac and linux, it will be very useful if you can provide a release file like https://github.com/hultqvist/ProtoBuf/releases/download/2014-08-23/ProtoBuf-2014-08-23-bin.zip

@hultqvist
Copy link
Collaborator

@guileen I'll do that tonight when I'm back at my Linux machine :)

If possible I suggest using http://www.mono-project.com/download/#download-lin rather than what is supplied by the distro which can be quite old.

@hultqvist
Copy link
Collaborator

@guileen done, precompiled release is now at
https://github.com/hultqvist/ProtoBuf/releases/tag/2015-04-08

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants