The MVC layer of the applications has been converted to AspNet Core. This impacts all aspects of that project including the controllers, view models, models, authentication, routing, initialization, serialization and many other aspects of the application.
Main architecture differences in the AspNet Core server:
Main coding differences in the AspNet Core server:
For full development support, only Visual
Studio 2022 17.8.3and above is supported. You will also need to install
DotNet 8 SDKand
PNPM`.
The VueJs frontend and MVC controllers are now two separate projects. During development, you should start them both independently.
Visual Studio provides a startup configuration to ease this task.
When you press F5 (debug) both processes should be launched and the debugger should allow you to put breakpoints in the code.
The VueJs client has a small retry mechanism in case the server side is not responding. If it takes too long to startup you might need to refresh the browser manually.
Take into consideration that in development both processes are running in different TCP ports. Vite will proxy all API requests to the port where the Core process is running. This setup enables hot reloading for both client and server-side code edits, speeding up code development.
In production, the entire site will run from a single port.
[HttpParamAction]
[AuthorizeForUsers]
JsonRequestBehavior.AllowGet
JsonRequestBehavior.DenyGet
[AllowAnonymous]
return new JsonResult()
use return Json(data)
UserContext.Current
with the local m_userContext
UserContext
for all classes inheriting from:
ViewModelBase
ModelBase
GridTableList
UserContext
value to be passed by the parameter:
Find
All
Where
[FromBody]
attributeOld
[AuthorizeForUsers]
public ActionResult MyMethod(string id, string name, DateTime date) { }
New
public class MyMethodRequest
{
public string id {get;set;}
public string name {get;set;}
public DateTime date {get;set;}
}
public ActionResult MyMethod([FromBody] MyMethodRequest request) { }
ClientApp
has changed the directory, so if you have any copy files associated with your project you will need to move them from <output>/GenioMVC/ClientApp
to the new directory in <output>/ClientApp
.MVCAPI
for the Core version and keep the MVC
tagged code. Take into consideration that old MVC code will be increasingly deprecated so plan your migration accordingly.Asp Net Core applications can run directly from the command line, however this is not advised since it will lack any kind of recovery mechanism. In a Windows-based deployment, it is still best to deploy the application under IIS.
For an IIS deployment, the AspNet Core application should be published with the properties:
You should be able to target win-x64
but it should be equivalent to Portable
when running the publish operation in a Windows computer.
Due to the large reusability of the base framework, we do not advise at this point to publish in self-contained mode. Instead, install the .Net framework 8.0 runtime in the production system.
You will need to install the .NET Core Hosting Bundle
of the correct .Net 8.0 version, on the production machine.
When configuring the application pool, set the .Net Clr Version to No Managed Code
, and Managed pipeline mode to Integrated
.
Create a separate application pool for each AspNet Core application. Asp.Net core does not support multiple applications hosted in the same application pool.
Security in Core is significantly more strict, only Https deployments are supported. Authentication and other security features might simply refuse connections otherwise. If you are behind a reverse proxy, disabling https in the Core app might be necessary. To do so modify the appsettings.json file to the appropriate value of https_redirect
:
If your https port is not the default or if you have multiple port bindings then you might need to set that port with the property https_port
.
Note that AspNet Core does not natively use web.config, it uses appsettings.json. Some configurations have been routed to web.config for retro-compatibility, but not all will be observed by the application. The configuration sections recognized are:
All other configurations are only read by IIS or simply ignored.