-
Notifications
You must be signed in to change notification settings - Fork 527
Conversation
860f15a
to
5c5f401
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A good start. A few things suggestions for how to simply and cleanup
@@ -0,0 +1,12 @@ | |||
<Project Sdk="Microsoft.NET.Sdk.Web" ToolsVersion="15.0"> | |||
<Import Project="..\..\build\common.props" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this reference from samples if the sample works fine without.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They don't. Do you recommend keeping it here or bringing in the relevant stuff from common.props
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy in the stuff it needs. In theory, we want users to be able to copy the sample and run without needing Internal.AspNetCore.Sdk.
|
||
<ItemGroup> | ||
<PackageReference Include="NETStandard.Library" Version="1.6.2-*" /> | ||
<PackageReference Include="Microsoft.Extensions.TaskCache.Sources" Version="1.2.0-*"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: can use one-line syntax <PackageReference .... PrivateAssets="All" />
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Microsoft.AspNetCore.Server.Kestrel\Microsoft.AspNetCore.Server.Kestrel.csproj" /> | ||
</ItemGroup> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: condense with the ItemGroup below.
[assembly: AssemblyCompany("Microsoft Corporation.")] | ||
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")] | ||
[assembly: AssemblyProduct("Microsoft ASP.NET Core")] | ||
[assembly: AssemblyMetadata("Serviceable", "True")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be generated automatically by Internal.AspNetCore.Sdk. This whole file can be removed.
@@ -9,7 +9,3 @@ | |||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Server.KestrelTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] | |||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Server.Kestrel.Performance, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] | |||
[assembly: AssemblyMetadata("Serviceable", "True")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can remove this too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need the InternalsVisibleTo
attributes otherwise tests don't compile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just meant you can remove that one line, not the whole file :)
</ItemGroup> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' "> | ||
<Reference Include="System.Net.Http" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, this looks like the issue @anurse is workign on. What should we do here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nvm, just realized this is a test project.
</ItemGroup> | ||
|
||
<PropertyGroup Condition=" '$(OS)' == 'Unix' "> | ||
<DefineConstants>$(DefineConstants);UNIX</DefineConstants> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this be useful outside this repo? We could add these kinds of helpers to Internal.AspNetCore.Sdk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used this to conditionally add [assembly: CollectionBehavior(DisableTestParallelization = true)]
to our functional tests on Mac, because we hit the system's file descriptor limit when running in parallel. This isn't even the best fix since it would apply to any Unix and not just Darwin, but it's the cleanest way to do it for now.
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Server.Kestrel\Microsoft.AspNetCore.Server.Kestrel.csproj" /> | ||
</ItemGroup> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: condense itemgroups.
makefile.shade
Outdated
dotnet command='msbuild tools/Microsoft.AspNetCore.Server.Kestrel.GeneratedCode/run.proj /t:GenerateCode' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this just be dotnet run instead?
@@ -0,0 +1,10 @@ | |||
<Project ToolsVersion="15.0"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this file adds a layer we don't need. makefile.shade can just call dotnet run on the project directly with the arguments, right?
Also, to make 'dotnet run' just do the right thing by default, you can add this M.A.S.GenerateCode.csproj
<PropertyGroup>
<StartArguments>
"$(MSBuildProjectDirectory)/../../src/Microsoft.AspNetCore.Server.Kestrel/Internal/Http/FrameHeaders.Generated.cs"
"$(MSBuildProjectDirectory)/../../src/Microsoft.AspNetCore.Server.Kestrel/Internal/Http/Frame.Generated.cs"
</StartArguments>
</PropertyGroup>
Updated. |
Hopefully MSBuild will help us determine macOS vs Linux in the future. In the meantime, we can look into adding this ourselves so that we still get parallel tests running on Linux.
dotnet/msbuild#539
|
build/common.props
Outdated
<Import Project="..\version.props" /> | ||
|
||
<PropertyGroup> | ||
<Product>Microsoft .NET Extensions</Product> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to "Microsoft ASP.NET Core"
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(sigh) VS, why u need guids still?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh. I had remove some of these from other projects but missed this one.
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<PackageTags>aspnetcore;kestrel</PackageTags> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
<NoWarn>CS1591;$(NoWarn)</NoWarn> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We get a ton of those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh XML docs...
</ItemGroup> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' "> | ||
<Reference Include="System.Runtime" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wut
9de4bce
to
873811a
Compare
Problem with benchmarks is that BenchmarkDotNet generates Will try and get it to restore from the packages in |
873811a
to
b2d99b7
Compare
samples/SampleApp/SampleApp.csproj
Outdated
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Content Include="testCert.pfx"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I commented on the commit but I'll comment here too 😄. Change these to attributes. Also CopyToOutputDirectory
infers CopyToPublishDirectory
.
<Content Include="testCert.pfx" CopyToOutputDirectory="PreserveNewest" />
af66fe1
to
2dce18a
Compare
@Eilon Should be ready to merge. |
|
||
namespace Microsoft.AspNetCore.Server.Kestrel.Performance | ||
{ | ||
public class MsBuildExecutor : IExecutor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adamsitnik Would be glad to collaborate with you to get this more generalized and into BenchmarkDotNet 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CesarBS Sure! I have got something up and running: commit but not final yet, see the description
This week I am in Redmond for the MS LEAP, so we can even meet in person and talk about it ;) btw were you able to run this auto-generated dll? When I tried similar approach (to execute with process.Start) I got some missing dlls exceptions (the directory no longer contains the executable). That's why I have switched to dotnet run
executor (but it has some limitaitons)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! I'll send you an email so we can arrange when and where to meet.
I wasn't able to run the generated binaries with what came out of the box as of your latest commit. I would get this error when trying to run the benchmarks, until it failed:
/Users/Cesar/.dotnet/sdk/1.0.0-rc3-004522/Microsoft.Common.CurrentVersion.targets(3935,5): warning MSB3026: Could not copy "obj/Release/netcoreapp1.1/Microsoft.AspNetCore.Server.Kestrel.Performance.dll" to "bin/Release/netcoreapp1.1/Microsoft.AspNetCore.Server.Kestrel.Performance.dll". Beginning retry 1 in 1000ms. The process cannot access the file '/Users/Cesar/src/aspnet/KestrelHttpServer/test/Microsoft.AspNetCore.Server.Kestrel.Performance/bin/Release/netcoreapp1.1/Microsoft.AspNetCore.Server.Kestrel.Performance.dll' because it is being used by another process. [/Users/Cesar/src/aspnet/KestrelHttpServer/test/Microsoft.AspNetCore.Server.Kestrel.Performance/Microsoft.AspNetCore.Server.Kestrel.Performance.csproj]
I also noticed that there's a mismatch between DotNetCliBuilder
and DotNetRunExecutor
: the builder puts binaries in <generated project folder>\binaries
, while the executor calls dotnet run
, which will re-compile the project and attempt to run them from bin\Release\netcoreapp1.1
.
@@ -18,7 +18,7 @@ | |||
|
|||
<ItemGroup> | |||
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Server.Kestrel\Microsoft.AspNetCore.Server.Kestrel.csproj" /> | |||
<PackageReference Include="BenchmarkDotNet" Version="0.10.1" /> | |||
<PackageReference Include="BenchmarkDotNet" Version="0.10.2.*" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eep, 4-segment package versions 😦 But it is what it is...
@@ -0,0 +1,25 @@ | |||
<Project Sdk="Microsoft.NET.Sdk.Web" ToolsVersion="15.0"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a regular console app:
Microsoft.NET.Sdk not Microsoft.NET.Sdk.Web
@@ -0,0 +1,15 @@ | |||
<Project Sdk="Microsoft.NET.Sdk.Web" ToolsVersion="15.0"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, this should be Microsoft.NET.Sdk
6c8a719
to
c4570f8
Compare
Latest feedback addressed + fixed test execution on VS (a626218). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
KestrelHttpServer.sln
Outdated
# Visual Studio 14 | ||
VisualStudioVersion = 14.0.25420.1 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.26120.4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: 15.0.26117.0 is the latest RC.
e678200
to
d33b682
Compare
d33b682
to
1a2c438
Compare
TODO:
@natemcmaster @halter73 @pakrym