-
Notifications
You must be signed in to change notification settings - Fork 344
Conversation
KrzysztofCwalina
commented
Mar 20, 2018
- updated the sample to new packages and runtime
- refactored HTTP code into a separate wrapper for IDuplexPipe
- small resulting renames
<PackageReference Include="System.Text.Http.Parser" Version="$(CoreFxLabPackageVersion)" /> | ||
<PackageReference Include="System.Text.Utf8String" Version="$(CoreFxLabPackageVersion)" /> | ||
<PackageReference Include="System.IO.Pipelines" Version="$(CoreFxLabPackageVersion)" /> | ||
<PackageReference Include="System.Azure.Experimental" Version="0.1.0-preview2-180320-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.
Update and use the CoreFxLabPackageVersion property to make it easier to update in the future.
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.
Yeah, but there is a trade off here. I think it's good that we have some samples that validate how our customers are using and demonstrate how they should be using our packages.
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 don't understand the trade off here. We have all these package version numbers here, and they point to the same version. We have a property in this csproj called CoreFxLabPackageVersion. I was just suggesting we use that so that it becomes a single point of edit in the future, if we ever want to upgrade them again. Note, this is still isolated from the rest of the repo and would still demonstrate the customer's use of our packages.
<PackageReference Include="System.Memory" Version="$(CoreFxPackageVersion)" /> | ||
<PackageReference Include="System.Threading.Tasks.Extensions" Version="$(CoreFxPackageVersion)" /> | ||
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="1.0.0-alpha-26320-02" /> | ||
<PackageReference Include="System.Buffers.ReaderWriter" Version="0.1.0-preview2-180320-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.
nit: Move this down to the other ItemGroup with the rest of the corefxlab packages
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.
will do
<PackageReference Include="System.Text.Http" Version="0.1.0-preview2-180320-2" /> | ||
<PackageReference Include="System.Text.Http.Parser" Version="0.1.0-preview2-180320-2" /> | ||
<PackageReference Include="System.Text.Utf8String" Version="0.1.0-preview2-180320-2" /> | ||
<PackageReference Include="System.IO.Pipelines" Version="4.5.0-preview3-26319-04" /> |
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: Move this up to the other ItemGroup with the rest of the CoreFX packages
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.
will do
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="1.0.0-alpha-26320-02" /> | ||
<PackageReference Include="System.Buffers.ReaderWriter" Version="0.1.0-preview2-180320-2" /> | ||
<PackageReference Include="System.Memory" Version="4.5.0-preview3-26319-04" /> | ||
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.0-preview3-26319-04" /> |
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.
Update and use the CoreFxPackageVersion property to make it easier to update in the future.
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.
As I said above, I like how the sample shows VS experience that our customers will get.
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 don't know if someone would go and manually update each individual referenced packages using VS/NuGet package manager. Once they are added (which can be done by using VS/NuGet package manager), it would make sense to create a property to update the versions, no?
@@ -3,7 +3,9 @@ | |||
<PropertyGroup> | |||
<OutputType>Exe</OutputType> | |||
<TargetFramework>netcoreapp2.1</TargetFramework> | |||
<!-- |
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.
Why is this commented out? This should be the same as https://github.com/dotnet/corefxlab/blob/master/SharedRuntimeVersion.txt (or import the common.props file).
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.
It's @terrajobst's fault. :-) I removed it now.
<PackageReference Include="System.Text.Utf8String" Version="$(CoreFxLabPackageVersion)" /> | ||
<PackageReference Include="System.IO.Pipelines" Version="$(CoreFxLabPackageVersion)" /> | ||
<PackageReference Include="System.Azure.Experimental" Version="0.1.0-preview2-180320-2" /> | ||
<PackageReference Include="System.Buffers.Experimental" Version="0.1.0-preview2-180320-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.
Can these be project references instead of package references?
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 as above: I think samples should show customer experience that does not require cloning the whole repo.
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.
Agreed. In that case, package references make sense. Thanks.
|
||
var options = new CommandLine(args); | ||
ReadOnlySpan<char> source = options.GetSpan("/Source:"); | ||
ReadOnlySpan<char> destination = options.GetSpan("/Dest:"); | ||
|
||
long before = GC.GetAllocatedBytesForCurrentThread(); | ||
var sw = Stopwatch.StartNew(); |
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: use of var
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.
will fix
{ | ||
client.Log = Log; | ||
//var files = new Files(directoryPath); |
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.
clean up commented out code
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.
will do.
keyBytes = options["/DestKey:"].ComputeKeyBytes(); | ||
ReadOnlySpan<char> key = options["/DestKey:"]; | ||
var str = key.ToString(); | ||
keyBytes = key.ComputeKeyBytes(); |
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.
Why is this change necessary?
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.
leftover from debugging. I removed now. thanks.
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.