Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2ed73bc

Browse files
authored
Move NetCore project to use .NET SDK (#380)
Move NetCore project to use .NET SDK- Formatting.NetCore now targets `netstandard1.3` - was `Profile259` aka `portable-net45+wp80+win8+wpa81`, approximately `netstandard1.0` - but Newtonsoft.Json.Bson supports `netstandard1.3` and up- use Newtonsoft.Json.Bson in NetCore projects- can now multi-target NetCore.Test as well- nits: - align src/ Formatting projects as much as possible - align test/ Formatting projects as much as possible - clean up the Microsoft.TestCommon project slightly- note: NetCore project names make no sense but I'm leaving them alone for this PRReact to using Newtonsoft.Json.Bson everywhere- remove deprecated `BsonWriter` mentions entirely- remove legacy BSON writer test workaroundRemove unnecessary `ConcurrentDictionary` class- was not available in `Profile259`- leave tests to confirm correct operation w/ "real" classRemove `UriQueryUtility` because `WebUtility` is available everywhere- leave test to confirm `WebUtility` continues to behave about the same - handle `WebUtility` being a `public` class- change other tests to handle `WebUtility.UrlEncode(...)` encoding to uppercase - unlike `UriQueryUtility.UrlEncode(...)`Add simple classes to NetCore project- use `ICloneable` copy to get more classes compiling - helps NetCore in similar way to existing `MediaTypeHeaderValueExtensions`- use `InvalidEnumArgumentException` copy to simplify code and testing- both not available in `netstandard1.3` (or available packages) but easily duplicatedRemove unnecessary NetCore-specific GlobalSuppressions.cs fileUse `NameValueCollection` everywhere- available (but not serializable) in `netstandard1.3`Add `MaxDepth` support in NetCore assembly- remove an unnecessary suppression about `MaxDepth` in `BaseJsonMediaTypeFormatter`Add `UseDataContractJsonSerializer` support in NetCore assembly- `XsdDataContractExporter` remains unavailable - update XML DCS tests to handle this (previously not in NetCore assembly)- try various workarounds - `ReadOnlyStreamWithEncodingPreamble` causes tests to hitdotnet/runtime#80160 - restriction to UTF8 when writing is a significant issueCopy `TranscodingStream` and related files from dotnet/runtime- my runtime clone was at 88868b7a781f4e5b9037b8721f30440207a7aa42Adjust `TranscodingStream` and related code to compile and run here- add conditions to avoid references to version-specific API- remove references to internal dotnet/runtime code - rewrite some code more generically if performance impact likely minor- use Microsoft.TestCommon instead of directly relying on Xunit in tests- use C# 9.0Use `TranscodingStream` in JSON and XML formatters- remove `ReadOnlyStreamWithEncodingPreamble` and its tests - was insufficient in general and doesn't work correctly in `netstandard1.3` - seedotnet/runtime#80160- now support a much broader set of encodings in JSON and XML formatters - not just UTF8, UTF16BE, and UTF16LE - JSON formatter already supported every encoding when `UseDataContractJsonSerializer` was `false` - no longer have this downside when property is `true` - however, quotas remain unsupported in `netstandard1.3` version of this formatter when property is `true` - XML formatter requirement for an XML declaration in non-UTF8 content was general and is no longer an issueAdd `MediaTypeMappings` support in NetCore assemblyAdd `IRequiredMemberSelector` support in NetCore assemblyRemove unnecessary NETFX_CORE workarounds- use `DefaultContractResolver`, `GuidAttribute`, `TypeDescriptor`, `XmlElement`, `XmlNode` classes- use `IRequiredMemberSelector` interface- use `RequestMessage.CreateResponse()` extension method - all available in `netstandard1.3`- `JsonContractResolver` use is something of a late Newtonsoft.Json version reaction - was held back by missing `IRequiredMemberSelector`Work around missing features in `netstandard1.3`- get classes now included in NetCore assembly compiling- `SerializationAttribute` is not available - therefore `Exception` is not serializable - therefore `DefaultContractResolver.IgnoreSerializableAttribute` is not available- `Stream.(Begin|End)(Read|Write)` and `Stream.Close()` are not available- nit: clean up `MultipartFormDataStreamProvider` whitespace
1 parentfc1cf70 commit2ed73bc

File tree

69 files changed

+2770
-2229
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2770
-2229
lines changed

‎RuntimePortable.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{C40883CD-3
99
EndProject
1010
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") ="Microsoft.TestCommon","test\Microsoft.TestCommon\Microsoft.TestCommon.csproj","{FCCC4CB7-BAF7-4A57-9F89-E5766FE536C0}"
1111
EndProject
12-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") ="System.Net.Http.Formatting.NetCore","src\System.Net.Http.Formatting.NetCore\System.Net.Http.Formatting.NetCore.csproj","{C7060639-719B-4BD2-8A37-2F146B5A0668}"
12+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") ="System.Net.Http.Formatting.NetCore","src\System.Net.Http.Formatting.NetCore\System.Net.Http.Formatting.NetCore.csproj","{C7060639-719B-4BD2-8A37-2F146B5A0668}"
1313
EndProject
1414
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") ="System.Net.Http.Formatting.NetCore.Test","test\System.Net.Http.Formatting.NetCore.Test\System.Net.Http.Formatting.NetCore.Test.csproj","{8DA61DAC-FF7E-4CA1-93A0-6148DB66FD08}"
1515
EndProject

‎packages/repositories.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<repositorypath="..\src\Microsoft.AspNet.Facebook\packages.config" />
44
<repositorypath="..\src\Microsoft.Web.Helpers\packages.config" />
55
<repositorypath="..\src\Microsoft.Web.WebPages.OAuth\packages.config" />
6-
<repositorypath="..\src\System.Net.Http.Formatting.NetCore\packages.config" />
76
<repositorypath="..\src\System.Net.Http.Formatting\packages.config" />
87
<repositorypath="..\src\System.Web.Http.Owin\packages.config" />
98
<repositorypath="..\src\System.Web.Http.SignalR\packages.config" />

‎src/Common/Error.cs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,7 @@ internal static OperationCanceledException OperationCanceled(string messageForma
225225
/// <returns>The logged <see cref="Exception"/>.</returns>
226226
internalstaticArgumentExceptionInvalidEnumArgument(stringparameterName,intinvalidValue,TypeenumClass)
227227
{
228-
#ifNETFX_CORE
229-
returnnewArgumentException(Error.Format(CommonWebApiResources.InvalidEnumArgument,parameterName,invalidValue,enumClass.Name),parameterName);
230-
#else
231228
returnnewInvalidEnumArgumentException(parameterName,invalidValue,enumClass);
232-
#endif
233229
}
234230

235231
/// <summary>
@@ -265,5 +261,24 @@ internal static NotSupportedException NotSupported(string messageFormat, params
265261
{
266262
returnnewNotSupportedException(Error.Format(messageFormat,messageArgs));
267263
}
264+
265+
#ifNETFX_CORE// InvalidEnumArgumentException not available in netstandard1.3.
266+
internalclassInvalidEnumArgumentException:ArgumentException
267+
{
268+
publicInvalidEnumArgumentException():this(null)
269+
{}
270+
271+
publicInvalidEnumArgumentException(stringmessage):base(message)
272+
{}
273+
274+
publicInvalidEnumArgumentException(stringmessage,ExceptioninnerException):base(message,innerException)
275+
{}
276+
277+
publicInvalidEnumArgumentException(stringargumentName,intinvalidValue,TypeenumClass):base(
278+
Error.Format(CommonWebApiResources.InvalidEnumArgument,argumentName,invalidValue,enumClass.Name),
279+
argumentName)
280+
{}
281+
}
282+
#endif
268283
}
269284
}

‎src/Common/UriQueryUtility.cs

Lines changed: 0 additions & 278 deletions
This file was deleted.

‎src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
<PropertyGroup>
55
<IsPackable>true</IsPackable>
66
<IsTestProject>false</IsTestProject>
7-
<TargetFrameworkVersionCondition="'$(MSBuildProjectName)' != 'System.Net.Http.Formatting.NetStandard'">v4.5</TargetFrameworkVersion>
7+
<TargetFrameworkVersionCondition=" !$(MSBuildProjectName.StartsWith('System.Net.Http.Formatting.Net'))">v4.5</TargetFrameworkVersion>
88
</PropertyGroup>
99
</Project>

‎src/System.Net.Http.Formatting.NetCore/GlobalSuppressions.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// No ICloneable interface in .NET Standard 1.3.
2+
3+
namespaceSystem
4+
{
5+
internalinterfaceICloneable
6+
{
7+
objectClone();
8+
}
9+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp