Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Upgrade to RC.3 #1314

Merged
merged 1 commit into from
Feb 1, 2017
Merged

Upgrade to RC.3 #1314

merged 1 commit into from
Feb 1, 2017

Conversation

cesarblum
Copy link
Contributor

@cesarblum cesarblum commented Jan 20, 2017

TODO:

@natemcmaster @halter73 @pakrym

Copy link
Contributor

@natemcmaster natemcmaster left a 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" />
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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-*">
Copy link
Contributor

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>
Copy link
Contributor

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")]
Copy link
Contributor

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")]
Copy link
Contributor

Choose a reason for hiding this comment

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

Can remove this too.

Copy link
Contributor Author

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.

Copy link
Contributor

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" />
Copy link
Contributor

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?

Copy link
Contributor

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>
Copy link
Contributor

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

Copy link
Contributor Author

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>
Copy link
Contributor

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'
Copy link
Contributor

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">
Copy link
Contributor

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>
    &quot;$(MSBuildProjectDirectory)/../../src/Microsoft.AspNetCore.Server.Kestrel/Internal/Http/FrameHeaders.Generated.cs&quot;
    &quot;$(MSBuildProjectDirectory)/../../src/Microsoft.AspNetCore.Server.Kestrel/Internal/Http/Frame.Generated.cs&quot;
  </StartArguments>
</PropertyGroup>

@cesarblum
Copy link
Contributor Author

Updated.

@natemcmaster
Copy link
Contributor

natemcmaster commented Jan 20, 2017 via email

<Import Project="..\version.props" />

<PropertyGroup>
<Product>Microsoft .NET Extensions</Product>
Copy link
Contributor

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}" />
Copy link
Contributor

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?

Copy link
Contributor Author

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>
Copy link
Member

Choose a reason for hiding this comment

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

not needed?

Copy link
Contributor Author

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.

Copy link
Member

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" />
Copy link
Member

Choose a reason for hiding this comment

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

wut

@cesarblum
Copy link
Contributor Author

Problem with benchmarks is that BenchmarkDotNet generates project.json files and we can't restore those with references to the now .csproj-based Kestrel projects.

Will try and get it to restore from the packages in artifacts/.

</PropertyGroup>

<ItemGroup>
<Content Include="testCert.pfx">
Copy link
Member

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" />

@cesarblum
Copy link
Contributor Author

@Eilon Should be ready to merge.


namespace Microsoft.AspNetCore.Server.Kestrel.Performance
{
public class MsBuildExecutor : IExecutor
Copy link
Contributor Author

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 😄

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)

Copy link
Contributor Author

@cesarblum cesarblum Jan 29, 2017

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.

@cesarblum cesarblum changed the title [WIP] Upgrade to RC.3 Upgrade to RC.3 Jan 28, 2017
@@ -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.*" />
Copy link
Member

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">
Copy link
Member

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">
Copy link
Member

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

@cesarblum
Copy link
Contributor Author

Latest feedback addressed + fixed test execution on VS (a626218).

Copy link
Contributor

@natemcmaster natemcmaster left a comment

Choose a reason for hiding this comment

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

:shipit: looks good

# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.26120.4
Copy link
Contributor

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.

@cesarblum cesarblum merged commit 1a2c438 into dev Feb 1, 2017
@cesarblum cesarblum deleted the cesarbs/msbuild branch February 1, 2017 00:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants