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

Add a project targeting .NET Core #573

Closed
wants to merge 1 commit into from

Conversation

Flavien
Copy link

@Flavien Flavien commented Jul 8, 2015

This is for the C# implementation.

I created a new project targeting .NET Core (DNX Core 5.0), which should make it cross platform (OS X, Linux). It would be nice to release this as a beta/preview NuGet package for those who need to target .NET Core.

So far it's only the ProtocolBuffersLite assembly.

The solution will still round-trip to Visual Studio 2013, though you will get a message saying it can't open the ProtocolBuffersLiteCoreFx.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@Flavien
Copy link
Author

Flavien commented Jul 8, 2015

CLA signed

On 8 July 2015 at 14:45, googlebot notifications@github.com wrote:

Thanks for your pull request. It looks like this may be your first
contribution to a Google open source project, in which case you'll need to
sign a Contributor License Agreement (CLA).

[image: 📝] Please visit https://cla.developers.google.com/
https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll

verify. Thanks.


Reply to this email directly or view it on GitHub
#573 (comment).

@googlebot
Copy link

CLAs look good, thanks!

@jskeet
Copy link
Contributor

jskeet commented Jul 8, 2015

I'd really rather avoid another project if at all possible - any reason we can't just make the existing project work with .NET Core? I believe it should just be a matter of supporting the relevant profile (258 IIRC, but that's off the top of my head.)

Note that in the csharp-experimental branch, I've killed off the Lite project as well - I'm trying to streamline all of this as much as possible.

@Flavien
Copy link
Author

Flavien commented Jul 27, 2015

I've looked more into this. I've created another branch with new projects targeting DNX 4.5.1, DNX Core 5.0 and PCL profile 92 for the ProtocolBuffers and ProtocolBuffers.Serialization projects (non-lite): https://github.com/flavien/protobuf/tree/dnx

The problem with replacing the old projects with those is that you'd need to replace the test projects as well, and NUnit won't work with Visual Studio from an xproj project (Right now, only XUnit works).

@jskeet
Copy link
Contributor

jskeet commented Jul 27, 2015

Again, I don't think an xproj is needed. Targeting profile 259 should be enough, I believe.
Also note that if you've been working off the master branch, all of that code is legacy, effectively - all work has been performed on the csharp-experimental branch.

@Flavien
Copy link
Author

Flavien commented Jul 27, 2015

I think there might be a misunderstanding. I am not referring to the .NET Core used for Windows Store Applications. I'm referring to the .NET Core DNX use by ASP.NET 5. I might be wrong, but don't think this can be targeted by a PCL. JSON.NET had to do the same for example.

@jskeet
Copy link
Contributor

jskeet commented Jul 27, 2015

No, we're referring to the same thing. While Json.NET does have a project.json, I don't think it's a requirement... I emailed James about that exact question around the time that he created the project.json, interestingly enough. I suspect he created a project.json file so that he could ensure that he tested it running under DNX core... I can investigate similar things.

@jskeet
Copy link
Contributor

jskeet commented Jul 28, 2015

I've just done this with Noda Time - built it against profile259, adjusted the nuspec file appropriately, and managed to get it building and running under dnxcore. No xproj files required in Noda Time at all.

@Flavien
Copy link
Author

Flavien commented Jul 28, 2015

Great, I see that you already have a pull request under way, so I'll wait for the next version of the NuGet package and hopefully it should work with .NET Core.

@jskeet
Copy link
Contributor

jskeet commented Jul 28, 2015

Indeed. We'll be testing that out ourselves of course - if you could kick the tires too when the package is created, that would be much appreciated :)

I'm going to close this PR for now - we can reopen it if the current plans fails. Let me know if there's anything in this PR that isn't covered by the current plan.

@jskeet jskeet closed this Jul 28, 2015
@Flavien
Copy link
Author

Flavien commented Oct 9, 2015

I've been running the 3.0.0-alpha4 package for some time, any idea when the 3.0.0 release will happen?

@jskeet
Copy link
Contributor

jskeet commented Oct 9, 2015

Couldn't say, I'm afraid. I'm hard at work on json parsing at the moment...

Jon
On 9 Oct 2015 19:27, "Flavien Charlon" notifications@github.com wrote:

I've been running the 3.0.0-alpha4 package
https://www.nuget.org/packages/google.protobuf for some time, any idea
when the 3.0.0 release will happen?


Reply to this email directly or view it on GitHub
#573 (comment).

@jaredthirsk
Copy link

jaredthirsk commented Sep 28, 2016

I don't know anything about PCL's, but I am trying to use this in .NET Core 1.0.1 and it is telling me "One or more packages are incompatible with .NETStandard,Version=v1.4" (my project is a DLL targeting 1.4.)

My understanding of .NET Core is that xproj is not required but project.json is (at least until project.json disappears.) (Guidance from Microsoft: https://docs.microsoft.com/en-us/dotnet/articles/core/tutorials/target-dotnetcore-with-msbuild)

@jskeet
Copy link
Contributor

jskeet commented Sep 29, 2016

You should be fine for Google.Protobuf - we target netstandard1.0:
https://github.com/google/protobuf/blob/master/csharp/src/Google.Protobuf/project.json#L46

If you run dotnet restore it should show you exactly which dependency is causing the problem.

adellahlou pushed a commit to adellahlou/protobuf that referenced this pull request Apr 20, 2023
…ents to reflection namespaces, see protocolbuffers#576; Also added Namespace#getEnum for completeness, see protocolbuffers#576; Made pbjs use loadSync for deterministic outputs, see protocolbuffers#573
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants