# AGENTS.md ## Project identity This project is **Plataforma de Desarrolladores Agua Hillo**. It is an **ASP.NET WebForms** application using **C#** and **.NET Framework 4.8 or 4.8.1**. Do **not** convert this project to: - ASP.NET Core - Razor Pages - MVC Core - Blazor - Minimal APIs - Angular-only app - Web API-only app ASP.NET WebForms must stay on .NET Framework. If a command, package, or template requires ASP.NET Core, do not use it for this project. --- ## Main goal Create a clean WebForms starter project from zero, keeping the same Metronic visual style and only the necessary bundle methods used by the master page and login page. The project must use a contract/service structure so pages, master page, login, menu, user session, and future modules do not connect directly to database classes. Target architecture: ```text ASPX / Master Page / User Controls ↓ Contracts ↓ Services ↓ Repositories / SQL helpers ↓ Database ``` --- ## Language rules - All new code must be **C#**. - Do not add VB.NET files. - Do not add `.vb` files to the active project. - Old VB files may exist only as migration reference files using `.vb.txt`. - Do not use VB comment syntax in C# files. - Do not use JavaScript/CSS/Powershell comments as C# comments. --- ## Command rules When giving commands for this project: - Prefer **PowerShell**, **Developer PowerShell**, or **Visual Studio Package Manager Console** commands. - Commands must be written in **one line**. - Do not use PowerShell line continuation with backticks. - Do not suggest `dotnet new webforms` because WebForms is not supported by the .NET CLI as an ASP.NET Core project. - If a WebForms project must be created from command line, use Visual Studio/MSBuild-compatible project files or create the project through Visual Studio using **ASP.NET Web Application (.NET Framework)**. - Target framework must be `.NET Framework 4.8` or `.NET Framework 4.8.1`. Recommended project creation path: ```powershell mkdir "C:\Proyectos\Agua de hermosillo\Plataforma de Desarrolladores" ``` ```powershell cd "C:\Proyectos\Agua de hermosillo\Plataforma de Desarrolladores" ``` Then create/open the WebForms project in Visual Studio 2022 as: ```text ASP.NET Web Application (.NET Framework) → Web Forms → C# → .NET Framework 4.8/4.8.1 ``` --- ## Project folder rules Use this base structure: ```text SIG.Web/ AppCode/ Infrastructure/ Sql/ Repositories/ Security/ Utilities/ Contracts/ Models/ Services/ Styles/ Scripts/ Metronic/ Site.master Site.master.cs Login.aspx Login.aspx.cs Inicio.aspx Inicio.aspx.cs BundleConfig.cs Global.asax Global.asax.cs Web.config ``` Rules: - Do not place database access directly inside `.aspx.cs`, `.ascx.cs`, or `Site.master.cs`. - Database-related helpers go under `App_Code/Sql` or a clearly named SQL/data folder. - Business access goes through `Contracts` and `Services`. - If the project file needs explicit compilation entries, include C# files recursively, for example `App_Code\**\*.cs`, but avoid duplicate compile entries that include the same file twice. --- ## Asset folder rules The following folders are legacy visual dependencies and must be copied as complete folders: ```text Styles/ Scripts/ Metronic/ ``` Do not replace Metronic with Bootstrap-only layout. Do not upgrade Metronic unless the user explicitly asks. Do not remove old scripts just because they look unused; only remove references from bundles when they are not used by the master/login flow. --- ## Bundle rules The project must implement only the bundle methods needed by the current `Site.master` and login page. Do not bring every old bundle method from the legacy project. Do not add unused bundle groups just because they existed before. Do not add duplicate bundle keys. Do not add empty bundle methods. Allowed current bundle keys are the ones actually rendered by master/login, especially: ```text ~/bundles/modernizr ~/bundles/scripts ~/bundles/highcharts ~/Metronic/assets/global/scripts/JSV1 ~/Metronic/assets/global/css/cssV1 ``` WebForms/AjaxControlToolkit support bundles are allowed only when referenced by `ScriptManager` or required by WebForms controls: ```text ~/bundles/jquery ~/bundles/WebFormsJs ~/bundles/MsAjaxJs ~/Content/AjaxControlToolkit/Styles/Bundle ``` Rules: - If `Site.master` or `Login.aspx` does not render a bundle, do not add it. - If a bundle exists only for old pages not migrated yet, leave it out until the page needs it. - Prefer preserving original asset paths from `Styles`, `Scripts`, and `Metronic`. - Use `CssRewriteUrlTransform` for CSS bundles that reference fonts, images, or relative URLs. - Do not register CSS/JS from server controls when the style/script is global; use `BundleConfig` and the master page. --- ## WebForms page rules All normal `.aspx` pages must use `Site.master`, except the login page. Normal pages: - Must include `MasterPageFile="~/Site.master"`. - Must not include ``, `
`, ``, or `