diff --git a/App_Start/BundleConfig.cs b/App_Start/BundleConfig.cs deleted file mode 100644 index 13718c4..0000000 --- a/App_Start/BundleConfig.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Optimization; - -public class BundleConfig -{ - public static void RegisterBundles(BundleCollection bundles) - { - // Bundle JavaScript files. - bundles.Add(new ScriptBundle("~/bundles/scripts") - .Include("~/node_modules/jquery/dist/jquery.min.js") - .Include("~/node_modules/angular/angular.min.js") - .IncludeDirectory("~/WebApp", "*.js", false) - .IncludeDirectory("~/WebApp/Components", "*.js", true) - .IncludeDirectory("~/WebApp/Directives", "*.js", true)); - - // Bundles CSS files - bundles.Add(new StyleBundle("~/bundles/styles") - .IncludeDirectory("~/Content", "*.css", true) - .IncludeDirectory("~/WebApp", "*.css", true)); - } -} diff --git a/App_Start/RouteConfig.cs b/App_Start/RouteConfig.cs deleted file mode 100644 index 336e299..0000000 --- a/App_Start/RouteConfig.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Mvc; -using System.Web.Routing; - -namespace asp_net_angularjs -{ - public class RouteConfig - { - public static void RegisterRoutes(RouteCollection routes) - { - routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); - - routes.MapRoute( - name: "Landing", - url: "", - defaults: new { controller = "Landing", action = "Index", id = UrlParameter.Optional } - ); - } - } -} diff --git a/Controllers/LandingController.cs b/Controllers/LandingController.cs index 2888a1c..d476208 100644 --- a/Controllers/LandingController.cs +++ b/Controllers/LandingController.cs @@ -1,16 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Mvc; +using Microsoft.AspNetCore.Mvc; namespace asp_net_angularjs.Controllers { - public class LandingController : Controller - { - public ActionResult Index() + public class LandingController : Controller { - return View(); + public IActionResult Index() + { + return View(); + } } - } } diff --git a/Global.asax b/Global.asax deleted file mode 100644 index 5a72af9..0000000 --- a/Global.asax +++ /dev/null @@ -1 +0,0 @@ -<%@ Application Codebehind="Global.asax.cs" Inherits="asp_net_angularjs.MvcApplication" Language="C#" %> diff --git a/Global.asax.cs b/Global.asax.cs deleted file mode 100644 index 4d07a6e..0000000 --- a/Global.asax.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Web.Mvc; -using System.Web.Routing; -using System.Web.Optimization; - -namespace asp_net_angularjs -{ - public class MvcApplication : System.Web.HttpApplication - { - protected void Application_Start() - { - AreaRegistration.RegisterAllAreas(); - RouteConfig.RegisterRoutes(RouteTable.Routes); - BundleConfig.RegisterBundles(BundleTable.Bundles); - } - } -} diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..8430366 --- /dev/null +++ b/Program.cs @@ -0,0 +1,36 @@ +using Microsoft.Extensions.FileProviders; + +var builder = WebApplication.CreateBuilder(args); + +builder.Services.AddControllersWithViews(); + +var app = builder.Build(); + +if (!app.Environment.IsDevelopment()) +{ + app.UseExceptionHandler("/Home/Error"); + app.UseHsts(); +} + +app.UseHttpsRedirection(); +app.UseStaticFiles(); + +app.UseStaticFiles(new StaticFileOptions +{ + FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "WebApp")), + RequestPath = "/WebApp" +}); + +app.UseStaticFiles(new StaticFileOptions +{ + FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "node_modules")), + RequestPath = "/node_modules" +}); + +app.UseRouting(); + +app.MapControllerRoute( + name: "default", + pattern: "{controller=Landing}/{action=Index}/{id?}"); + +app.Run(); diff --git a/Views/Landing/Index.cshtml b/Views/Landing/Index.cshtml index 92d72ed..a8b4e6d 100644 --- a/Views/Landing/Index.cshtml +++ b/Views/Landing/Index.cshtml @@ -1,5 +1,4 @@ -@using System.Web.Optimization @{ Layout = null; } @@ -11,15 +10,21 @@ - XLTS for AngularJS with .NET Framework + XLTS for AngularJS with .NET 7 - @Styles.Render("~/bundles/styles") - @Scripts.Render("~/bundles/scripts") + + + + + + + + -

XLTS for AngularJS with .NET Framework

+

XLTS for AngularJS with .NET 7

diff --git a/Views/web.config b/Views/web.config deleted file mode 100644 index 4502e7d..0000000 --- a/Views/web.config +++ /dev/null @@ -1,42 +0,0 @@ - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Web.config b/Web.config deleted file mode 100644 index cf8e2f3..0000000 --- a/Web.config +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/angularjs-asp-net48-mvc5.csproj b/angularjs-asp-net48-mvc5.csproj index 2d3d3e0..3c9f2a3 100644 --- a/angularjs-asp-net48-mvc5.csproj +++ b/angularjs-asp-net48-mvc5.csproj @@ -1,177 +1,22 @@ - - + + - Debug - AnyCPU - - - 2.0 - {43046E18-F0D2-4443-98D5-4650BDCB3A8B} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties + net7.0 asp_net_angularjs asp-net-angularjs - v4.8 - true - - - - - - - - - packages\WebGrease.1.5.2\lib + enable + enable + false - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - - - true - pdbonly - true - bin\ - TRACE - prompt - 4 - - - - packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll - - - packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.3.6.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll - - - - packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - - packages\Newtonsoft.Json.5.0.4\lib\net45\Newtonsoft.Json.dll - - - - - - - - - - - - packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll - - - packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll - - - packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll - - - packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll - - - packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.dll - - - packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Deployment.dll - - - packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll - - - - - - - - - - packages\WebGrease.1.5.2\lib\WebGrease.dll - - - - - - - - - - - - - - - - - - - - - - Global.asax - - - + - - - - - Web.config - - - Web.config - + + - - + + + - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - True - True - 0 - / - http://localhost:51267/ - False - False - - - False - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - + diff --git a/appsettings.json b/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/packages.config b/packages.config deleted file mode 100644 index a35fc87..0000000 --- a/packages.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - -