diff --git a/samples/MvcSample.Web/HomeController.cs b/samples/MvcSample.Web/HomeController.cs index 427e1e9c32..42854ec242 100644 --- a/samples/MvcSample.Web/HomeController.cs +++ b/samples/MvcSample.Web/HomeController.cs @@ -2,11 +2,16 @@ namespace MvcSample.Web { - public class HomeController + public class HomeController : Controller { 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(); } } } \ No newline at end of file diff --git a/samples/MvcSample.Web/Startup.cs b/samples/MvcSample.Web/Startup.cs index 5814be2e8b..d6ab3c79ff 100644 --- a/samples/MvcSample.Web/Startup.cs +++ b/samples/MvcSample.Web/Startup.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Reflection; using Microsoft.AspNet.Abstractions; using Microsoft.AspNet.DependencyInjection; using Microsoft.AspNet.Mvc.Routing; @@ -13,7 +14,11 @@ namespace MvcSample.Web { 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); diff --git a/samples/MvcSample.Web/Views/Home/Test.cshtml b/samples/MvcSample.Web/Views/Home/Test.cshtml new file mode 100644 index 0000000000..4f466c7c3f --- /dev/null +++ b/samples/MvcSample.Web/Views/Home/Test.cshtml @@ -0,0 +1 @@ +Hello From Razor \ No newline at end of file diff --git a/samples/MvcSample.Web/web.config b/samples/MvcSample.Web/web.config index 787aa09c3f..7bab44e5cd 100644 --- a/samples/MvcSample.Web/web.config +++ b/samples/MvcSample.Web/web.config @@ -1,6 +1,8 @@  - + + +