Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Change TFM to netcoreapp2.0 #6234

Merged
merged 3 commits into from
May 5, 2017
Merged

Conversation

pranavkm
Copy link
Contributor

@pranavkm pranavkm commented May 4, 2017

No description provided.

@pranavkm pranavkm requested review from Eilon and dougbu May 4, 2017 16:22
@pranavkm pranavkm force-pushed the prkrishn/netcoreapp branch 2 times, most recently from 3a67a96 to 1cf31a8 Compare May 4, 2017 18:53
Copy link
Member

@dougbu dougbu left a 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]
Copy link
Member

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(
Copy link
Member

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();
Copy link
Member

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();
Copy link
Member

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.

Copy link
Contributor Author

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 ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it does.

Copy link
Member

@dougbu dougbu May 4, 2017

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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?

Copy link
Member

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
Copy link
Member

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();
Copy link
Member

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 },
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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.
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InvalidByteRangeException

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thx.

@pranavkm pranavkm force-pushed the prkrishn/netcoreapp branch from 1cf31a8 to 48c9b18 Compare May 4, 2017 20:32
@pranavkm pranavkm changed the base branch from dev to rel/2.0.0-preview1 May 4, 2017 20:33
@pranavkm
Copy link
Contributor Author

pranavkm commented May 4, 2017

🆙 📅

Copy link
Member

@dougbu dougbu left a 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);
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #6235

Copy link
Member

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.
Copy link
Member

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 },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🆗

@dougbu
Copy link
Member

dougbu commented May 4, 2017

Separately, XmlSerializerInputFormatter isn't conditionally-compiled. Why are you deleting XmlSerializerInputFormatterTest?

@pranavkm
Copy link
Contributor Author

pranavkm commented May 4, 2017

🆙 📅

@@ -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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🆗

@ctolkien
Copy link

ctolkien commented May 5, 2017

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?

@pranavkm pranavkm merged commit 1c5e417 into rel/2.0.0-preview1 May 5, 2017
pranavkm added a commit that referenced this pull request May 5, 2017
@Eilon
Copy link
Member

Eilon commented May 5, 2017

@ctolkien - Please refer to dotnet/aspnetcore#2022 (comment) for some more details on this.

@smitpatel smitpatel deleted the prkrishn/netcoreapp branch June 28, 2017 21:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants