-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Conversation
3a67a96
to
1cf31a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to recheck our assumptions on what's available in .NET Core. 2.0 is way more inclusive.
|
||
namespace Microsoft.AspNetCore.Mvc.Internal | ||
{ | ||
/// <summary> | ||
/// An exception which indicates multiple matches in action selection. | ||
/// </summary> | ||
#if NET46 | ||
[Serializable] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If [Serializable]
is available in .NET Core, use it.
@@ -108,49 +108,6 @@ public override Task<int> ReadAsync(byte[] buffer, int offset, int count, Cancel | |||
return _innerStream.ReadAsync(buffer, offset, count, cancellationToken); | |||
} | |||
|
|||
#if NET46 | |||
/// <inheritdoc /> | |||
public override IAsyncResult BeginRead( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't these methods part of the .NET Core surface? Need to be overridden if they're now included.
@@ -15,13 +12,6 @@ public static class FormattingUtilities | |||
{ | |||
public static readonly int DefaultMaxDepth = 32; | |||
|
|||
#if NET46 | |||
public static readonly XsdDataContractExporter XsdDataContractExporter = new XsdDataContractExporter(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bit surprised XsdDataContractExporter
isn't included in .NET Core App. Thought the XML assemblies were the subject of a long .NET Standard discussion and that the decision was to included almost everything.
catch (System.Reflection.TargetInvocationException) | ||
{ | ||
// Fallback to a FIPS compliant SHA256 algorithm. | ||
sha256 = new SHA256CryptoServiceProvider(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If SHA256CryptoServiceProvider
is available in .NET Core App, may need to handle this fallback on FIPS machines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it worked correctly in netcoreapp. @blowdart ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My intent was twofold: Do we need this fallback? And, if it's required, does SHA256CryptoServiceProvider
exist? So, we've resolved only the second part.
If SHA256.Create()
does not work correctly on FIPS machines, we need this fallback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SHA256.Create()
in netcoreapp
works correctly on FIPS machines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blowdart is my statement correct? We don't need to worry about the desktop specific code here because calling SHA256.Create()
works correctly in netcoreapp?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it's correct. Core is FIPS compliant by default, there's no choice.
@@ -150,30 +128,5 @@ public ViewInfoContainer2() | |||
{ | |||
} | |||
} | |||
|
|||
#if NET46 | |||
private class AssemblyWithEmptyLocation : Assembly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still impossible in .NET Core?
var nonDisposableStream = new NonDisposableStream(innerStream); | ||
|
||
// Act | ||
nonDisposableStream.Close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still no Stream.Close()
in .NET Core App?
|
||
{ new List<MediaTypeFormatterMatch>() { matchMapping05, matchAccept10 }, matchAccept10 }, | ||
{ new List<MediaTypeFormatterMatch>() { matchMapping05, matchAcceptSubTypeRange10 }, matchAcceptSubTypeRange10 }, | ||
{ new List<MediaTypeFormatterMatch>() { matchMapping05, matchAcceptAllRange10 }, matchAcceptAllRange10 }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why as this part of the data set specific to .NET Framework?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uses APIs that aren't available in the portable System.Net.Http.Formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🆗
@@ -278,32 +278,6 @@ public void CreateResponse_AcceptingFormatter_WithOverridenMediaTypeHeader_Creat | |||
Assert.Equal("bin/baz", response.Content.Headers.ContentType.MediaType); | |||
} | |||
|
|||
#if NET46 | |||
// API doesn't exist in CoreCLR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What API and is this still true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InvalidByteRangeException
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And that's not in .NET Core App 2.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's from System.Net.Http.Formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thx.
1cf31a8
to
48c9b18
Compare
🆙 📅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very close.
@@ -132,13 +132,7 @@ protected virtual DataContractSerializer CreateSerializer(Type type) | |||
|
|||
try | |||
{ | |||
#if NET46 | |||
// Verify that type is a valid data contract by forcing the serializer to try to create a data contract | |||
FormattingUtilities.XsdDataContractExporter.GetRootElementName(type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've restored FormattingUtilities.XsdDataContractExporter
. Should restore this too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #6235
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🆗
@@ -278,32 +278,6 @@ public void CreateResponse_AcceptingFormatter_WithOverridenMediaTypeHeader_Creat | |||
Assert.Equal("bin/baz", response.Content.Headers.ContentType.MediaType); | |||
} | |||
|
|||
#if NET46 | |||
// API doesn't exist in CoreCLR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And that's not in .NET Core App 2.0?
|
||
{ new List<MediaTypeFormatterMatch>() { matchMapping05, matchAccept10 }, matchAccept10 }, | ||
{ new List<MediaTypeFormatterMatch>() { matchMapping05, matchAcceptSubTypeRange10 }, matchAcceptSubTypeRange10 }, | ||
{ new List<MediaTypeFormatterMatch>() { matchMapping05, matchAcceptAllRange10 }, matchAcceptAllRange10 }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🆗
Separately, |
🆙 📅 |
@@ -132,13 +132,7 @@ protected virtual DataContractSerializer CreateSerializer(Type type) | |||
|
|||
try | |||
{ | |||
#if NET46 | |||
// Verify that type is a valid data contract by forcing the serializer to try to create a data contract | |||
FormattingUtilities.XsdDataContractExporter.GetRootElementName(type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🆗
A lot of people are really confused (and freaking out, myself included) as to what is going on here. It's no longer targeting NetStandard?! We can't use this against Full Framework? |
Change TFM to netcoreapp2.0 (#6234)
@ctolkien - Please refer to dotnet/aspnetcore#2022 (comment) for some more details on this. |
No description provided.