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>
<TargetFramework>netcoreapp1.1</TargetFramework>
@ -6,6 +8,10 @@
<OutputType>Exe</OutputType>
<UserSecretsId>aspnet-ChatSample-f11cf018-e0a8-49fa-b749-4c0eb5c9150b</UserSecretsId>
<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>
<ItemGroup>
@ -21,10 +27,10 @@
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" 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.EntityFrameworkCore.Design" Version="1.2.0-*" PrivateAssets="All"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.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" 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.Json" 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-*" />
</ItemGroup>
<Target Name="BuildTSClient"
BeforeTargets="BeforeBuild">
<Target Name="BuildTSClient" BeforeTargets="BeforeBuild">
<Exec Command="dotnet bundle" />
<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/" />

View File

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

View File

@ -35,7 +35,7 @@ namespace SocialWeather
}
app.UseSockets(o => { o.MapEndpoint<SocialWeatherEndPoint>("/weather"); });
app.UseStaticFiles();
app.UseFileServer();
var formatterResolver = app.ApplicationServices.GetRequiredService<FormatterResolver>();
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>
<TargetFrameworks>netcoreapp1.1;net46</TargetFrameworks>
@ -7,6 +9,10 @@
<PreserveCompilationContext>true</PreserveCompilationContext>
<OutputType>Exe</OutputType>
<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>
<ItemGroup>
@ -20,9 +26,7 @@
<PackageReference Include="Google.Protobuf" Version="3.1.0" />
</ItemGroup>
<Target Name="BuildTSClient"
BeforeTargets="BeforeBuild"
Condition=" '$(TargetFramework)' == '' ">
<Target Name="BuildTSClient" BeforeTargets="BeforeBuild" Condition=" '$(TargetFramework)' == '' ">
<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/" />
</Target>

View File

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

View File

@ -1,14 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<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 -->
<RuntimeIdentifier Condition=" '$(TargetFramework)' != 'netcoreapp1.1' ">win7-x64</RuntimeIdentifier>
<RuntimeFrameworkVersion>1.2.0-*</RuntimeFrameworkVersion>
<PreserveCompilationContext>true</PreserveCompilationContext>
<OutputType>Exe</OutputType>
</PropertyGroup>
@ -22,9 +21,7 @@
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.2.0-*" />
</ItemGroup>
<Target Name="BuildTSClient"
BeforeTargets="BeforeBuild"
Condition=" '$(TargetFramework)' == '' ">
<Target Name="BuildTSClient" BeforeTargets="BeforeBuild">
<Exec Command="npm install" />
<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/" />

View File

@ -29,7 +29,7 @@ namespace Microsoft.Extensions.WebSockets.Internal.Tests
// Act
// Wait for pings to be sent
await Task.Delay(200);
await Task.Delay(500);
await pair.ServerSocket.CloseAsync(WebSocketCloseStatus.NormalClosure).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" />
@ -6,6 +6,7 @@
<TargetFramework>netcoreapp1.1</TargetFramework>
<!-- TODO remove when https://github.com/dotnet/sdk/issues/396 is resolved -->
<RuntimeIdentifier Condition=" '$(TargetFramework)' != 'netcoreapp1.1' ">win7-x64</RuntimeIdentifier>
<RuntimeFrameworkVersion>1.2.0-*</RuntimeFrameworkVersion>
<OutputType>Exe</OutputType>
</PropertyGroup>