update MSBuild settings to make samples runnable (#180)

This commit is contained in:
Andrew Stanton-Nurse 2017-02-07 09:39:21 -08:00 committed by GitHub
parent 2fff96311b
commit b711128ec2
10 changed files with 44 additions and 22 deletions

View File

@ -1,4 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\build\common.props" />
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework> <TargetFramework>netcoreapp1.1</TargetFramework>
@ -6,6 +8,10 @@
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<UserSecretsId>aspnet-ChatSample-f11cf018-e0a8-49fa-b749-4c0eb5c9150b</UserSecretsId> <UserSecretsId>aspnet-ChatSample-f11cf018-e0a8-49fa-b749-4c0eb5c9150b</UserSecretsId>
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8</PackageTargetFallback> <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8</PackageTargetFallback>
<RuntimeFrameworkVersion>1.2.0-*</RuntimeFrameworkVersion>
<!-- We don't want dotnet pack to try packing a sample -->
<IsPackable>false</IsPackable>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -21,10 +27,10 @@
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.2.0-*" /> <PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.2.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.2.0-*" /> <PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.2.0-*" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.2.0-*" /> <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.2.0-*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="1.2.0-*" PrivateAssets="All"/> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="1.2.0-*" PrivateAssets="All" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.2.0-*" PrivateAssets="All"/> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.2.0-*" PrivateAssets="All" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.2.0-*" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.2.0-*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="1.0.0-msbuild3-final" PrivateAssets="All"/> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="1.0.0-msbuild3-final" PrivateAssets="All" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.2.0-*" /> <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.2.0-*" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.2.0-*" /> <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.2.0-*" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="1.2.0-*" /> <PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="1.2.0-*" />
@ -34,8 +40,7 @@
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="1.2.0-*" /> <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="1.2.0-*" />
</ItemGroup> </ItemGroup>
<Target Name="BuildTSClient" <Target Name="BuildTSClient" BeforeTargets="BeforeBuild">
BeforeTargets="BeforeBuild">
<Exec Command="dotnet bundle" /> <Exec Command="dotnet bundle" />
<Exec Command="npm install" /> <Exec Command="npm install" />
<Exec Command="npm run gulp -- --gulpfile $(MSBuildProjectDirectory)/../../src/Microsoft.AspNetCore.SignalR.Client.TS/gulpfile.js bundle-client --bundleOutDir $(MSBuildProjectDirectory)/wwwroot/lib/signalr-client/" /> <Exec Command="npm run gulp -- --gulpfile $(MSBuildProjectDirectory)/../../src/Microsoft.AspNetCore.SignalR.Client.TS/gulpfile.js bundle-client --bundleOutDir $(MSBuildProjectDirectory)/wwwroot/lib/signalr-client/" />

View File

@ -1,8 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\build\common.props" />
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework> <TargetFramework>netcoreapp1.1</TargetFramework>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<RuntimeFrameworkVersion>1.2.0-*</RuntimeFrameworkVersion>
<!-- We don't want dotnet pack to try packing a sample -->
<IsPackable>false</IsPackable>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -1,9 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\build\common.props" />
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework> <TargetFramework>netcoreapp1.1</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext> <PreserveCompilationContext>true</PreserveCompilationContext>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<RuntimeFrameworkVersion>1.2.0-*</RuntimeFrameworkVersion>
<!-- We don't want dotnet pack to try packing a sample -->
<IsPackable>false</IsPackable>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -35,7 +35,7 @@ namespace SocialWeather
} }
app.UseSockets(o => { o.MapEndpoint<SocialWeatherEndPoint>("/weather"); }); app.UseSockets(o => { o.MapEndpoint<SocialWeatherEndPoint>("/weather"); });
app.UseStaticFiles(); app.UseFileServer();
var formatterResolver = app.ApplicationServices.GetRequiredService<FormatterResolver>(); var formatterResolver = app.ApplicationServices.GetRequiredService<FormatterResolver>();
formatterResolver.AddFormatter<WeatherReport, JsonStreamFormatter<WeatherReport>>("json"); formatterResolver.AddFormatter<WeatherReport, JsonStreamFormatter<WeatherReport>>("json");

View File

@ -1,4 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\build\common.props" />
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netcoreapp1.1;net46</TargetFrameworks> <TargetFrameworks>netcoreapp1.1;net46</TargetFrameworks>
@ -7,6 +9,10 @@
<PreserveCompilationContext>true</PreserveCompilationContext> <PreserveCompilationContext>true</PreserveCompilationContext>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">$(PackageTargetFallback);portable-net45+win8+wp8+wpa81</PackageTargetFallback> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">$(PackageTargetFallback);portable-net45+win8+wp8+wpa81</PackageTargetFallback>
<RuntimeFrameworkVersion>1.2.0-*</RuntimeFrameworkVersion>
<!-- We don't want dotnet pack to try packing a sample -->
<IsPackable>false</IsPackable>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -20,9 +26,7 @@
<PackageReference Include="Google.Protobuf" Version="3.1.0" /> <PackageReference Include="Google.Protobuf" Version="3.1.0" />
</ItemGroup> </ItemGroup>
<Target Name="BuildTSClient" <Target Name="BuildTSClient" BeforeTargets="BeforeBuild" Condition=" '$(TargetFramework)' == '' ">
BeforeTargets="BeforeBuild"
Condition=" '$(TargetFramework)' == '' ">
<Exec Command="npm install" /> <Exec Command="npm install" />
<Exec Command="npm run gulp -- --gulpfile $(MSBuildProjectDirectory)/../../src/Microsoft.AspNetCore.SignalR.Client.TS/gulpfile.js bundle-client --bundleOutDir $(MSBuildProjectDirectory)/wwwroot/lib/signalr-client/" /> <Exec Command="npm run gulp -- --gulpfile $(MSBuildProjectDirectory)/../../src/Microsoft.AspNetCore.SignalR.Client.TS/gulpfile.js bundle-client --bundleOutDir $(MSBuildProjectDirectory)/wwwroot/lib/signalr-client/" />
</Target> </Target>

View File

@ -3,6 +3,9 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework> <TargetFramework>netcoreapp1.1</TargetFramework>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<!-- We don't want dotnet pack to try packing a sample -->
<IsPackable>false</IsPackable>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -1,14 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\build\common.props" /> <Import Project="..\..\build\common.props" />
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netcoreapp1.1;net46</TargetFrameworks> <TargetFrameworks>netcoreapp1.1;net46</TargetFrameworks>
<!-- TODO remove when https://github.com/Microsoft/vstest/issues/428 is resolved -->
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<!-- TODO remove when https://github.com/dotnet/sdk/issues/396 is resolved --> <!-- TODO remove when https://github.com/dotnet/sdk/issues/396 is resolved -->
<RuntimeIdentifier Condition=" '$(TargetFramework)' != 'netcoreapp1.1' ">win7-x64</RuntimeIdentifier> <RuntimeIdentifier Condition=" '$(TargetFramework)' != 'netcoreapp1.1' ">win7-x64</RuntimeIdentifier>
<RuntimeFrameworkVersion>1.2.0-*</RuntimeFrameworkVersion>
<PreserveCompilationContext>true</PreserveCompilationContext> <PreserveCompilationContext>true</PreserveCompilationContext>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
</PropertyGroup> </PropertyGroup>
@ -22,9 +21,7 @@
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.2.0-*" /> <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.2.0-*" />
</ItemGroup> </ItemGroup>
<Target Name="BuildTSClient" <Target Name="BuildTSClient" BeforeTargets="BeforeBuild">
BeforeTargets="BeforeBuild"
Condition=" '$(TargetFramework)' == '' ">
<Exec Command="npm install" /> <Exec Command="npm install" />
<Exec Command="npm run gulp -- --gulpfile $(MSBuildProjectDirectory)/gulpfile.js copy-jasmine" /> <Exec Command="npm run gulp -- --gulpfile $(MSBuildProjectDirectory)/gulpfile.js copy-jasmine" />
<Exec Command="npm run gulp -- --gulpfile $(MSBuildProjectDirectory)/../../src/Microsoft.AspNetCore.SignalR.Client.TS/gulpfile.js bundle-client --bundleOutDir $(MSBuildProjectDirectory)/wwwroot/lib/signalr-client/" /> <Exec Command="npm run gulp -- --gulpfile $(MSBuildProjectDirectory)/../../src/Microsoft.AspNetCore.SignalR.Client.TS/gulpfile.js bundle-client --bundleOutDir $(MSBuildProjectDirectory)/wwwroot/lib/signalr-client/" />

View File

@ -29,7 +29,7 @@ namespace Microsoft.Extensions.WebSockets.Internal.Tests
// Act // Act
// Wait for pings to be sent // Wait for pings to be sent
await Task.Delay(200); await Task.Delay(500);
await pair.ServerSocket.CloseAsync(WebSocketCloseStatus.NormalClosure).OrTimeout(); await pair.ServerSocket.CloseAsync(WebSocketCloseStatus.NormalClosure).OrTimeout();
var clientSummary = await client.OrTimeout(); var clientSummary = await client.OrTimeout();

View File

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\build\common.props" /> <Import Project="..\..\build\common.props" />
@ -6,6 +6,7 @@
<TargetFramework>netcoreapp1.1</TargetFramework> <TargetFramework>netcoreapp1.1</TargetFramework>
<!-- TODO remove when https://github.com/dotnet/sdk/issues/396 is resolved --> <!-- TODO remove when https://github.com/dotnet/sdk/issues/396 is resolved -->
<RuntimeIdentifier Condition=" '$(TargetFramework)' != 'netcoreapp1.1' ">win7-x64</RuntimeIdentifier> <RuntimeIdentifier Condition=" '$(TargetFramework)' != 'netcoreapp1.1' ">win7-x64</RuntimeIdentifier>
<RuntimeFrameworkVersion>1.2.0-*</RuntimeFrameworkVersion>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
</PropertyGroup> </PropertyGroup>