Skip to content

Commit 8106fc8

Browse files
committed
Add beta5, add console logger to web and mvc so that you can see the URL that we listen on.
1 parent e7e8e98 commit 8106fc8

23 files changed

+333
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
</PropertyGroup>
7+
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
8+
<PropertyGroup Label="Globals">
9+
<ProjectGuid>d4f684c8-b6a4-45f0-aca0-0d95632ff946</ProjectGuid>
10+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
11+
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
12+
</PropertyGroup>
13+
<PropertyGroup>
14+
<SchemaVersion>2.0</SchemaVersion>
15+
</PropertyGroup>
16+
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
17+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using System;
2+
3+
public class Program
4+
{
5+
public static void Main()
6+
{
7+
Console.WriteLine("Hello World");
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"dependencies": {
3+
4+
},
5+
"commands": {
6+
"ConsoleApp": "ConsoleApp"
7+
},
8+
"frameworks": {
9+
"dnx451": { },
10+
"dnxcore50": {
11+
"dependencies": {
12+
"System.Console": "4.0.0-beta-23019"
13+
}
14+
}
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using Microsoft.AspNet.Mvc;
2+
using MvcSample.Web.Models;
3+
4+
namespace MvcSample.Web
5+
{
6+
public class HomeController : Controller
7+
{
8+
public IActionResult Index()
9+
{
10+
return View(CreateUser());
11+
}
12+
13+
public User CreateUser()
14+
{
15+
User user = new User()
16+
{
17+
Name = "My name",
18+
Address = "My address"
19+
};
20+
21+
return user;
22+
}
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
</PropertyGroup>
7+
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
8+
<PropertyGroup Label="Globals">
9+
<ProjectGuid>78627bb3-851e-4c1a-91c0-629fc7c15f8f</ProjectGuid>
10+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
11+
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
12+
</PropertyGroup>
13+
<PropertyGroup>
14+
<SchemaVersion>2.0</SchemaVersion>
15+
<DevelopmentServerPort>26425</DevelopmentServerPort>
16+
</PropertyGroup>
17+
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
18+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System.ComponentModel.DataAnnotations;
2+
3+
namespace MvcSample.Web.Models
4+
{
5+
public class User
6+
{
7+
[Required]
8+
[MinLength(4)]
9+
public string Name { get; set; }
10+
public string Address { get; set; }
11+
public int Age { get; set; }
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"profiles": {
3+
"IIS Express": {
4+
"commandName": "IISExpress",
5+
"launchBrowser": true,
6+
"environmentVariables": {
7+
"ASPNET_ENV": "Development"
8+
}
9+
},
10+
"kestrel": {
11+
"commandName": "kestrel",
12+
"launchBrowser": true,
13+
"launchUrl": "http://localhost:5004"
14+
},
15+
"web": {
16+
"commandName": "web",
17+
"launchBrowser": true,
18+
"launchUrl": "http://localhost:5001"
19+
}
20+
}
21+
}
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using Microsoft.AspNet.Builder;
2+
using Microsoft.Framework.DependencyInjection;
3+
using Microsoft.Framework.Logging;
4+
5+
namespace HelloMvc
6+
{
7+
public class Startup
8+
{
9+
public void ConfigureServices(IServiceCollection services)
10+
{
11+
services.AddMvc();
12+
}
13+
14+
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
15+
{
16+
loggerFactory.AddConsole();
17+
18+
app.UseErrorPage();
19+
20+
app.UseMvcWithDefaultRoute();
21+
22+
app.UseWelcomePage();
23+
}
24+
}
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@using MvcSample.Web.Models
2+
@model User
3+
@{
4+
Layout = "/Views/Shared/_Layout.cshtml";
5+
ViewBag.Title = "Home Page";
6+
string helloClass = null;
7+
}
8+
9+
<div class="jumbotron">
10+
<h1>ASP.NET</h1>
11+
<p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.</p>
12+
<p><a href="http://asp.net" class="btn btn-primary btn-large">Learn more &raquo;</a></p>
13+
</div>
14+
<div class="row">
15+
<h3 title="@Model.Name" class="@helloClass">Hello @Model.Name!</h3>
16+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>@ViewBag.Title - My ASP.NET Application</title>
7+
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" />
8+
</head>
9+
<body>
10+
<div class="navbar navbar-inverse navbar-fixed-top">
11+
<div class="container">
12+
<div class="navbar-header">
13+
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
14+
<span class="icon-bar"></span>
15+
<span class="icon-bar"></span>
16+
<span class="icon-bar"></span>
17+
</button>
18+
</div>
19+
<div class="navbar-collapse collapse">
20+
<ul class="nav navbar-nav">
21+
<li><a href="/">Home</a></li>
22+
</ul>
23+
</div>
24+
</div>
25+
</div>
26+
<div class="container body-content">
27+
@RenderBody()
28+
<hr />
29+
<address>
30+
@if (@Model != null)
31+
{
32+
@Model.Address
33+
}
34+
</address>
35+
<footer>
36+
<p>&copy; @DateTime.Now.Year - My ASP.NET Application</p>
37+
</footer>
38+
</div>
39+
</body>
40+
</html>
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"version": "1.0.0-*",
3+
"webroot": "wwwroot",
4+
"exclude": [
5+
"wwwroot"
6+
],
7+
"packExclude": [
8+
"**.kproj",
9+
"**.user",
10+
"**.vspscc"
11+
],
12+
"dependencies": {
13+
"Kestrel": "1.0.0-beta5",
14+
"Microsoft.AspNet.Diagnostics": "1.0.0-beta5",
15+
"Microsoft.AspNet.Mvc": "6.0.0-beta5",
16+
"Microsoft.AspNet.Server.IIS": "1.0.0-beta5",
17+
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta5",
18+
"Microsoft.Framework.Logging.Console": "1.0.0-beta5"
19+
},
20+
"commands": {
21+
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5001",
22+
"kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5004"
23+
},
24+
"frameworks": {
25+
"dnx451": { },
26+
"dnxcore50": { }
27+
}
28+
}
303 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
</PropertyGroup>
7+
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
8+
<PropertyGroup Label="Globals">
9+
<ProjectGuid>8d4b2ab5-c2d2-4ee0-b751-f4126c7d0539</ProjectGuid>
10+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
11+
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
12+
</PropertyGroup>
13+
<PropertyGroup>
14+
<SchemaVersion>2.0</SchemaVersion>
15+
<DevelopmentServerPort>26235</DevelopmentServerPort>
16+
</PropertyGroup>
17+
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
18+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"profiles": {
3+
"IIS Express": {
4+
"commandName": "IISExpress",
5+
"launchBrowser": true,
6+
"environmentVariables": {
7+
"ASPNET_ENV": "Development"
8+
}
9+
},
10+
"kestrel": {
11+
"commandName": "kestrel",
12+
"launchBrowser": true,
13+
"launchUrl": "http://localhost:5004"
14+
},
15+
"web": {
16+
"commandName": "web",
17+
"launchBrowser": true,
18+
"launchUrl": "http://localhost:5001"
19+
}
20+
}
21+
}
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using Microsoft.AspNet.Builder;
2+
using Microsoft.Framework.Logging;
3+
4+
namespace HelloWeb
5+
{
6+
public class Startup
7+
{
8+
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
9+
{
10+
loggerFactory.AddConsole();
11+
app.UseStaticFiles();
12+
app.UseWelcomePage();
13+
}
14+
}
15+
}
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"version": "1.0.0-*",
3+
"webroot": "wwwroot",
4+
"exclude": [
5+
"wwwroot"
6+
],
7+
"packExclude": [
8+
"**.kproj",
9+
"**.user",
10+
"**.vspscc"
11+
],
12+
"dependencies": {
13+
"Kestrel": "1.0.0-beta5",
14+
"Microsoft.AspNet.Diagnostics": "1.0.0-beta5",
15+
"Microsoft.AspNet.Hosting": "1.0.0-beta5",
16+
"Microsoft.AspNet.Server.IIS": "1.0.0-beta5",
17+
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta5",
18+
"Microsoft.AspNet.StaticFiles": "1.0.0-beta5",
19+
"Microsoft.Framework.Logging.Console": "1.0.0-beta5"
20+
},
21+
"commands": {
22+
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5001",
23+
"kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5004"
24+
},
25+
"frameworks": {
26+
"dnx451": { },
27+
"dnxcore50": { }
28+
}
29+
}
303 KB
Loading

samples/1.0.0-beta5/NuGet.Config

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="NuGetorg" value="https://nuget.org/api/v2/" />
6+
</packageSources>
7+
</configuration>

samples/1.0.0-beta5/global.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sdk": {
3+
"version": "1.0.0-beta5"
4+
}
5+
}

samples/latest/HelloMvc/Startup.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Microsoft.AspNet.Builder;
22
using Microsoft.Framework.DependencyInjection;
3+
using Microsoft.Framework.Logging;
34

45
namespace HelloMvc
56
{
@@ -10,8 +11,10 @@ public void ConfigureServices(IServiceCollection services)
1011
services.AddMvc();
1112
}
1213

13-
public void Configure(IApplicationBuilder app)
14+
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
1415
{
16+
loggerFactory.AddConsole();
17+
1518
app.UseErrorPage();
1619

1720
app.UseMvcWithDefaultRoute();

samples/latest/HelloMvc/project.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"Microsoft.AspNet.Diagnostics": "1.0.0-*",
1515
"Microsoft.AspNet.Mvc": "6.0.0-*",
1616
"Microsoft.AspNet.Server.IIS": "1.0.0-*",
17-
"Microsoft.AspNet.Server.WebListener": "1.0.0-*"
17+
"Microsoft.AspNet.Server.WebListener": "1.0.0-*",
18+
"Microsoft.Framework.Logging.Console": "1.0.0-*"
1819
},
1920
"commands": {
2021
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5001",

samples/latest/HelloWeb/Startup.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
using Microsoft.AspNet.Builder;
2+
using Microsoft.Framework.Logging;
23

34
namespace HelloWeb
45
{
56
public class Startup
67
{
7-
public void Configure(IApplicationBuilder app)
8+
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
89
{
10+
loggerFactory.AddConsole();
911
app.UseStaticFiles();
1012
app.UseWelcomePage();
1113
}

0 commit comments

Comments
 (0)