From 776b1aacdf34e89947fc3c29323d782d4ac7ec12 Mon Sep 17 00:00:00 2001 From: Christian Nagel Date: Tue, 17 Jan 2017 10:52:13 +0100 Subject: [PATCH 1/4] Update BookUpdates.md change with default constructors for structs --- BookUpdates.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BookUpdates.md b/BookUpdates.md index f20213e9..880ea715 100644 --- a/BookUpdates.md +++ b/BookUpdates.md @@ -107,6 +107,8 @@ Page 76 - typo: *_* missing with _firstName variable within get accessor Page 84 - typo: new MySingleton(42) should by new Singleton(42) +Page 92 - Constructors for Structs: you cannot define default constructors for structs. This didn't make it into C# 6. + ## Chapter 5 - Managed and Unmanaged Resources Page 124, Note at the end of the page: selecting a 32- or 64-bit build cannot be done by the Debug settings of the project properties. Instead, configure the *runtimes* section within *project.json*. From 8893e3f5bfafa24b1a020073688abf9e4721c98d Mon Sep 17 00:00:00 2001 From: Christian Nagel Date: Tue, 17 Jan 2017 19:28:42 +0100 Subject: [PATCH 2/4] .NET Core 1.1 --- ASPNET/WebSampleApp/global.json | 2 +- .../src/WebSampleApp/project.json | 28 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ASPNET/WebSampleApp/global.json b/ASPNET/WebSampleApp/global.json index e793049c..8b163c58 100644 --- a/ASPNET/WebSampleApp/global.json +++ b/ASPNET/WebSampleApp/global.json @@ -1,6 +1,6 @@ { "projects": [ "src", "test" ], "sdk": { - "version": "1.0.0-preview2-003121" + "version": "1.0.0-preview2-1-003177" } } diff --git a/ASPNET/WebSampleApp/src/WebSampleApp/project.json b/ASPNET/WebSampleApp/src/WebSampleApp/project.json index 29655b83..6c5613b6 100644 --- a/ASPNET/WebSampleApp/src/WebSampleApp/project.json +++ b/ASPNET/WebSampleApp/src/WebSampleApp/project.json @@ -6,22 +6,22 @@ }, "dependencies": { "Microsoft.NETCore.App": { - "version": "1.0.1", + "version": "1.1.0", "type": "platform" }, - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.1", - "Microsoft.AspNetCore.Session": "1.0.0", - "Microsoft.AspNetCore.StaticFiles": "1.0.0", - "Microsoft.Extensions.Caching.Abstractions": "1.0.0", - "Microsoft.Extensions.Caching.Memory": "1.0.0", - "Microsoft.Extensions.Configuration": "1.0.0", - "Microsoft.Extensions.Configuration.Json": "1.0.0", - "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0", - "Microsoft.Extensions.Logging": "1.0.0", - "Microsoft.Extensions.Logging.Console": "1.0.0", - "Microsoft.Extensions.Logging.Debug": "1.0.0", - "Newtonsoft.Json": "9.0.1" + "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0", + "Newtonsoft.Json": "9.0.1", + "Microsoft.AspNetCore.Server.Kestrel": "1.1.0", + "Microsoft.AspNetCore.Session": "1.1.0", + "Microsoft.AspNetCore.StaticFiles": "1.1.0", + "Microsoft.Extensions.Caching.Abstractions": "1.1.0", + "Microsoft.Extensions.Caching.Memory": "1.1.0", + "Microsoft.Extensions.Configuration": "1.1.0", + "Microsoft.Extensions.Configuration.Json": "1.1.0", + "Microsoft.Extensions.Configuration.UserSecrets": "1.1.0", + "Microsoft.Extensions.Logging": "1.1.0", + "Microsoft.Extensions.Logging.Console": "1.1.0", + "Microsoft.Extensions.Logging.Debug": "1.1.0" }, "tools": { "Microsoft.AspNetCore.Server.IISIntegration.Tools": { From d658ee68ed11564b194a9c2eb8fc4994424590d5 Mon Sep 17 00:00:00 2001 From: Christian Nagel Date: Tue, 17 Jan 2017 19:29:36 +0100 Subject: [PATCH 3/4] add full HTML for Chrome support --- .../src/WebSampleApp/Helpers/HtmlHelper.cs | 19 +++++++++++++++++++ .../WebSampleApp/src/WebSampleApp/Startup.cs | 5 +++++ 2 files changed, 24 insertions(+) create mode 100644 ASPNET/WebSampleApp/src/WebSampleApp/Helpers/HtmlHelper.cs diff --git a/ASPNET/WebSampleApp/src/WebSampleApp/Helpers/HtmlHelper.cs b/ASPNET/WebSampleApp/src/WebSampleApp/Helpers/HtmlHelper.cs new file mode 100644 index 00000000..ca8727d1 --- /dev/null +++ b/ASPNET/WebSampleApp/src/WebSampleApp/Helpers/HtmlHelper.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace WebSampleApp.Helpers +{ + public static class HtmlHelper + { + public static string DocType() => ""; + + public static string Head() => "Sample"; + + public static string HtmlStart() => ""; + public static string HtmlEnd() => ""; + public static string BodyStart() => ""; + public static string BodyEnd() => ""; + } +} diff --git a/ASPNET/WebSampleApp/src/WebSampleApp/Startup.cs b/ASPNET/WebSampleApp/src/WebSampleApp/Startup.cs index 8d0d8125..d735f816 100644 --- a/ASPNET/WebSampleApp/src/WebSampleApp/Startup.cs +++ b/ASPNET/WebSampleApp/src/WebSampleApp/Startup.cs @@ -10,6 +10,7 @@ using WebSampleApp.Services; using Microsoft.Extensions.Logging; using System.Text; +using WebSampleApp.Helpers; namespace WebSampleApp { @@ -233,7 +234,9 @@ await context.Response.WriteAsync( result = RequestAndResponseSample.GetRequestInformation(context.Request); break; } + await context.Response.WriteAsync(HtmlHelper.DocType() + HtmlHelper.HtmlStart() + HtmlHelper.Head() + HtmlHelper.BodyStart()); await context.Response.WriteAsync(result); + await context.Response.WriteAsync(HtmlHelper.BodyEnd() + HtmlHelper.HtmlEnd()); }); }); @@ -244,6 +247,7 @@ await context.Response.WriteAsync( app.Run(async (context) => { var sb = new StringBuilder(); + sb.Append(HtmlHelper.DocType() + HtmlHelper.HtmlStart() + HtmlHelper.Head() + HtmlHelper.BodyStart()); sb.Append("
    "); sb.Append(@"
  • Static Files - requires UseStaticFiles
  • "); sb.Append(@"
  • Request and Response"); @@ -272,6 +276,7 @@ await context.Response.WriteAsync( sb.Append("
"); sb.Append(""); sb.Append(""); + sb.Append(HtmlHelper.BodyEnd() + HtmlHelper.HtmlEnd()); await context.Response.WriteAsync(sb.ToString()); }); From 700c5c2d9126950006c59bc71dcbb9fc8d074f81 Mon Sep 17 00:00:00 2001 From: Christian Nagel Date: Tue, 17 Jan 2017 19:34:06 +0100 Subject: [PATCH 4/4] 1.1 update --- ASPNET/Readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ASPNET/Readme.md b/ASPNET/Readme.md index b1afcfbc..3ada6afb 100644 --- a/ASPNET/Readme.md +++ b/ASPNET/Readme.md @@ -8,9 +8,9 @@ Building this sample starts with an empty ASP.NET Core Web project, and adds man To build and run the .NET Core samples, please install * Visual Studio 2015 Update 3 -* .NET Core 1.0 for Visual Studio +* .NET Core 1.1 -Please download and install the tools from [.NET Core downloads](https://www.microsoft.com/net/core#windows). +Please download and install the tools from [.NET Core downloads](https://dot.net). For code comments and issues please check [Professional C#'s GitHub Repository](https://github.com/ProfessionalCSharp/ProfessionalCSharp6)