Added first core clr enabled sample.

This commit is contained in:
David Fowler 2014-02-15 01:20:32 -08:00
parent 125ca080b5
commit 5ea11e396d
4 changed files with 17 additions and 4 deletions

View File

@ -2,11 +2,16 @@
namespace MvcSample.Web namespace MvcSample.Web
{ {
public class HomeController public class HomeController : Controller
{ {
public string Index() public string Index()
{ {
return "Hello World from MVC. Change the controller and save without rebuilding!!"; return "Hello from the new MVC";
}
public IActionResult Test()
{
return View();
} }
} }
} }

View File

@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection;
using Microsoft.AspNet.Abstractions; using Microsoft.AspNet.Abstractions;
using Microsoft.AspNet.DependencyInjection; using Microsoft.AspNet.DependencyInjection;
using Microsoft.AspNet.Mvc.Routing; using Microsoft.AspNet.Mvc.Routing;
@ -13,7 +14,11 @@ namespace MvcSample.Web
{ {
public void Configuration(IBuilder app) public void Configuration(IBuilder app)
{ {
string appRoot = AppDomain.CurrentDomain.SetupInformation.ApplicationBase; #if NET45
var appRoot = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
#else
var appRoot = (string)typeof(AppDomain).GetRuntimeMethod("GetData", new[] { typeof(string) }).Invoke(AppDomain.CurrentDomain, new object[] { "APPBASE" });
#endif
var mvcServices = new MvcServices(appRoot); var mvcServices = new MvcServices(appRoot);

View File

@ -0,0 +1 @@
Hello From Razor

View File

@ -1,6 +1,8 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<configuration> <configuration>
<appSettings>
<add key="K" value="true" />
</appSettings>
<system.web> <system.web>
<compilation debug="true" targetFramework="4.5" /> <compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" /> <httpRuntime targetFramework="4.5" />