Repository navigation
Add support for in parameter modifier on .NET Core by adding .NET Standard 1.5 as additional target - #344
Conversation
|
Regarding the Travis CI build failures:
Since this seems to be Microsoft's compiler ( Also, it seems that Mono's C# compiler (
This seems to be a general issue with the build process, and therefore unrelated to this PR. |
Looks great, pretty sure that's it.
.NET Standard versions of dependencies:
Do you know what happens if a user picks NLog and is on a platform where NuGet could choose .NET Standard 1.5/2.0 but we only have a 1.3, .NET Standard is obviously additive, but if NuGet picked a higher platform it would add members/types etc that could break us depending on it. This will probably determine if we should add it to these too.
I disagree that it is unrelated to this pull request, this pull request merged would break the build. Yes, Mono now ships Roslyn as its default compiler ( |
2c26f69 to
3060251
Compare
| // that was introduced with C# language version 7.2. | ||
| [TestFixture] | ||
| public class ValueTypeReferenceSemanticsTestCase : BasePEVerifyTestCase | ||
| { |
| Enhancements: | ||
| - Added .NET Standard/.NET Core support for NLog (@snakefoot, #200) | ||
| - Added .NET Standard/.NET Core support for log4net (@snakefoot, #201) | ||
| - Add .NET Standard 1.5 as additional target to NuGet package. This adds support for `in` parameter modifiers on e.g. .NET Core (@stakx, #339) |
There was a problem hiding this comment.
Could to clarify the changelog entry so it is clear this wasn't a problem on .NET Framework. Thanks.
There was a problem hiding this comment.
The `in` modifier on parameters that was introduced with C# 7.2 gets encoded as a modreq. Because .NET Standard 1.3 (the sole `netstandard` TFM currently targeted by Castle Core) does not support emitting custom modifiers in IL, we couldn't support proxying methods with such an `in` modifier. However we can support this scenario by adding `netstandard1.5` as a TFM to Castle Core: .NET Standard 1.5 supports emitting modreqs in IL.
280941d to
369516e
Compare
* Rewrite changelog entry so it's clear that `in` parameter modifiers already worked on the .NET Framework, and that only support for .NET Core is being added. * Fix indentation.
ed1c9d2 to
fe6ef2b
Compare
Trial and error suggests this is caused by an outdated .NET Core SDK version (1.0.4). So With this, only C# language versions up to 7.1 will be supported. But we need 7.2. With this, we're good to go with C# 7.2. But we get two new problems:
Dear gods... the joys of modern .NET. 🦆 🏜 |
8f8efc5 to
bb89f3a
Compare
Possibly if binfmt isn't set up anymore after changing the Travis settings. Sounds like a good change anyway. |
|
Joy! Prepending |
|
There's still this open question from you:
I don't know as of now. I'll probably need to run a few experiments later on. |
TL;DR: While we might be on the safer side by adding I ran two quick experiments: (1) What if the logging packages didn't target
|
That is what I thought would happen, it is expected that newer .NET Standard versions won't make breaking changes and the IL generated when compiling against lower .NET Standard versions will always be compatible even if new members appear in a higher .NET Standard compatible assembly. |
|
Squished and merged the changes. Thanks @stakx. |
This is an attempt at solving #339.
It would be good if someone who's intimately familiar with the build process could take a closer look at what I've done in order to add the additional
netstandard1.5target:netstandard1.5target to stay in-sync with Castle.Core?