Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Start using System.Text.Encoding.Web from CLR #391

Closed
muratg opened this issue Sep 8, 2015 · 23 comments
Closed

Start using System.Text.Encoding.Web from CLR #391

muratg opened this issue Sep 8, 2015 · 23 comments
Assignees
Milestone

Comments

@muratg
Copy link

muratg commented Sep 8, 2015

No description provided.

@muratg muratg added the task label Sep 8, 2015
@muratg muratg added this to the 1.0.0-RC1 milestone Sep 8, 2015
@Eilon
Copy link
Contributor

Eilon commented Sep 10, 2015

This is now available on the internal share that we use, so this is unblocked.

@muratg
Copy link
Author

muratg commented Sep 11, 2015

@Tratcher

@Tratcher
Copy link
Member

@Eilon @muratg 4.0.0-beta-23326 is not compatible with .NET 4.5.1, it requires 4.6. It depends on System.Runtime 4.0.20, where we need 4.0.10 for 4.5.1.

@Tratcher
Copy link
Member

@ericstj ?

@ericstj
Copy link

ericstj commented Sep 29, 2015

It's compiling against quite a few contracts that are only supported in .NET 4.6.

I gave a try at moving it to contract versions that would support .NET 4.5.1 and it is not possible because the implementation depends on Buffer.MemoryCopy which was added in .NET 4.6. This appears to be the only dependency that is preventing portability to even to .NET 4.5. @KrzysztofCwalina

@muratg
Copy link
Author

muratg commented Sep 30, 2015

@ericstj thanks, @KrzysztofCwalina Should we file a bug on your side to track this? Otherwise we'll need to maintain our implementation at least for Desktop CLR.

@KrzysztofCwalina
Copy link

I will fix this tomorrow. No need to file a new bug.

@muratg
Copy link
Author

muratg commented Sep 30, 2015

@KrzysztofCwalina Sounds good, thanks!

@davidfowl
Copy link
Member

Ifdefs will set you free

@KrzysztofCwalina
Copy link

@ericstj, most of our projects in corefx depend on System.Runtime 4.0.20.

@ericstj
Copy link

ericstj commented Sep 30, 2015

That's because most of these don't intend to run downlevel. There are a few that have downlevel scenarios (like Immutable & Reflection.Metadata) and intentionally restrict their dependencies to versions that will work on those downlevel platforms.

@KrzysztofCwalina
Copy link

@ericstj, almost all (if not all) components in corefx depend on 4.0.20. And it seems like ASP.NET needs to and is successfully using them on 4.5.1 (i.e. downlevel)

@Eilon
Copy link
Contributor

Eilon commented Sep 30, 2015

Right, all of DNX, ASP.NET, and EF (with maybe some very small exceptions, where it's usually runtime light-up) need to run on .NET 4.5.1.

@KrzysztofCwalina
Copy link

@muratg, where you able to successfully pick up the updated package?

@muratg
Copy link
Author

muratg commented Oct 6, 2015

@KrzysztofCwalina Not yet. @Tratcher will be picking it up in the dev branch for RC1 and close this bug.

@Tratcher
Copy link
Member

Tratcher commented Oct 7, 2015

@KrzysztofCwalina Which build should it be in? 4.0.0-beta-23405 still depends on 4.0.20.

@ericstj
Copy link

ericstj commented Oct 7, 2015

@Tratcher
Copy link
Member

Hey @ericstj, I've got a PR for the swap, but we've found that the new types are much harder to mock out in tests because Encode isn't virtual. Here's an attempt at mocking (90c13ad#diff-387f3dc26a94ebcb7c37dd754bab84c5), but it only gets one character at a time so the best mock encoding I can manage is encoding "value" to "_v_a_l_u_e". We used to return "HtmlEncode[[value]]" (90c13ad#diff-5093aee64e24c262ac1165902a6ceef9L89).

This may require us to keep using our interfaces and wrapper classes and only delegate the implementation.
/cc: @muratg @Eilon @davidfowl

@KrzysztofCwalina
Copy link

Seems like that would be throwing baby with the bathwater. Can you use the mocks that add the underscore for now and I will make the Encode method virtual (next week)?

@Tratcher
Copy link
Member

Not really, it breaks too many tests to update in the short term. I could make my first check in still using the interfaces and postpone removing them until next week. @muratg? There are plenty of changes that we'll need to make upstream regardless (method names, parameter order, etc.).

@KrzysztofCwalina
Copy link

That sounds good, I think, i.e. the tests would need to keep the old interfaces, not the library, correct?

@Tratcher
Copy link
Member

The libraries will still need to use the interfaces or else the tests won't be able to mock out the encoders used in the libraries.

@KrzysztofCwalina
Copy link

I see. I just submitted a fix to corefx. If everything goes well, you should have a new drop tomorrow.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants