From 8106fc861322d1256f950745866f47dd689b6280 Mon Sep 17 00:00:00 2001 From: glennc Date: Wed, 1 Jul 2015 11:16:18 -0700 Subject: Add beta5, add console logger to web and mvc so that you can see the URL that we listen on. --- samples/1.0.0-beta5/ConsoleApp/ConsoleApp.xproj | 17 +++++++++ samples/1.0.0-beta5/ConsoleApp/Program.cs | 9 +++++ samples/1.0.0-beta5/ConsoleApp/project.json | 16 +++++++++ .../HelloMvc/Controllers/HomeController.cs | 24 +++++++++++++ samples/1.0.0-beta5/HelloMvc/HelloMvc.xproj | 18 ++++++++++ samples/1.0.0-beta5/HelloMvc/Models/User.cs | 13 +++++++ .../HelloMvc/Properties/launchSettings.json | 21 +++++++++++ samples/1.0.0-beta5/HelloMvc/Startup.cs | 25 +++++++++++++ .../1.0.0-beta5/HelloMvc/Views/Home/Index.cshtml | 16 +++++++++ .../HelloMvc/Views/Shared/_Layout.cshtml | 40 +++++++++++++++++++++ samples/1.0.0-beta5/HelloMvc/project.json | 28 +++++++++++++++ samples/1.0.0-beta5/HelloMvc/wwwroot/image.jpg | Bin 0 -> 310647 bytes samples/1.0.0-beta5/HelloWeb/HelloWeb.xproj | 18 ++++++++++ .../HelloWeb/Properties/launchSettings.json | 21 +++++++++++ samples/1.0.0-beta5/HelloWeb/Startup.cs | 15 ++++++++ samples/1.0.0-beta5/HelloWeb/project.json | 29 +++++++++++++++ samples/1.0.0-beta5/HelloWeb/wwwroot/image.jpg | Bin 0 -> 310647 bytes samples/1.0.0-beta5/NuGet.Config | 7 ++++ samples/1.0.0-beta5/global.json | 5 +++ samples/latest/HelloMvc/Startup.cs | 5 ++- samples/latest/HelloMvc/project.json | 3 +- samples/latest/HelloWeb/Startup.cs | 4 ++- samples/latest/HelloWeb/project.json | 3 +- 23 files changed, 333 insertions(+), 4 deletions(-) create mode 100644 samples/1.0.0-beta5/ConsoleApp/ConsoleApp.xproj create mode 100644 samples/1.0.0-beta5/ConsoleApp/Program.cs create mode 100644 samples/1.0.0-beta5/ConsoleApp/project.json create mode 100644 samples/1.0.0-beta5/HelloMvc/Controllers/HomeController.cs create mode 100644 samples/1.0.0-beta5/HelloMvc/HelloMvc.xproj create mode 100644 samples/1.0.0-beta5/HelloMvc/Models/User.cs create mode 100644 samples/1.0.0-beta5/HelloMvc/Properties/launchSettings.json create mode 100644 samples/1.0.0-beta5/HelloMvc/Startup.cs create mode 100644 samples/1.0.0-beta5/HelloMvc/Views/Home/Index.cshtml create mode 100644 samples/1.0.0-beta5/HelloMvc/Views/Shared/_Layout.cshtml create mode 100644 samples/1.0.0-beta5/HelloMvc/project.json create mode 100644 samples/1.0.0-beta5/HelloMvc/wwwroot/image.jpg create mode 100644 samples/1.0.0-beta5/HelloWeb/HelloWeb.xproj create mode 100644 samples/1.0.0-beta5/HelloWeb/Properties/launchSettings.json create mode 100644 samples/1.0.0-beta5/HelloWeb/Startup.cs create mode 100644 samples/1.0.0-beta5/HelloWeb/project.json create mode 100644 samples/1.0.0-beta5/HelloWeb/wwwroot/image.jpg create mode 100644 samples/1.0.0-beta5/NuGet.Config create mode 100644 samples/1.0.0-beta5/global.json diff --git a/samples/1.0.0-beta5/ConsoleApp/ConsoleApp.xproj b/samples/1.0.0-beta5/ConsoleApp/ConsoleApp.xproj new file mode 100644 index 0000000000..a7330acb5e --- /dev/null +++ b/samples/1.0.0-beta5/ConsoleApp/ConsoleApp.xproj @@ -0,0 +1,17 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + d4f684c8-b6a4-45f0-aca0-0d95632ff946 + ..\..\artifacts\obj\$(MSBuildProjectName) + ..\..\artifacts\bin\$(MSBuildProjectName)\ + + + 2.0 + + + \ No newline at end of file diff --git a/samples/1.0.0-beta5/ConsoleApp/Program.cs b/samples/1.0.0-beta5/ConsoleApp/Program.cs new file mode 100644 index 0000000000..7ee7ee1dc5 --- /dev/null +++ b/samples/1.0.0-beta5/ConsoleApp/Program.cs @@ -0,0 +1,9 @@ +using System; + +public class Program +{ + public static void Main() + { + Console.WriteLine("Hello World"); + } +} diff --git a/samples/1.0.0-beta5/ConsoleApp/project.json b/samples/1.0.0-beta5/ConsoleApp/project.json new file mode 100644 index 0000000000..f49852e62a --- /dev/null +++ b/samples/1.0.0-beta5/ConsoleApp/project.json @@ -0,0 +1,16 @@ +{ + "dependencies": { + + }, + "commands": { + "ConsoleApp": "ConsoleApp" + }, + "frameworks": { + "dnx451": { }, + "dnxcore50": { + "dependencies": { + "System.Console": "4.0.0-beta-23019" + } + } + } +} diff --git a/samples/1.0.0-beta5/HelloMvc/Controllers/HomeController.cs b/samples/1.0.0-beta5/HelloMvc/Controllers/HomeController.cs new file mode 100644 index 0000000000..b05b713929 --- /dev/null +++ b/samples/1.0.0-beta5/HelloMvc/Controllers/HomeController.cs @@ -0,0 +1,24 @@ +using Microsoft.AspNet.Mvc; +using MvcSample.Web.Models; + +namespace MvcSample.Web +{ + public class HomeController : Controller + { + public IActionResult Index() + { + return View(CreateUser()); + } + + public User CreateUser() + { + User user = new User() + { + Name = "My name", + Address = "My address" + }; + + return user; + } + } +} \ No newline at end of file diff --git a/samples/1.0.0-beta5/HelloMvc/HelloMvc.xproj b/samples/1.0.0-beta5/HelloMvc/HelloMvc.xproj new file mode 100644 index 0000000000..37ce6abf15 --- /dev/null +++ b/samples/1.0.0-beta5/HelloMvc/HelloMvc.xproj @@ -0,0 +1,18 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + 78627bb3-851e-4c1a-91c0-629fc7c15f8f + ..\..\artifacts\obj\$(MSBuildProjectName) + ..\..\artifacts\bin\$(MSBuildProjectName)\ + + + 2.0 + 26425 + + + \ No newline at end of file diff --git a/samples/1.0.0-beta5/HelloMvc/Models/User.cs b/samples/1.0.0-beta5/HelloMvc/Models/User.cs new file mode 100644 index 0000000000..9869e92d13 --- /dev/null +++ b/samples/1.0.0-beta5/HelloMvc/Models/User.cs @@ -0,0 +1,13 @@ +using System.ComponentModel.DataAnnotations; + +namespace MvcSample.Web.Models +{ + public class User + { + [Required] + [MinLength(4)] + public string Name { get; set; } + public string Address { get; set; } + public int Age { get; set; } + } +} \ No newline at end of file diff --git a/samples/1.0.0-beta5/HelloMvc/Properties/launchSettings.json b/samples/1.0.0-beta5/HelloMvc/Properties/launchSettings.json new file mode 100644 index 0000000000..eccc5ae1c1 --- /dev/null +++ b/samples/1.0.0-beta5/HelloMvc/Properties/launchSettings.json @@ -0,0 +1,21 @@ +{ + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNET_ENV": "Development" + } + }, + "kestrel": { + "commandName": "kestrel", + "launchBrowser": true, + "launchUrl": "http://localhost:5004" + }, + "web": { + "commandName": "web", + "launchBrowser": true, + "launchUrl": "http://localhost:5001" + } + } +} \ No newline at end of file diff --git a/samples/1.0.0-beta5/HelloMvc/Startup.cs b/samples/1.0.0-beta5/HelloMvc/Startup.cs new file mode 100644 index 0000000000..5f198a4dcb --- /dev/null +++ b/samples/1.0.0-beta5/HelloMvc/Startup.cs @@ -0,0 +1,25 @@ +using Microsoft.AspNet.Builder; +using Microsoft.Framework.DependencyInjection; +using Microsoft.Framework.Logging; + +namespace HelloMvc +{ + public class Startup + { + public void ConfigureServices(IServiceCollection services) + { + services.AddMvc(); + } + + public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) + { + loggerFactory.AddConsole(); + + app.UseErrorPage(); + + app.UseMvcWithDefaultRoute(); + + app.UseWelcomePage(); + } + } +} \ No newline at end of file diff --git a/samples/1.0.0-beta5/HelloMvc/Views/Home/Index.cshtml b/samples/1.0.0-beta5/HelloMvc/Views/Home/Index.cshtml new file mode 100644 index 0000000000..b786e64b5e --- /dev/null +++ b/samples/1.0.0-beta5/HelloMvc/Views/Home/Index.cshtml @@ -0,0 +1,16 @@ +@using MvcSample.Web.Models +@model User +@{ + Layout = "/Views/Shared/_Layout.cshtml"; + ViewBag.Title = "Home Page"; + string helloClass = null; +} + +
+

ASP.NET

+

ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.

+

Learn more »

+
+
+

Hello @Model.Name!

+
diff --git a/samples/1.0.0-beta5/HelloMvc/Views/Shared/_Layout.cshtml b/samples/1.0.0-beta5/HelloMvc/Views/Shared/_Layout.cshtml new file mode 100644 index 0000000000..3377694bed --- /dev/null +++ b/samples/1.0.0-beta5/HelloMvc/Views/Shared/_Layout.cshtml @@ -0,0 +1,40 @@ + + + + + + @ViewBag.Title - My ASP.NET Application + + + + +
+ @RenderBody() +
+
+ @if (@Model != null) + { + @Model.Address + } +
+
+

© @DateTime.Now.Year - My ASP.NET Application

+
+
+ + diff --git a/samples/1.0.0-beta5/HelloMvc/project.json b/samples/1.0.0-beta5/HelloMvc/project.json new file mode 100644 index 0000000000..91f149b8bb --- /dev/null +++ b/samples/1.0.0-beta5/HelloMvc/project.json @@ -0,0 +1,28 @@ +{ + "version": "1.0.0-*", + "webroot": "wwwroot", + "exclude": [ + "wwwroot" + ], + "packExclude": [ + "**.kproj", + "**.user", + "**.vspscc" + ], + "dependencies": { + "Kestrel": "1.0.0-beta5", + "Microsoft.AspNet.Diagnostics": "1.0.0-beta5", + "Microsoft.AspNet.Mvc": "6.0.0-beta5", + "Microsoft.AspNet.Server.IIS": "1.0.0-beta5", + "Microsoft.AspNet.Server.WebListener": "1.0.0-beta5", + "Microsoft.Framework.Logging.Console": "1.0.0-beta5" + }, + "commands": { + "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5001", + "kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5004" + }, + "frameworks": { + "dnx451": { }, + "dnxcore50": { } + } +} diff --git a/samples/1.0.0-beta5/HelloMvc/wwwroot/image.jpg b/samples/1.0.0-beta5/HelloMvc/wwwroot/image.jpg new file mode 100644 index 0000000000..899595259f Binary files /dev/null and b/samples/1.0.0-beta5/HelloMvc/wwwroot/image.jpg differ diff --git a/samples/1.0.0-beta5/HelloWeb/HelloWeb.xproj b/samples/1.0.0-beta5/HelloWeb/HelloWeb.xproj new file mode 100644 index 0000000000..130b1d14d3 --- /dev/null +++ b/samples/1.0.0-beta5/HelloWeb/HelloWeb.xproj @@ -0,0 +1,18 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + 8d4b2ab5-c2d2-4ee0-b751-f4126c7d0539 + ..\..\artifacts\obj\$(MSBuildProjectName) + ..\..\artifacts\bin\$(MSBuildProjectName)\ + + + 2.0 + 26235 + + + \ No newline at end of file diff --git a/samples/1.0.0-beta5/HelloWeb/Properties/launchSettings.json b/samples/1.0.0-beta5/HelloWeb/Properties/launchSettings.json new file mode 100644 index 0000000000..eccc5ae1c1 --- /dev/null +++ b/samples/1.0.0-beta5/HelloWeb/Properties/launchSettings.json @@ -0,0 +1,21 @@ +{ + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNET_ENV": "Development" + } + }, + "kestrel": { + "commandName": "kestrel", + "launchBrowser": true, + "launchUrl": "http://localhost:5004" + }, + "web": { + "commandName": "web", + "launchBrowser": true, + "launchUrl": "http://localhost:5001" + } + } +} \ No newline at end of file diff --git a/samples/1.0.0-beta5/HelloWeb/Startup.cs b/samples/1.0.0-beta5/HelloWeb/Startup.cs new file mode 100644 index 0000000000..76bfac0acb --- /dev/null +++ b/samples/1.0.0-beta5/HelloWeb/Startup.cs @@ -0,0 +1,15 @@ +using Microsoft.AspNet.Builder; +using Microsoft.Framework.Logging; + +namespace HelloWeb +{ + public class Startup + { + public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) + { + loggerFactory.AddConsole(); + app.UseStaticFiles(); + app.UseWelcomePage(); + } + } +} \ No newline at end of file diff --git a/samples/1.0.0-beta5/HelloWeb/project.json b/samples/1.0.0-beta5/HelloWeb/project.json new file mode 100644 index 0000000000..fef604f2c8 --- /dev/null +++ b/samples/1.0.0-beta5/HelloWeb/project.json @@ -0,0 +1,29 @@ +{ + "version": "1.0.0-*", + "webroot": "wwwroot", + "exclude": [ + "wwwroot" + ], + "packExclude": [ + "**.kproj", + "**.user", + "**.vspscc" + ], + "dependencies": { + "Kestrel": "1.0.0-beta5", + "Microsoft.AspNet.Diagnostics": "1.0.0-beta5", + "Microsoft.AspNet.Hosting": "1.0.0-beta5", + "Microsoft.AspNet.Server.IIS": "1.0.0-beta5", + "Microsoft.AspNet.Server.WebListener": "1.0.0-beta5", + "Microsoft.AspNet.StaticFiles": "1.0.0-beta5", + "Microsoft.Framework.Logging.Console": "1.0.0-beta5" + }, + "commands": { + "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5001", + "kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5004" + }, + "frameworks": { + "dnx451": { }, + "dnxcore50": { } + } +} diff --git a/samples/1.0.0-beta5/HelloWeb/wwwroot/image.jpg b/samples/1.0.0-beta5/HelloWeb/wwwroot/image.jpg new file mode 100644 index 0000000000..899595259f Binary files /dev/null and b/samples/1.0.0-beta5/HelloWeb/wwwroot/image.jpg differ diff --git a/samples/1.0.0-beta5/NuGet.Config b/samples/1.0.0-beta5/NuGet.Config new file mode 100644 index 0000000000..385c62550d --- /dev/null +++ b/samples/1.0.0-beta5/NuGet.Config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/samples/1.0.0-beta5/global.json b/samples/1.0.0-beta5/global.json new file mode 100644 index 0000000000..0f30dbdf7e --- /dev/null +++ b/samples/1.0.0-beta5/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "1.0.0-beta5" + } +} diff --git a/samples/latest/HelloMvc/Startup.cs b/samples/latest/HelloMvc/Startup.cs index d40f7a5e45..5f198a4dcb 100644 --- a/samples/latest/HelloMvc/Startup.cs +++ b/samples/latest/HelloMvc/Startup.cs @@ -1,5 +1,6 @@ using Microsoft.AspNet.Builder; using Microsoft.Framework.DependencyInjection; +using Microsoft.Framework.Logging; namespace HelloMvc { @@ -10,8 +11,10 @@ namespace HelloMvc services.AddMvc(); } - public void Configure(IApplicationBuilder app) + public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) { + loggerFactory.AddConsole(); + app.UseErrorPage(); app.UseMvcWithDefaultRoute(); diff --git a/samples/latest/HelloMvc/project.json b/samples/latest/HelloMvc/project.json index beefb0882e..4f05c1ff06 100644 --- a/samples/latest/HelloMvc/project.json +++ b/samples/latest/HelloMvc/project.json @@ -14,7 +14,8 @@ "Microsoft.AspNet.Diagnostics": "1.0.0-*", "Microsoft.AspNet.Mvc": "6.0.0-*", "Microsoft.AspNet.Server.IIS": "1.0.0-*", - "Microsoft.AspNet.Server.WebListener": "1.0.0-*" + "Microsoft.AspNet.Server.WebListener": "1.0.0-*", + "Microsoft.Framework.Logging.Console": "1.0.0-*" }, "commands": { "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5001", diff --git a/samples/latest/HelloWeb/Startup.cs b/samples/latest/HelloWeb/Startup.cs index 9ec77bc12c..76bfac0acb 100644 --- a/samples/latest/HelloWeb/Startup.cs +++ b/samples/latest/HelloWeb/Startup.cs @@ -1,11 +1,13 @@ using Microsoft.AspNet.Builder; +using Microsoft.Framework.Logging; namespace HelloWeb { public class Startup { - public void Configure(IApplicationBuilder app) + public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) { + loggerFactory.AddConsole(); app.UseStaticFiles(); app.UseWelcomePage(); } diff --git a/samples/latest/HelloWeb/project.json b/samples/latest/HelloWeb/project.json index 696a1a4755..cc43a02f00 100644 --- a/samples/latest/HelloWeb/project.json +++ b/samples/latest/HelloWeb/project.json @@ -15,7 +15,8 @@ "Microsoft.AspNet.Hosting": "1.0.0-*", "Microsoft.AspNet.Server.IIS": "1.0.0-*", "Microsoft.AspNet.Server.WebListener": "1.0.0-*", - "Microsoft.AspNet.StaticFiles": "1.0.0-*" + "Microsoft.AspNet.StaticFiles": "1.0.0-*", + "Microsoft.Framework.Logging.Console": "1.0.0-*" }, "commands": { "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5001", -- cgit v1.2.3