Merge branches

This commit is contained in:
wtgodbe 2019-10-14 13:21:58 -07:00
commit 8deeed2fa8
67 changed files with 322 additions and 24 deletions

View File

@ -46,7 +46,8 @@
<!-- Contact email address for NuGet packages and Linux installers. -->
<MaintainerEmail>nugetaspnet@microsoft.com</MaintainerEmail>
<PackageIconUrl>https://go.microsoft.com/fwlink/?LinkID=288859</PackageIconUrl>
<PackageIcon>packageIcon.png</PackageIcon>
<PackageIconFullPath>$(MSBuildThisFileDirectory)packageIcon.png</PackageIconFullPath>
<PackageProjectUrl>https://asp.net</PackageProjectUrl>
<NuspecBasePath>$(MSBuildProjectDirectory)</NuspecBasePath>
@ -55,6 +56,10 @@
<DefaultNetCoreTargetFramework>netcoreapp3.1</DefaultNetCoreTargetFramework>
</PropertyGroup>
<ItemGroup>
<None Include="$(PackageIconFullPath)" Pack="true" PackagePath="\"/>
</ItemGroup>
<!-- Warnings and errors -->
<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
@ -86,7 +91,7 @@
<TargetingPackInstallerBaseName>aspnetcore-targeting-pack</TargetingPackInstallerBaseName>
<!-- Used to only produce targeting pack installers/packages once per major.minor. -->
<IsTargetingPackBuilding Condition="'$(AspNetCorePatchVersion)' == '0' AND '$(DotNetBuildFromSource)' != 'true'">false</IsTargetingPackBuilding>
<IsTargetingPackBuilding Condition="'$(AspNetCorePatchVersion)' != '0' OR '$(DotNetBuildFromSource)' == 'true'">false</IsTargetingPackBuilding>
<!--
Archives and installers using this prefix are intended for internal-use only.

View File

@ -105,6 +105,12 @@
<Compile Include="$(SharedSourceRoot)ReferenceAssemblyInfo.cs" LinkBase="Properties" />
</ItemGroup>
<PropertyGroup Condition="'$(Language)' == 'C#'">
<!-- Reference assemblies should always use Major.Minor.0.0 for assembly versions even during servicing. Only the package version should be updated. -->
<!-- Pinning the implementation assemblies at Major.Minor.0.0 as we figure out compiling against ref assemblies. -->
<AssemblyVersion>$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).0.0</AssemblyVersion>
</PropertyGroup>
<ItemGroup>
<KnownFrameworkReference Update="Microsoft.NETCore.App">
<!-- Always update the 'latest version', whether the repo is servicing or not. -->

View File

@ -15,7 +15,14 @@ Directory.Build.props checks this property using the following condition:
<PropertyGroup Condition=" '$(VersionPrefix)' == '3.0.1' ">
<PackagesInPatch>
Microsoft.Net.Http.Headers;
Microsoft.AspNetCore.CookiePolicy;
Microsoft.AspNetCore.DataProtection.EntityFrameworkCore;
@microsoft/signalr;
Microsoft.Net.Http.Headers;
Microsoft.AspNetCore.Http.Abstractions;
Microsoft.AspNetCore.Http.Features;
Microsoft.AspNetCore.CookiePolicy;
</PackagesInPatch>
</PropertyGroup>
</Project>

View File

@ -238,7 +238,7 @@
<CastleCorePackageVersion>4.2.1</CastleCorePackageVersion>
<FSharpCorePackageVersion>4.2.1</FSharpCorePackageVersion>
<GoogleProtobufPackageVersion>3.8.0</GoogleProtobufPackageVersion>
<GrpcAspNetCorePackageVersion>2.23.1</GrpcAspNetCorePackageVersion>
<GrpcAspNetCorePackageVersion>2.23.2</GrpcAspNetCorePackageVersion>
<IdentityServer4AspNetIdentityPackageVersion>3.0.0</IdentityServer4AspNetIdentityPackageVersion>
<IdentityServer4EntityFrameworkPackageVersion>3.0.0</IdentityServer4EntityFrameworkPackageVersion>
<IdentityServer4PackageVersion>3.0.0</IdentityServer4PackageVersion>

View File

@ -52,6 +52,7 @@
<_RefSourceOutputPath>$([System.IO.Directory]::GetParent('$(MSBuildProjectDirectory)'))/ref/</_RefSourceOutputPath>
<_RefSourceFileName>$(AssemblyName).$(_RefSourceFileTFM).cs</_RefSourceFileName>
<_ManualRefSourceFileName>$(AssemblyName).Manual.cs</_ManualRefSourceFileName>
<_RefSourceFileOutputPath>$(_RefSourceOutputPath)$(_RefSourceFileName)</_RefSourceFileOutputPath>
</PropertyGroup>
@ -87,6 +88,12 @@
</ItemGroup>
<PropertyGroup>
<_ManualReferenceAssemblyContent />
<_ManualReferenceAssemblyContent Condition="Exists('$(_RefSourceOutputPath)$(_ManualRefSourceFileName)')">
<![CDATA[
<Compile Include="$(_ManualRefSourceFileName)" />]]>
</_ManualReferenceAssemblyContent>
<ReferencesContent>
<![CDATA[
<ItemGroup Condition="'%24(TargetFramework)' == '$(_RefProjectFileTFM)'">

View File

@ -12,14 +12,14 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NuGet.Build.Tasks" Version="5.1.0-rtm.5921" />
<PackageReference Include="NuGet.Build.Tasks" Version="5.3.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.1.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
<PackageReference Include="Microsoft.Build.Framework" Version="15.8.166" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="15.8.166" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.8.166" />
<PackageReference Include="Microsoft.Build.Framework" Version="16.3.0" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="16.3.0" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.3.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net472'">

BIN
packageIcon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -25,6 +25,7 @@
<ItemGroup>
<NuspecProperty Include="OutputBinary=$(OutputPath)$(AssemblyName).dll" />
<NuspecProperty Include="OutputSymbol=$(OutputPath)$(AssemblyName).pdb" />
<NuspecProperty Include="PackageIcon=$(PackageIconFullPath)" />
</ItemGroup>
</Project>

View File

@ -2,10 +2,12 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
$CommonMetadataElements$
<icon>packageIcon.png</icon>
</metadata>
<files>
<file src="$OutputBinary$" target="analyzers\dotnet\cs\" />
<file src="$OutputSymbol$" target="analyzers\dotnet\cs\" />
<file src="$PackageIcon$" target="" />
</files>
</package>

View File

@ -23,6 +23,7 @@
<NuspecProperty Include="componentsversion=$(ComponentsPackageVersion)" />
<NuspecProperty Include="razorversion=$(MicrosoftAspNetCoreRazorDesignPackageVersion)" />
<NuspecProperty Include="blazormonoversion=$(MicrosoftAspNetCoreBlazorMonoPackageVersion)" />
<NuspecProperty Include="PackageIcon=$(PackageIconFullPath)" />
</ItemGroup>
<ItemGroup>

View File

@ -5,6 +5,7 @@
<dependencies>
<dependency id="Microsoft.AspNetCore.Blazor.Mono" version="$blazormonoversion$" include="all" />
</dependencies>
<icon>packageIcon.png</icon>
</metadata>
<files>
<file src="..\..\..\THIRD-PARTY-NOTICES.txt" />
@ -12,5 +13,6 @@
<file src="targets\**" target="targets" />
<file src="$publishdir$**\*" target="tools/" />
<file src="..\..\..\Web.JS\dist\$configuration$\blazor.*.js" target="tools/blazor" />
<file src="$PackageIcon$" target="" />
</files>
</package>

View File

@ -33,6 +33,7 @@
<NuspecProperty Include="publishDir=$(PublishDir)" />
<NuspecProperty Include="componentsrootdir=..\..\..\" />
<NuspecProperty Include="blazorversion=$(PackageVersion)" />
<NuspecProperty Include="PackageIcon=$(PackageIconFullPath)" />
</ItemGroup>
</Project>

View File

@ -2,10 +2,12 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
$CommonMetadataElements$
<icon>packageIcon.png</icon>
</metadata>
<files>
<file src="build\**" target="build" />
<file src="$publishDir$**\*" target="tools" />
<file src="$componentsrootdir$THIRD-PARTY-NOTICES.txt" target=".\THIRD-PARTY-NOTICES.txt" />
<file src="$PackageIcon$" target="" />
</files>
</package>

View File

@ -15,6 +15,10 @@
<IsProjectReferenceProvider>false</IsProjectReferenceProvider>
</PropertyGroup>
<ItemGroup>
<NuspecProperty Include="PackageIcon=$(PackageIconFullPath)" />
</ItemGroup>
<ItemGroup>
<UpToDateCheckInput Include="content\**\.template.config.src\**\*.*" />
</ItemGroup>

View File

@ -5,11 +5,13 @@
<packageTypes>
<packageType name="Template" />
</packageTypes>
<icon>packageIcon.png</icon>
</metadata>
<files>
<file
src="content/**"
exclude="**/bin/**;**/obj/**;**/.template.config.src/**;content/Directory.Build.props;content/Directory.Build.targets;"
target="Content" />
<file src="$PackageIcon$" target="" />
</files>
</package>

View File

@ -55,6 +55,7 @@
<NuspecProperty Condition="'$(DotNetBuildFromSource)' != 'true'" Include="systemComponentModelAnnotationsPackageVersion=$(SystemComponentModelAnnotationsPackageVersion)" />
<NuspecProperty Include="AssemblyName=$(AssemblyName)" />
<NuspecProperty Include="OutputPath=$(OutputPath)" />
<NuspecProperty Include="PackageIcon=$(PackageIconFullPath)" />
</ItemGroup>
</Project>

View File

@ -15,11 +15,13 @@
<dependency id="Microsoft.JSInterop" version="$jsInteropPackageVersion$" exclude="Build,Analyzers" />
</group>
</dependencies>
<icon>packageIcon.png</icon>
</metadata>
<files>
<file src="$OutputPath$**\$AssemblyName$.dll" target="lib\" />
<file src="$OutputPath$**\$AssemblyName$.pdb" target="lib\" />
<file src="$OutputPath$**\$AssemblyName$.xml" target="lib\" />
<file src="$PackageIcon$" target="" />
<file src="..\..\THIRD-PARTY-NOTICES.txt" target=".\THIRD-PARTY-NOTICES.txt" />
</files>
</package>

View File

@ -9,11 +9,13 @@
<dependency id="Microsoft.JSInterop" version="$jsInteropPackageVersion$" exclude="Build,Analyzers" />
</group>
</dependencies>
<icon>packageIcon.png</icon>
</metadata>
<files>
<file src="$OutputPath$**\$AssemblyName$.dll" target="lib\" />
<file src="$OutputPath$**\$AssemblyName$.pdb" target="lib\" />
<file src="$OutputPath$**\$AssemblyName$.xml" target="lib\" />
<file src="$PackageIcon$" target="" />
<file src="..\..\THIRD-PARTY-NOTICES.txt" target=".\THIRD-PARTY-NOTICES.txt" />
</files>
</package>

View File

@ -38,10 +38,17 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<!-- Reference implementation assemblies in addition to ref assemblies to get xml docs -->
<ReferenceImplementationAssemblies>true</ReferenceImplementationAssemblies>
<!-- We are ignoring MSB3243 warnings since implemenation and reference assemblies are versioned differently. We need both to compose the targeting pack with reference assemblies and xml docs. -->
<MSBuildWarningsAsMessages>MSB3243</MSBuildWarningsAsMessages >
<!-- Platform manifest data -->
<FrameworkListFileName>FrameworkList.xml</FrameworkListFileName>
<FrameworkListOutputPath>$(ArtifactsObjDir)$(FrameworkListFileName)</FrameworkListOutputPath>
<!-- Platform manifest and package override metatdata -->
<ReferencePackSharedFxVersion>$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).0</ReferencePackSharedFxVersion>
<ReferencePackSharedFxVersion Condition="'$(VersionSuffix)' != ''">$(ReferencePackSharedFxVersion)-$(VersionSuffix)</ReferencePackSharedFxVersion>
<ReferencePlatformManifestOutputPath>$(ArtifactsObjDir)ref\PlatformManifest.txt</ReferencePlatformManifestOutputPath>
</PropertyGroup>
<ItemGroup>
@ -80,7 +87,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
</BuildDependsOn>
<!-- No-op when in source build -->
<BuildDependsOn Condition="'$(IsTargetingPackBuilding)' != 'false' and '$(DotNetBuildFromSource)' == 'true'"/>
<BuildDependsOn Condition="'$(IsTargetingPackBuilding)' == 'false'"/>
</PropertyGroup>
<!-- Override the default MSBuild targets so that nothing is returned from the project since it represents a collection of assemblies. -->
@ -95,6 +102,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<!-- This target finds the reference assemblies. -->
<Target Name="_ResolveTargetingPackContent"
Returns="@(AspNetCoreReferenceAssemblyPath)"
BeforeTargets="_GetPackageFiles"
DependsOnTargets="ResolveReferences;FindReferenceAssembliesForReferences">
<ItemGroup>
@ -111,6 +119,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
Exclude="
@(_SelectedExtensionsRefAssemblies);
@(ReferencePathWithRefAssemblies->WithMetadataValue('NuGetPackageId', 'Microsoft.NETCore.App.Ref'));
@(ReferencePathWithRefAssemblies->WithMetadataValue('IsReferenceAssembly', 'false'));
@(ReferencePathWithRefAssemblies->WithMetadataValue('ReferenceGrouping', 'Microsoft.NETCore.App'));" />
<AspNetCoreReferenceAssemblyPath
@ -118,11 +127,23 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<AspNetCoreReferenceDocXml Include="@(_ResolvedProjectReferencePaths->WithMetadataValue('IsReferenceAssembly', 'false')->'%(RootDir)%(Directory)%(FileName).xml')" />
<AspNetCoreReferenceDocXml Include="@(_SelectedExtensionsRefAssemblies->'$(MicrosoftInternalExtensionsRefsPath)%(FileName).xml')" />
</ItemGroup>
<RepoTasks.GenerateSharedFrameworkDepsFile
DepsFilePath="$(ProjectDepsFilePath)"
TargetFramework="$(TargetFramework)"
FrameworkName="$(TargetingPackName)"
FrameworkVersion="$(ReferencePackSharedFxVersion)"
References="@(AspNetCoreReferenceAssemblyPath)"
RuntimeIdentifier="$(TargetRuntimeIdentifier)"
RuntimePackageName="$(PackageId)"
PlatformManifestOutputPath="$(ReferencePlatformManifestOutputPath)" />
<ItemGroup>
<RefPackContent Include="@(AspNetCoreReferenceAssemblyPath)" PackagePath="$(RefAssemblyPackagePath)" />
<RefPackContent Include="@(AspNetCoreReferenceDocXml)" PackagePath="$(RefAssemblyPackagePath)" />
<RefPackContent Include="$(TargetDir)$(PackageConflictManifestFileName)" PackagePath="$(ManifestsPackagePath)" />
<RefPackContent Include="$(PlatformManifestOutputPath)" PackagePath="$(ManifestsPackagePath)" />
<RefPackContent Include="$(ReferencePlatformManifestOutputPath)" PackagePath="$(ManifestsPackagePath)" />
</ItemGroup>
</Target>
@ -130,9 +151,10 @@ This package is an internal implementation of the .NET Core SDK and is not meant
DependsOnTargets="ResolveReferences"
Inputs="$(MSBuildAllProjects)"
Outputs="$(TargetDir)$(PackageConflictManifestFileName)">
<ItemGroup>
<_AspNetCoreAppPackageOverrides Include="@(ReferencePath->'%(NuGetPackageId)|%(NuGetPackageVersion)')" Condition=" '%(ReferencePath.NuGetPackageId)' != 'Microsoft.NETCore.App' AND '%(ReferencePath.NuGetSourceType)' == 'Package' " />
<_AspNetCoreAppPackageOverrides Include="@(ReferencePath->'%(FileName)|$(SharedFxVersion)')" Condition=" '%(ReferencePath.ReferenceSourceTarget)' == 'ProjectReference' " />
<_AspNetCoreAppPackageOverrides Include="@(ReferencePath->'%(FileName)|$(ReferencePackSharedFxVersion)')" Condition=" '%(ReferencePath.ReferenceSourceTarget)' == 'ProjectReference' AND '%(ReferencePath.IsReferenceAssembly)' == 'true' " />
</ItemGroup>
<WriteLinesToFile

View File

@ -53,6 +53,13 @@
</ItemGroup>
<Target Name="GenerateTestData" BeforeTargets="GetAssemblyAttributes" DependsOnTargets="InitializeSourceControlInformation">
<!-- Use the ref pack logic to compute the list of expected targeting pack content -->
<MSBuild Projects="$(RepoRoot)src\Framework\ref\Microsoft.AspNetCore.App.Ref.csproj"
Targets="_ResolveTargetingPackContent"
SkipNonexistentProjects="false">
<Output TaskParameter="TargetOutputs" ItemName="_TargetingPackDependencies" />
</MSBuild>
<!-- This target is defined in eng/targets/Packaging.targets and included in every C# and F# project. -->
<MSBuild Projects="$(RepoRoot)src\Framework\src\Microsoft.AspNetCore.App.Runtime.csproj"
Targets="_GetPackageVersionInfo"
@ -68,6 +75,11 @@
</MSBuild>
<ItemGroup>
<AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
<_Parameter1>TargetingPackDependencies</_Parameter1>
<_Parameter2>@(_TargetingPackDependencies)</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
<_Parameter1>RepositoryCommit</_Parameter1>
<_Parameter2>$(SourceRevisionId)</_Parameter2>

View File

@ -28,7 +28,7 @@ namespace Microsoft.AspNetCore
_targetingPackRoot = Path.Combine(TestData.GetTestDataValue("TargetingPackLayoutRoot"), "packs", "Microsoft.AspNetCore.App.Ref", TestData.GetTestDataValue("TargetingPackVersion"));
}
[Fact]
[Fact(Skip="https://github.com/aspnet/AspNetCore/issues/14832")]
public void AssembliesAreReferenceAssemblies()
{
IEnumerable<string> dlls = Directory.GetFiles(_targetingPackRoot, "*.dll", SearchOption.AllDirectories);
@ -55,12 +55,19 @@ namespace Microsoft.AspNetCore
});
}
[Fact]
[Fact(Skip="https://github.com/aspnet/AspNetCore/issues/14832")]
public void PlatformManifestListsAllFiles()
{
var platformManifestPath = Path.Combine(_targetingPackRoot, "data", "PlatformManifest.txt");
var expectedAssemblies = TestData.GetSharedFxDependencies()
var expectedAssemblies = TestData.GetTargetingPackDependencies()
.Split(';', StringSplitOptions.RemoveEmptyEntries)
.Select(i =>
{
var fileName = Path.GetFileName(i);
return fileName.EndsWith(".dll", StringComparison.Ordinal)
? fileName.Substring(0, fileName.Length - 4)
: fileName;
})
.ToHashSet();
_output.WriteLine("==== file contents ====");

View File

@ -18,6 +18,8 @@ namespace Microsoft.AspNetCore
public static string GetSharedFxDependencies() => GetTestDataValue("SharedFxDependencies");
public static string GetTargetingPackDependencies() => GetTestDataValue("TargetingPackDependencies");
public static string GetTestDataValue(string key)
=> typeof(TestData).Assembly.GetCustomAttributes<TestDataAttribute>().Single(d => d.Key == key).Value;
}

View File

@ -0,0 +1,13 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Runtime.CompilerServices;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
[assembly: TypeForwardedTo(typeof(IEndpointFeature))]
[assembly: TypeForwardedTo(typeof(IRouteValuesFeature))]
[assembly: TypeForwardedTo(typeof(Endpoint))]
[assembly: TypeForwardedTo(typeof(EndpointMetadataCollection))]
[assembly: TypeForwardedTo(typeof(RouteValueDictionary))]

View File

@ -5,6 +5,7 @@
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
<Compile Include="Microsoft.AspNetCore.Routing.Abstractions.netcoreapp.cs" />
<Compile Include="Microsoft.AspNetCore.Routing.Abstractions.Manual.cs" />
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />
</ItemGroup>
</Project>

View File

@ -23,7 +23,7 @@
<Target Name="Build" DependsOnTargets="DebBuild" />
<Target Name="Pack" />
<Target Name="DebBuild" DependsOnTargets="$(DebBuildDependsOn)">
<Target Name="DebBuild" DependsOnTargets="$(DebBuildDependsOn)" Condition="'$(IsTargetingPackBuilding)' != 'false'">
<!-- Generate debian_config.json. We can't simply use WriteLinesToFile because of https://github.com/Microsoft/msbuild/issues/1622. Use our custom GenerateFileFromTemplate task instead -->
<PropertyGroup>
<DebianConfigProperties>

View File

@ -32,7 +32,7 @@
<Target Name="Build" DependsOnTargets="RpmBuild" />
<Target Name="Pack" />
<Target Name="RpmBuild" DependsOnTargets="$(RpmBuildDependsOn)">
<Target Name="RpmBuild" DependsOnTargets="$(RpmBuildDependsOn)" Condition="'$(IsTargetingPackBuilding)' != 'false'">
<!-- Create layout: Create changelog -->
<PropertyGroup>
<ChangeLogProps>DATE=$([System.DateTime]::UtcNow.ToString(ddd MMM dd yyyy))</ChangeLogProps>

View File

@ -11,7 +11,8 @@ param(
[Parameter(Mandatory=$true)][string]$PackageVersion,
[Parameter(Mandatory=$true)][string]$RepoRoot,
[Parameter(Mandatory=$true)][string]$MajorVersion,
[Parameter(Mandatory=$true)][string]$MinorVersion
[Parameter(Mandatory=$true)][string]$MinorVersion,
[Parameter(Mandatory=$true)][string]$PackageIconPath
)
$NuGetDir = Join-Path $RepoRoot "artifacts\Tools\nuget\$Name\$Architecture"
@ -24,8 +25,8 @@ if (-not (Test-Path $NuGetDir)) {
if (-not (Test-Path $NuGetExe)) {
# Using 3.5.0 to workaround https://github.com/NuGet/Home/issues/5016
Write-Output "Downloading nuget.exe to $NuGetExe"
wget https://dist.nuget.org/win-x86-commandline/v3.5.0/nuget.exe -OutFile $NuGetExe
wget https://dist.nuget.org/win-x86-commandline/v5.3.0/nuget.exe -OutFile $NuGetExe
}
& $NuGetExe pack $NuspecFile -Version $PackageVersion -OutputDirectory $OutputDirectory -NoDefaultExcludes -NoPackageAnalysis -Properties ASPNETCORE_RUNTIME_MSI=$MsiPath`;ASPNETCORE_CAB_FILE=$CabPath`;ARCH=$Architecture`;MAJOR=$MajorVersion`;MINOR=$MinorVersion`;
& $NuGetExe pack $NuspecFile -Version $PackageVersion -OutputDirectory $OutputDirectory -NoDefaultExcludes -NoPackageAnalysis -Properties ASPNETCORE_RUNTIME_MSI=$MsiPath`;ASPNETCORE_CAB_FILE=$CabPath`;ARCH=$Architecture`;MAJOR=$MajorVersion`;MINOR=$MinorVersion`;PACKAGE_ICON_PATH=$PackageIconPath`;
Exit $LastExitCode

View File

@ -24,6 +24,10 @@
<ToolsetInstallerNuspecFile>$(RepoRoot)\src\Installers\Windows\SharedFramework\SharedFrameworkPackage.nuspec</ToolsetInstallerNuspecFile>
</PropertyGroup>
<ItemGroup>
<NuspecProperty Include="PackageIcon=$(PackageIconFullPath)" />
</ItemGroup>
<ItemGroup>
<WixExtension Include="WixDependencyExtension">
<HintPath>$(WixExtDir)\WixDependencyExtension.dll</HintPath>
@ -101,6 +105,7 @@
'$(_GeneratedPackageVersion)' ^
'$(RepoRoot)' ^
'$(AspNetCoreMajorVersion)' ^
'$(AspNetCoreMinorVersion)'" />
'$(AspNetCoreMinorVersion)' ^
'$(PackageIconFullPath)'" />
</Target>
</Project>

View File

@ -8,6 +8,7 @@
<owners>Microsoft</owners>
<licenseUrl>https://www.microsoft.com/net/dotnet_library_license.htm</licenseUrl>
<projectUrl>https://github.com/aspnet/aspnetcore</projectUrl>
<icon>packageIcon.png</icon>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>$MAJOR$.$MINOR$ ASP.NET Core TargetingPack ($ARCH$) Windows Installer MSI as a .nupkg for internal Visual Studio build consumption</description>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
@ -15,5 +16,6 @@
<files>
<file src="$ASPNETCORE_RUNTIME_MSI$" />
<file src="$ASPNETCORE_CAB_FILE$" />
<file src="$PACKAGE_ICON_PATH$" target="" />
</files>
</package>

View File

@ -9,6 +9,7 @@
<OutputName>$(Name)-$(Platform)</OutputName>
<OutputType>Package</OutputType>
<IsShipping>true</IsShipping>
<SkipCopyToArtifactsDirectory Condition="'$(IsTargetingPackBuilding)' == 'false'">true</SkipCopyToArtifactsDirectory>
<ProjectGuid>0AC34F1B-8056-4FFB-A398-E6BB7D67B48D</ProjectGuid>
<HarvestDirectoryAutoGenerateGuids>true</HarvestDirectoryAutoGenerateGuids>
<HarvestDirectorySuppressSpecificWarnings>5150;5151</HarvestDirectorySuppressSpecificWarnings>
@ -22,6 +23,10 @@
<ToolsetInstallerNuspecFile>$(RepoRoot)\src\Installers\Windows\TargetingPack\TargetingPackPackage.nuspec</ToolsetInstallerNuspecFile>
</PropertyGroup>
<ItemGroup>
<NuspecProperty Include="PackageIcon=$(PackageIconFullPath)" />
</ItemGroup>
<ItemGroup>
<WixExtension Include="WixDependencyExtension">
<HintPath>$(WixExtDir)\WixDependencyExtension.dll</HintPath>
@ -97,6 +102,7 @@
'$(_GeneratedPackageVersion)' ^
'$(RepoRoot)' ^
'$(AspNetCoreMajorVersion)' ^
'$(AspNetCoreMinorVersion)'" />
'$(AspNetCoreMinorVersion)' ^
'$(PackageIconFullPath)'" />
</Target>
</Project>

View File

@ -8,11 +8,13 @@
<owners>Microsoft</owners>
<licenseUrl>https://www.microsoft.com/net/dotnet_library_license.htm</licenseUrl>
<projectUrl>https://github.com/aspnet/aspnetcore</projectUrl>
<icon>packageIcon.png</icon>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>$MAJOR$.$MINOR$ ASP.NET Core TargetingPack ($ARCH$) Windows Installer MSI as a .nupkg for internal Visual Studio build consumption</description>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
</metadata>
<files>
<file src="$ASPNETCORE_RUNTIME_MSI$" />
<file src="$PACKAGE_ICON_PATH$" target="" />
</files>
</package>

View File

@ -63,7 +63,7 @@
</Target>
<Target Name="CopyToArtifactsDirectory"
Condition=" '$(IsShipping)' == 'true' "
Condition=" '$(IsShipping)' == 'true' AND '$(SkipCopyToArtifactsDirectory)' != 'true' "
AfterTargets="Build">
<Copy SourceFiles="$(TargetPath)" DestinationFiles="$(InstallersOutputPath)$(PackageFileName)" />
<ItemGroup>

View File

@ -19,6 +19,7 @@
<ItemGroup>
<NuspecProperty Include="OutputBinary=$(OutputPath)$(AssemblyName).dll" />
<NuspecProperty Include="OutputSymbol=$(OutputPath)$(AssemblyName).pdb" />
<NuspecProperty Include="PackageIcon=$(PackageIconFullPath)" />
</ItemGroup>
</Project>

View File

@ -2,10 +2,12 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
$CommonMetadataElements$
<icon>packageIcon.png</icon>
</metadata>
<files>
<file src="$OutputBinary$" target="analyzers\dotnet\cs\" />
<file src="$OutputSymbol$" target="analyzers\dotnet\cs\" />
<file src="$PackageIcon$" target="" />
</files>
</package>

View File

@ -24,6 +24,7 @@
<ItemGroup>
<NuspecProperty Include="OutputBinary=$(OutputPath)$(AssemblyName).dll" />
<NuspecProperty Include="OutputSymbol=$(OutputPath)$(AssemblyName).pdb" />
<NuspecProperty Include="PackageIcon=$(PackageIconFullPath)" />
</ItemGroup>
</Project>

View File

@ -2,10 +2,12 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
$CommonMetadataElements$
<icon>packageIcon.png</icon>
</metadata>
<files>
<file src="$OutputBinary$" target="analyzers\dotnet\cs\" />
<file src="$OutputSymbol$" target="analyzers\dotnet\cs\" />
<file src="$PackageIcon$" target="" />
</files>
</package>

View File

@ -0,0 +1,13 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Runtime.CompilerServices;
[assembly: TypeForwardedTo(typeof(Microsoft.AspNetCore.Mvc.ApiExplorer.IApiDescriptionProvider))]
[assembly: TypeForwardedTo(typeof(Microsoft.AspNetCore.Mvc.ApiExplorer.ApiDescription))]
[assembly: TypeForwardedTo(typeof(Microsoft.AspNetCore.Mvc.ApiExplorer.ApiDescriptionProviderContext))]
[assembly: TypeForwardedTo(typeof(Microsoft.AspNetCore.Mvc.ApiExplorer.ApiParameterDescription))]
[assembly: TypeForwardedTo(typeof(Microsoft.AspNetCore.Mvc.ApiExplorer.ApiParameterRouteInfo))]
[assembly: TypeForwardedTo(typeof(Microsoft.AspNetCore.Mvc.ApiExplorer.ApiRequestFormat))]
[assembly: TypeForwardedTo(typeof(Microsoft.AspNetCore.Mvc.ApiExplorer.ApiResponseFormat))]
[assembly: TypeForwardedTo(typeof(Microsoft.AspNetCore.Mvc.ApiExplorer.ApiResponseType))]

View File

@ -5,6 +5,7 @@
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
<Compile Include="Microsoft.AspNetCore.Mvc.ApiExplorer.netcoreapp.cs" />
<Compile Include="Microsoft.AspNetCore.Mvc.ApiExplorer.Manual.cs" />
<Reference Include="Microsoft.AspNetCore.Mvc.Core" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Runtime.CompilerServices;
using Microsoft.AspNetCore.Mvc.Formatters;
[assembly: TypeForwardedTo(typeof(InputFormatterException))]

View File

@ -5,6 +5,7 @@
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
<Compile Include="Microsoft.AspNetCore.Mvc.Core.netcoreapp.cs" />
<Compile Include="Microsoft.AspNetCore.Mvc.Core.Manual.cs" />
<Reference Include="Microsoft.AspNetCore.Mvc.Abstractions" />
<Reference Include="Microsoft.AspNetCore.Authentication.Core" />
<Reference Include="Microsoft.AspNetCore.Authorization.Policy" />

View File

@ -0,0 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Runtime.CompilerServices;
using Microsoft.AspNetCore.Mvc;
[assembly: TypeForwardedTo(typeof(JsonResult))]

View File

@ -5,6 +5,7 @@
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
<Compile Include="Microsoft.AspNetCore.Mvc.Formatters.Json.netcoreapp.cs" />
<Compile Include="Microsoft.AspNetCore.Mvc.Formatters.Json.Manual.cs" />
<Reference Include="Microsoft.AspNetCore.Mvc.Core" />
</ItemGroup>
</Project>

View File

@ -21,4 +21,8 @@
<None Include="content/**" />
</ItemGroup>
<ItemGroup>
<NuspecProperty Include="PackageIcon=$(PackageIconFullPath)" />
</ItemGroup>
</Project>

View File

@ -5,11 +5,13 @@
<packageTypes>
<packageType name="Template" />
</packageTypes>
<icon>packageIcon.png</icon>
</metadata>
<files>
<file
src="content/**"
exclude="**/node_modules/**;**/bin/**;**/obj/**;**/.vs/**;**/.vscode/**;**/ClientApp/dist/**;**/wwwroot/dist/**;content/Directory.Build.*"
target="" />
<file src="$PackageIcon$" target="" />
</files>
</package>

View File

@ -4,12 +4,20 @@
DependsOnTargets="PrepareForTest"
Condition="$(DesignTimeBuild) != true">
<!-- The version of the shared framework. This is used in tests to ensure they run against the shared framework version we just built. -->
<!-- If we aren' building the targeting pack, use the baseline version -->
<MSBuild Projects="$(RepoRoot)src\Framework\ref\Microsoft.AspNetCore.App.Ref.csproj"
Targets="_GetPackageVersionInfo"
SkipNonexistentProjects="false">
SkipNonexistentProjects="false"
Condition="'$(IsTargetingPackBuilding)' != 'false'">
<Output TaskParameter="TargetOutputs" ItemName="_TargetingPackVersionInfo" />
</MSBuild>
<!-- Targeting pack version should be the one we just built, if we're building it. Otherwise we use the baseline version -->
<PropertyGroup>
<MicrosoftAspNetCoreAppRefPackageVersion Condition="'$(IsTargetingPackBuilding)' != 'false'">@(TargetingPackVersionInfo.PackageVersion)</MicrosoftAspNetCoreAppRefPackageVersion>
<MicrosoftAspNetCoreAppRefPackageVersion Condition="'$(IsTargetingPackBuilding)' == 'false'">$(AspNetCoreBaselineVersion)</MicrosoftAspNetCoreAppRefPackageVersion>
</PropertyGroup>
<!-- Runtime and Ref packs may have separate versions. -->
<MSBuild Projects="$(RepoRoot)src\Framework\src\Microsoft.AspNetCore.App.Runtime.csproj"
Targets="_GetPackageVersionInfo"
@ -25,7 +33,7 @@
MicrosoftNETCoreAppRefPackageVersion=$(MicrosoftNETCoreAppRefPackageVersion);
MicrosoftNETCorePlatformsPackageVersion=$(MicrosoftNETCorePlatformsPackageVersion);
MicrosoftNETSdkRazorPackageVersion=$(MicrosoftNETSdkRazorPackageVersion);
MicrosoftAspNetCoreAppRefPackageVersion=@(_TargetingPackVersionInfo->'%(PackageVersion)');
MicrosoftAspNetCoreAppRefPackageVersion=$(MicrosoftAspNetCoreAppRefPackageVersion);
MicrosoftAspNetCoreAppRuntimePackageVersion=@(_RuntimePackageVersionInfo->'%(PackageVersion)');
SupportedRuntimeIdentifiers=$(SupportedRuntimeIdentifiers);
DefaultNetCoreTargetFramework=$(DefaultNetCoreTargetFramework);

View File

@ -0,0 +1,23 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Runtime.CompilerServices;
using Microsoft.AspNetCore.Razor.TagHelpers;
[assembly: TypeForwardedTo(typeof(DefaultTagHelperContent))]
[assembly: TypeForwardedTo(typeof(HtmlAttributeNameAttribute))]
[assembly: TypeForwardedTo(typeof(HtmlAttributeNotBoundAttribute))]
[assembly: TypeForwardedTo(typeof(HtmlTargetElementAttribute))]
[assembly: TypeForwardedTo(typeof(ITagHelper))]
[assembly: TypeForwardedTo(typeof(ITagHelperComponent))]
[assembly: TypeForwardedTo(typeof(NullHtmlEncoder))]
[assembly: TypeForwardedTo(typeof(OutputElementHintAttribute))]
[assembly: TypeForwardedTo(typeof(ReadOnlyTagHelperAttributeList))]
[assembly: TypeForwardedTo(typeof(RestrictChildrenAttribute))]
[assembly: TypeForwardedTo(typeof(TagHelper))]
[assembly: TypeForwardedTo(typeof(TagHelperAttribute))]
[assembly: TypeForwardedTo(typeof(TagHelperAttributeList))]
[assembly: TypeForwardedTo(typeof(TagHelperComponent))]
[assembly: TypeForwardedTo(typeof(TagHelperContent))]
[assembly: TypeForwardedTo(typeof(TagHelperContext))]
[assembly: TypeForwardedTo(typeof(TagHelperOutput))]

View File

@ -5,6 +5,7 @@
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
<Compile Include="Microsoft.AspNetCore.Razor.Runtime.netcoreapp.cs" />
<Compile Include="Microsoft.AspNetCore.Razor.Runtime.Manual.cs" />
<Reference Include="Microsoft.AspNetCore.Razor" />
<Reference Include="Microsoft.AspNetCore.Html.Abstractions" />
</ItemGroup>

View File

@ -16,6 +16,7 @@
<Reference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" />
<Reference Include="Microsoft.AspNetCore.CookiePolicy" />
<Reference Include="Microsoft.Extensions.FileProviders.Embedded" />
<Reference Include="Microsoft.Net.Http.Headers" />
</ItemGroup>
<ItemGroup>

View File

@ -30,6 +30,7 @@ namespace OpenIdConnectSample
}
public IConfiguration Configuration { get; set; }
public IWebHostEnvironment Environment { get; }
private void CheckSameSite(HttpContext httpContext, CookieOptions options)

View File

@ -15,6 +15,7 @@
<Reference Include="Microsoft.Extensions.FileProviders.Embedded" />
<Reference Include="Microsoft.Extensions.Logging.Console" />
<Reference Include="Microsoft.Extensions.Logging.Debug" />
<Reference Include="Microsoft.Net.Http.Headers" />
</ItemGroup>
<ItemGroup>

View File

@ -22,6 +22,8 @@
<Reference Include="Microsoft.AspNetCore.Authentication.MicrosoftAccount" />
<Reference Include="Microsoft.AspNetCore.Authentication.Twitter" />
<Reference Include="Microsoft.Extensions.FileProviders.Embedded" />
<Reference Include="Microsoft.Extensions.Logging.Console" />
<Reference Include="Microsoft.Net.Http.Headers" />
</ItemGroup>
</Project>

View File

@ -49,6 +49,7 @@
<Reference Include="Microsoft.AspNetCore.Authentication.WsFederation" />
<Reference Include="Microsoft.AspNetCore.HttpOverrides" />
<Reference Include="Microsoft.AspNetCore.TestHost" />
<Reference Include="Microsoft.Net.Http.Headers" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,10 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Runtime.CompilerServices;
using Microsoft.AspNetCore.Authorization;
// Microsoft.AspNetCore.Metadata
[assembly: TypeForwardedTo(typeof(IAuthorizeData))]
[assembly: TypeForwardedTo(typeof(IAllowAnonymous))]

View File

@ -5,12 +5,14 @@
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<Compile Include="Microsoft.AspNetCore.Authorization.netstandard2.0.cs" />
<Compile Include="Microsoft.AspNetCore.Authorization.Manual.cs" />
<Reference Include="Microsoft.AspNetCore.Metadata" />
<Reference Include="Microsoft.Extensions.Logging.Abstractions" />
<Reference Include="Microsoft.Extensions.Options" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
<Compile Include="Microsoft.AspNetCore.Authorization.netcoreapp.cs" />
<Compile Include="Microsoft.AspNetCore.Authorization.Manual.cs" />
<Reference Include="Microsoft.AspNetCore.Metadata" />
<Reference Include="Microsoft.Extensions.Logging.Abstractions" />
<Reference Include="Microsoft.Extensions.Options" />

View File

@ -242,11 +242,13 @@ namespace Microsoft.AspNetCore.CookiePolicy
default:
throw new InvalidOperationException();
}
if (options.SameSite < Options.MinimumSameSitePolicy)
{
options.SameSite = Options.MinimumSameSitePolicy;
_logger.CookieSameSiteUpgraded(key, Options.MinimumSameSitePolicy.ToString());
}
switch (Options.HttpOnly)
{
case HttpOnlyPolicy.Always:

View File

@ -43,6 +43,7 @@ namespace Microsoft.AspNetCore.CookiePolicy.Test
context.Response.Cookies.Append("C", "C", new CookieOptions { SameSite = Http.SameSiteMode.None });
context.Response.Cookies.Append("D", "D", new CookieOptions { SameSite = Http.SameSiteMode.Lax });
context.Response.Cookies.Append("E", "E", new CookieOptions { SameSite = Http.SameSiteMode.Strict });
context.Response.Cookies.Append("F", "F", new CookieOptions { SameSite = (Http.SameSiteMode)(-1) });
return Task.FromResult(0);
};
@ -236,6 +237,7 @@ namespace Microsoft.AspNetCore.CookiePolicy.Test
Assert.Equal("C=C; path=/; samesite=none", transaction.SetCookie[2]);
Assert.Equal("D=D; path=/; samesite=lax", transaction.SetCookie[3]);
Assert.Equal("E=E; path=/; samesite=strict", transaction.SetCookie[4]);
Assert.Equal("F=F; path=/", transaction.SetCookie[5]);
}));
}

View File

@ -13,6 +13,7 @@
<Reference Include="Microsoft.AspNetCore.CookiePolicy" />
<Reference Include="Microsoft.AspNetCore.TestHost" />
<Reference Include="Microsoft.Extensions.DependencyInjection" />
<Reference Include="Microsoft.Net.Http.Headers" />
</ItemGroup>
</Project>

View File

@ -164,6 +164,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Server
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Server.HttpSys", "..\Servers\HttpSys\src\Microsoft.AspNetCore.Server.HttpSys.csproj", "{D6C3C4A9-197B-47B5-8B72-35047CBC4F22}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Net.Http.Headers", "..\Http\Headers\src\Microsoft.Net.Http.Headers.csproj", "{4BB8D7D7-E111-4A86-B6E5-C1201E0DA8CE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU

View File

@ -0,0 +1,8 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Runtime.CompilerServices;
using Microsoft.AspNetCore.Http.Features;
[assembly: TypeForwardedTo(typeof(IServerVariablesFeature))]

View File

@ -5,6 +5,7 @@
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
<Compile Include="Microsoft.AspNetCore.Server.IIS.netcoreapp.cs" />
<Compile Include="Microsoft.AspNetCore.Server.IIS.Manual.cs" />
<Reference Include="Microsoft.AspNetCore.Authentication.Core" />
<Reference Include="Microsoft.AspNetCore.Connections.Abstractions" />
<Reference Include="Microsoft.AspNetCore.Hosting.Abstractions" />

View File

@ -49,6 +49,7 @@ export class WebSocketTransport implements ITransport {
url = url.replace(/^http/, "ws");
let webSocket: WebSocket | undefined;
const cookies = this.httpClient.getCookieString(url);
let opened = false;
if (Platform.isNode && cookies) {
// Only pass cookies when in non-browser environments
@ -72,6 +73,7 @@ export class WebSocketTransport implements ITransport {
webSocket.onopen = (_event: Event) => {
this.logger.log(LogLevel.Information, `WebSocket connected to ${url}.`);
this.webSocket = webSocket;
opened = true;
resolve();
};
@ -94,7 +96,23 @@ export class WebSocketTransport implements ITransport {
}
};
webSocket.onclose = (event: CloseEvent) => this.close(event);
webSocket.onclose = (event: CloseEvent) => {
// Don't call close handler if connection was never established
// We'll reject the connect call instead
if (opened) {
this.close(event);
} else {
let error: any = null;
// ErrorEvent is a browser only type we need to check if the type exists before using it
if (typeof ErrorEvent !== "undefined" && event instanceof ErrorEvent) {
error = event.error;
} else {
error = new Error("There was an error with the transport.");
}
reject(error);
}
};
});
}

View File

@ -45,6 +45,27 @@ describe("ServerSentEventsTransport", () => {
});
});
it("connect failure does not call onclose handler", async () => {
await VerifyLogger.run(async (logger) => {
const sse = new ServerSentEventsTransport(new TestHttpClient(), undefined, logger, true, TestEventSource);
let closeCalled = false;
sse.onclose = () => closeCalled = true;
const connectPromise = (async () => {
await sse.connect("http://example.com", TransferFormat.Text);
})();
await TestEventSource.eventSource.openSet;
TestEventSource.eventSource.onerror(new TestMessageEvent());
await expect(connectPromise)
.rejects
.toEqual(new Error("Error occurred"));
expect(closeCalled).toBe(false);
});
});
[["http://example.com", "http://example.com?access_token=secretToken"],
["http://example.com?value=null", "http://example.com?value=null&access_token=secretToken"]]
.forEach(([input, expected]) => {

View File

@ -66,6 +66,33 @@ describe("WebSocketTransport", () => {
});
});
it("connect failure does not call onclose handler", async () => {
await VerifyLogger.run(async (logger) => {
(global as any).ErrorEvent = TestErrorEvent;
const webSocket = new WebSocketTransport(new TestHttpClient(), undefined, logger, true, TestWebSocket);
let closeCalled = false;
webSocket.onclose = () => closeCalled = true;
let connectComplete: boolean = false;
const connectPromise = (async () => {
await webSocket.connect("http://example.com", TransferFormat.Text);
connectComplete = true;
})();
await TestWebSocket.webSocket.closeSet;
expect(connectComplete).toBe(false);
TestWebSocket.webSocket.onclose(new TestEvent());
await expect(connectPromise)
.rejects
.toThrow("There was an error with the transport.");
expect(connectComplete).toBe(false);
expect(closeCalled).toBe(false);
});
});
[["http://example.com", "ws://example.com?access_token=secretToken"],
["http://example.com?value=null", "ws://example.com?value=null&access_token=secretToken"],
["https://example.com?value=null", "wss://example.com?value=null&access_token=secretToken"]]

View File

@ -21,5 +21,6 @@
<ItemGroup>
<NuspecProperty Include="baseOutputPath=$(BaseOutputPath)" />
<NuspecProperty Include="configuration=$(Configuration)" />
<NuspecProperty Include="PackageIcon=$(PackageIconFullPath)" />
</ItemGroup>
</Project>

View File

@ -2,11 +2,13 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.8">
$CommonMetadataElements$
<icon>packageIcon.png</icon>
</metadata>
<files>
<file src="build\*" target="build" />
<file src="buildMultiTargeting\*" target="buildMultiTargeting" />
<file src="$baseOutputPath$\$configuration$\netstandard2.0\Microsoft.Extensions.ApiDescription.Client.*" target="tasks\netstandard2.0" />
<file src="$PackageIcon$" target="" />
</files>
</package>

View File

@ -30,6 +30,7 @@
<ItemGroup>
<NuspecProperty Include="artifactsBinDir=$(ArtifactsBinDir)" />
<NuspecProperty Include="configuration=$(Configuration)" />
<NuspecProperty Include="PackageIcon=$(PackageIconFullPath)" />
</ItemGroup>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />

View File

@ -2,6 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.8">
$CommonMetadataElements$
<icon>packageIcon.png</icon>
</metadata>
<files>
@ -11,5 +12,6 @@
<file src="$artifactsBinDir$\GetDocumentInsider\$configuration$\net461\*.*" target="tools\net461" />
<file src="$artifactsBinDir$\GetDocumentInsider\x86\$configuration$\net461\*.*" target="tools\net461-x86" />
<file src="$artifactsBinDir$\GetDocumentInsider\$configuration$\netcoreapp2.1\publish\*.*" target="tools\netcoreapp2.1" />
<file src="$PackageIcon$" target="" />
</files>
</package>