Skip to content

Create a .NET Standard 1.1 version of System.Net.Http.Formatting.dll #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ _[Ss]cripts
*.psess
*.orig
*.sln.ide
.vs/
.vs/
project.lock.json
2 changes: 1 addition & 1 deletion Runtime.msbuild
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@

<Target Name="RunTests" DependsOnTargets="CheckSkipStrongNames">
<ItemGroup>
<TestDLLsXunit Include="bin\$(Configuration)\test\*.Test.dll;bin\$(Configuration)\test\*.Test.*.dll;bin\$(Configuration)\Test\NetCore\*.Test.dll" />
<TestDLLsXunit Include="bin\$(Configuration)\test\*.Test.dll;bin\$(Configuration)\test\*.Test.*.dll;bin\$(Configuration)\Test\NetCore\*.Test.dll;bin\$(Configuration)\Test\NetStandard\*.Test.dll" />
<XunitProject Include="tools\WebStack.xunit.targets">
<Properties>TestAssembly=%(TestDLLsXunit.FullPath);XmlPath=$(TestResultsDirectory)%(TestDLLsXunit.FileName)-XunitResults.xml</Properties>
</XunitProject>
Expand Down
18 changes: 18 additions & 0 deletions RuntimePortable.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Net.Http.Formatting.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "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}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Net.Http.Formatting.NetStandard", "src\System.Net.Http.Formatting.NetStandard\System.Net.Http.Formatting.NetStandard.csproj", "{636CA76A-C85C-42E2-B4AA-88046279B3CA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Net.Http.Formatting.NetStandard.Test", "test\System.Net.Http.Formatting.NetStandard.Test\System.Net.Http.Formatting.NetStandard.Test.csproj", "{DECB05DF-B33A-44A0-B5DE-B14A8CE0740F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
CodeAnalysis|Any CPU = CodeAnalysis|Any CPU
Expand All @@ -36,6 +40,18 @@ Global
{8DA61DAC-FF7E-4CA1-93A0-6148DB66FD08}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8DA61DAC-FF7E-4CA1-93A0-6148DB66FD08}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8DA61DAC-FF7E-4CA1-93A0-6148DB66FD08}.Release|Any CPU.Build.0 = Release|Any CPU
{636CA76A-C85C-42E2-B4AA-88046279B3CA}.CodeAnalysis|Any CPU.ActiveCfg = CodeAnalysis|Any CPU
{636CA76A-C85C-42E2-B4AA-88046279B3CA}.CodeAnalysis|Any CPU.Build.0 = CodeAnalysis|Any CPU
{636CA76A-C85C-42E2-B4AA-88046279B3CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{636CA76A-C85C-42E2-B4AA-88046279B3CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{636CA76A-C85C-42E2-B4AA-88046279B3CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{636CA76A-C85C-42E2-B4AA-88046279B3CA}.Release|Any CPU.Build.0 = Release|Any CPU
{DECB05DF-B33A-44A0-B5DE-B14A8CE0740F}.CodeAnalysis|Any CPU.ActiveCfg = CodeAnalysis|Any CPU
{DECB05DF-B33A-44A0-B5DE-B14A8CE0740F}.CodeAnalysis|Any CPU.Build.0 = CodeAnalysis|Any CPU
{DECB05DF-B33A-44A0-B5DE-B14A8CE0740F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DECB05DF-B33A-44A0-B5DE-B14A8CE0740F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DECB05DF-B33A-44A0-B5DE-B14A8CE0740F}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{DECB05DF-B33A-44A0-B5DE-B14A8CE0740F}.Release|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -44,5 +60,7 @@ Global
{C7060639-719B-4BD2-8A37-2F146B5A0668} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
{FCCC4CB7-BAF7-4A57-9F89-E5766FE536C0} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{8DA61DAC-FF7E-4CA1-93A0-6148DB66FD08} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{636CA76A-C85C-42E2-B4AA-88046279B3CA} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
{DECB05DF-B33A-44A0-B5DE-B14A8CE0740F} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
EndGlobalSection
EndGlobal
2 changes: 1 addition & 1 deletion build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if %ERRORLEVEL% neq 0 goto BuildFail
goto BuildSuccess

:BuildDefaults
%MSBuild% Runtime.msbuild /m /nr:false /p:Platform="Any CPU" /p:Desktop=true /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=Normal
%MSBuild% Runtime.msbuild /m /nr:false /p:Platform="Any CPU" /p:Desktop=true /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=detailed
if %ERRORLEVEL% neq 0 goto BuildFail
goto BuildSuccess

Expand Down
2 changes: 1 addition & 1 deletion src/Common/CommonWebApiResources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),Runtime.sln))\tools\WebStack.settings.targets" />
<PropertyGroup>
<ProjectGuid>{636CA76A-C85C-42E2-B4AA-88046279B3CA}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>System.Net.Http</RootNamespace>
<AssemblyName>System.Net.Http.Formatting</AssemblyName>
<OutputPath>$(OutputPath)NetStandard\</OutputPath>
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
<RunCodeAnalysis>$(CodeAnalysis)</RunCodeAnalysis>
<CodeAnalysisRuleSet>..\Strict.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisAdditionalOptions> /assemblycomparemode:StrongNameIgnoringVersion</CodeAnalysisAdditionalOptions>
<CodeAnalysisSearchGlobalAssemblyCache>false</CodeAnalysisSearchGlobalAssemblyCache>
<DefineConstants>$(DefineConstants);NETFX_CORE;ASPNETMVC;NOT_CLS_COMPLIANT;NETSTANDARD1_1</DefineConstants>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<NoWarn>1591</NoWarn>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\CommonAssemblyInfo.cs">
<Link>Properties\CommonAssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\Common\Error.cs">
<Link>Common\Error.cs</Link>
</Compile>
<Compile Include="..\Common\TaskHelpers.cs">
<Link>Common\TaskHelpers.cs</Link>
</Compile>
<Compile Include="..\Common\TaskHelpersExtensions.cs">
<Link>Common\TaskHelpersExtensions.cs</Link>
</Compile>
<Compile Include="..\Common\UriQueryUtility.cs">
<Link>Common\UriQueryUtility.cs</Link>
</Compile>
<Compile Include="..\Common\CollectionExtensions.cs">
<Link>Common\CollectionExtensions.cs</Link>
</Compile>
<Compile Include="..\Common\ListWrapperCollection.cs">
<Link>Common\ListWrapperCollection.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\FormattingUtilities.cs">
<Link>FormattingUtilities.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\BaseJsonMediaTypeFormatter.cs">
<Link>Formatting\BaseJsonMediaTypeFormatter.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\BsonMediaTypeFormatter.cs">
<Link>Formatting\BsonMediaTypeFormatter.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\DelegatingEnumerable.cs">
<Link>Formatting\DelegatingEnumerable.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\FormDataCollection.cs">
<Link>Formatting\FormDataCollection.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\FormUrlEncodedJson.cs">
<Link>Formatting\FormUrlEncodedJson.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\IFormatterLogger.cs">
<Link>Formatting\IFormatterLogger.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\JsonMediaTypeFormatter.cs">
<Link>Formatting\JsonMediaTypeFormatter.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\MediaTypeConstants.cs">
<Link>Formatting\MediaTypeConstants.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\MediaTypeFormatter.cs">
<Link>Formatting\MediaTypeFormatter.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\MediaTypeFormatterCollection.cs">
<Link>Formatting\MediaTypeFormatterCollection.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\MediaTypeHeaderValueExtensions.cs">
<Link>Formatting\MediaTypeHeaderValueExtensions.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\MediaTypeHeaderValueRange.cs">
<Link>Formatting\MediaTypeHeaderValueRange.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\ParsedMediaTypeHeaderValue.cs">
<Link>Formatting\ParsedMediaTypeHeaderValue.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\Parsers\FormUrlEncodedParser.cs">
<Link>Formatting\Parsers\FormUrlEncodedParser.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\Parsers\HttpRequestHeaderParser.cs">
<Link>Formatting\Parsers\HttpRequestHeaderParser.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\Parsers\HttpRequestLineParser.cs">
<Link>Formatting\Parsers\HttpRequestLineParser.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\Parsers\HttpResponseHeaderParser.cs">
<Link>Formatting\Parsers\HttpResponseHeaderParser.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\Parsers\HttpStatusLineParser.cs">
<Link>Formatting\Parsers\HttpStatusLineParser.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\Parsers\InternetMessageFormatHeaderParser.cs">
<Link>Formatting\Parsers\InternetMessageFormatHeaderParser.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\Parsers\MimeMultipartBodyPartParser.cs">
<Link>Formatting\Parsers\MimeMultipartBodyPartParser.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\Parsers\MimeMultipartParser.cs">
<Link>Formatting\Parsers\MimeMultipartParser.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\Parsers\ParserState.cs">
<Link>Formatting\Parsers\ParserState.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\StringComparisonHelper.cs">
<Link>Formatting\StringComparisonHelper.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Formatting\XmlMediaTypeFormatter.cs">
<Link>Formatting\XmlMediaTypeFormatter.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Internal\HttpValueCollection.cs">
<Link>Internal\HttpValueCollection.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\UriExtensions.cs">
<Link>UriExtensions.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting.NetCore\GlobalSuppressions.cs">
<Link>GlobalSuppressions.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Handlers\HttpProgressEventArgs.cs">
<Link>Handlers\HttpProgressEventArgs.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Handlers\ProgressContent.cs">
<Link>Handlers\ProgressContent.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Handlers\ProgressMessageHandler.cs">
<Link>Handlers\ProgressMessageHandler.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Handlers\ProgressStream.cs">
<Link>Handlers\ProgressStream.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\HttpClientExtensions.cs">
<Link>HttpClientExtensions.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\HttpClientFactory.cs">
<Link>HttpClientFactory.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\HttpContentExtensions.cs">
<Link>HttpContentExtensions.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\HttpContentMessageExtensions.cs">
<Link>HttpContentMessageExtensions.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\HttpContentMultipartExtensions.cs">
<Link>HttpContentMultipartExtensions.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\HttpHeaderExtensions.cs">
<Link>HttpHeaderExtensions.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\HttpMessageContent.cs">
<Link>HttpMessageContent.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\HttpUnsortedHeaders.cs">
<Link>HttpUnsortedHeaders.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\HttpUnsortedRequest.cs">
<Link>HttpUnsortedRequest.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\HttpUnsortedResponse.cs">
<Link>HttpUnsortedResponse.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Internal\AsyncResult.cs">
<Link>Internal\AsyncResult.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Internal\DelegatingStream.cs">
<Link>Internal\DelegatingStream.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Internal\ReadOnlyStreamWithEncodingPreamble.cs">
<Link>Internal\ReadOnlyStreamWithEncodingPreamble.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Internal\TypeExtensions.cs">
<Link>Internal\TypeExtensions.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\MimeBodyPart.cs">
<Link>MimeBodyPart.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\MultipartFileData.cs">
<Link>MultipartFileData.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\MultipartMemoryStreamProvider.cs">
<Link>MultipartMemoryStreamProvider.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\MultipartRelatedStreamProvider.cs">
<Link>MultipartRelatedStreamProvider.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\MultipartStreamProvider.cs">
<Link>MultipartStreamProvider.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\ObjectContent.cs">
<Link>ObjectContent.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\ObjectContentOfT.cs">
<Link>ObjectContentOfT.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\PushStreamContent.cs">
<Link>PushStreamContent.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Properties\AssemblyInfo.cs">
<Link>Properties\AssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\Properties\Resources.Designer.cs">
<Link>Properties\Resources.Designer.cs</Link>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="..\System.Net.Http.Formatting\UnsupportedMediaTypeException.cs">
<Link>UnsupportedMediaTypeException.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting.NetCore\Internal\ConcurrentDictionary.cs">
<Link>Internal\ConcurrentDictionary.cs</Link>
</Compile>
<Compile Include="..\System.Net.Http.Formatting.NetCore\MediaTypeHeaderValueExtensions.cs">
<Link>MediaTypeHeaderValueExtensions.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Common\CommonWebApiResources.Designer.cs">
<Link>Properties\CommonWebApiResources.Designer.cs</Link>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>CommonWebApiResources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="..\Common\CommonWebApiResources.resx">
<Link>Properties\CommonWebApiResources.resx</Link>
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>CommonWebApiResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="..\System.Net.Http.Formatting\Properties\Resources.resx">
<Link>Properties\Resources.resx</Link>
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<CodeAnalysisDictionary Include="..\CodeAnalysisDictionary.xml">
<Link>CodeAnalysisDictionary.xml</Link>
</CodeAnalysisDictionary>
</ItemGroup>
<ItemGroup>
<None Include="project.json" />
<None Include="project.lock.json" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
</Project>
14 changes: 14 additions & 0 deletions src/System.Net.Http.Formatting.NetStandard/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

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

This file is for dev only, right? Can we add a comment here stating that this is for dev, and to make all real changes to the csproj?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the real file for realz. The containing project is a Portable class class library targeting .NET Standard 1.1. packages.config can't be used in such projects. But the flow is almost the same: NuGet.exe reads this file, downloads packages, and writes information the build needs about resolved references into project.lock.json. Recent tooling (i.e. VS2015 *.targets files) gets that reference information and goes from there -- pretty much like any other .csproj project.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Eilon do you have an objection to this approach? Note that going the whole dotnet route would be comparatively old school and tie us to a specific CLI version.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, no, that's fine with me, as long as it works 😄

"supports": {},
"dependencies": {
"NETStandard.Library": "1.6.0",
"Newtonsoft.Json": "9.0.1",
"System.ComponentModel.EventBasedAsync": "4.0.11",
"System.Diagnostics.Contracts": "4.0.1",
"System.Runtime.Serialization.Xml": "4.1.1",
"System.Xml.XmlSerializer": "4.0.11"
},
"frameworks": {
"netstandard1.1": {}
}
}
Loading