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 netstandard 2.0 target to Antlr3.Runtime #123

Open
zgabi opened this issue Oct 3, 2019 · 4 comments · May be fixed by #124
Open

Add netstandard 2.0 target to Antlr3.Runtime #123

zgabi opened this issue Oct 3, 2019 · 4 comments · May be fixed by #124
Assignees

Comments

@zgabi
Copy link

zgabi commented Oct 3, 2019

Currently I'm receiving the following error in a .net core project:
error PS0264: Ambiguous match: need to map 'System.Runtime.Serialization.StreamingContext, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Context=Runtime' and have several candidates: 'System.Runtime.Serialization.StreamingContext, Antlr3.Runtime, Version=3.5.0.2, Culture=neutral, PublicKeyToken=eb42632606e9261f, Context=Reference', 'System.Runtime.Serialization.StreamingContext, System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, Context=Reference.

Because it is referencing the netstandard1.1 version of Antrl3.Runtime package which has a hack for the StreamingContext sturct:
https://github.com/antlr/antlrcs/blob/master/Runtime/Antlr3.Runtime/System/StreamingContext.cs

This hack is not needed in netstandard2.0

@sharwell
Copy link
Member

error PS0264

What is this error? It's not being reported by the compiler.

@sharwell sharwell self-assigned this Oct 10, 2019
@zgabi
Copy link
Author

zgabi commented Oct 10, 2019

It is a PostSharp error code. It somehow checks all the classes and StreamingContext is duplicated, because it exists in the framework and in Antlr, too.

@sharwell
Copy link
Member

sharwell commented Oct 10, 2019

I've marked this issue as an enhancement request, but keep in mind the type here is marked internal and should not be impacting your tools. I suggest filing a bug report on PostSharp to correct their logic, as the current implementation should not break execution behavior even for netstandard2.0.

@zgabi
Copy link
Author

zgabi commented Oct 12, 2019

Thank you.

Btw: regaldless of this issue it is recommended (by Microsoft) to also target netstandard 2.0:
https://docs.microsoft.com/en-us/dotnet/standard/net-standard

However, targeting lower .NET Standard versions introduces a number of support dependencies. If your project targets .NET Standard 1.x, we recommend that you also target .NET Standard 2.0. This simplifies the dependency graph for users of your library that run on .NET Standard 2.0 compatible frameworks, and it reduces the number of packages they need to download.

For example the netstantard version of your package has a dependency to the NETStandard.Library, which has a lot of dependencies to System* packages in netstandard < 2.0

sharwell added a commit to sharwell/antlrcs that referenced this issue Oct 12, 2019
@sharwell sharwell linked a pull request Oct 12, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants