Documentation Index
Fetch the complete documentation index at: https://mintlify.com/aws-samples/legacy-cycle-store-mvc-app/llms.txt
Use this file to discover all available pages before exploring further.
Web.config is the primary configuration file for the Legacy Cycle Store, an ASP.NET MVC 4 application targeting .NET Framework 4.5. It controls everything from database connectivity and authentication behavior to error handling and JavaScript validation. All environment-specific values — database endpoints, credentials, and debug flags — live here and are transformed at deployment time via XML Document Transform (XDT) files.
Connection Strings
The application uses a single Entity Framework connection string namedCYCLE_STOREEntities. This is an ADO.NET Entity Framework metadata connection string that bundles both the EDM model paths and the underlying SQL Server connection details into one value.
The hostname of the Amazon RDS SQL Server instance, e.g.
sqlrdsdb.xxxxx.us-east-1.rds.amazonaws.com. This value is region-specific and is output by the CloudFormation stack as SQLDatabaseEndpoint.The SQL Server database name. Always set to
CYCLE_STORE for this application.The SQL Server login username. Corresponds to the
username field stored in the CycleStoreCredentials Secrets Manager secret (DBUser).The SQL Server login password. Corresponds to the
password field stored in the CycleStoreCredentials Secrets Manager secret. Never commit plaintext credentials to source control.Enables MARS, which allows multiple active result sets on a single connection. Required by Entity Framework when it opens multiple readers concurrently during lazy loading or complex queries.
Tags the connection in SQL Server’s activity monitor and Extended Events sessions for easier diagnostics.
App Settings
The<appSettings> block contains five keys that configure the ASP.NET runtime and MVC framework behavior.
Specifies the version of the ASP.NET Web Pages (Razor) assembly to load. Set to
2.0.0.0 to match the MVC 4 runtime, preventing assembly version conflicts at startup.When
false, the Web Pages framework is disabled and the application runs as a pure MVC app. Prevents accidental routing of .cshtml files directly as Web Pages.Instructs the runtime to preserve the original
ReturnUrl query string parameter through authentication redirects. Ensures users are returned to the page they originally requested after logging in.Enables client-side validation using the jQuery Validate library in conjunction with MVC’s
Html.ValidationMessageFor helpers. Validation attributes from data annotations are rendered as HTML5 data-val-* attributes.Enables unobtrusive JavaScript mode, where Ajax and validation behaviors are driven by
data-* HTML attributes rather than inline script blocks. Works in conjunction with ClientValidationEnabled.Forms Authentication
The application uses Forms Authentication to protect routes and manage user sessions. The cookie-based scheme redirects unauthenticated users to the login page and issues a secure authentication ticket upon successful login.The name of the HTTP cookie that carries the authentication ticket. Using a non-default name reduces the risk of cookie collisions when multiple ASP.NET applications share the same domain.
The route to which unauthenticated requests are redirected. Maps to
HomeController.Login.Specifies that the authentication cookie is both encrypted and validated (HMAC).
All is the most secure option and the recommended default.Session idle timeout in minutes.
43200 equals 30 days. Combined with slidingExpiration="true", the timeout resets on every authenticated request, keeping active users logged in indefinitely.When
true, the authentication ticket expiry is extended on each request, so the session only expires after timeout minutes of inactivity.The URL to redirect to after a successful login when no
ReturnUrl is present in the query string.Prevents the authentication system from following
ReturnUrl values that point outside the current application, mitigating open-redirect attacks.Membership Provider
User accounts are managed through ASP.NET Membership using the built-inSqlMembershipProvider. This provider stores hashed credentials in the ASP.NET membership schema tables (typically in a separate ASPNetDB database).
Points to a separate connection string (not shown above) that targets the ASP.NET membership database. This is distinct from
CYCLE_STOREEntities, which targets the product catalog.Scopes all membership records to this application name within the shared membership tables. Multiple applications can share the same membership database with different
applicationName values.Passwords are stored as salted SHA-1 hashes.
Hashed is the most secure of the three options (Clear, Encrypted, Hashed).Enforces that each registered email address maps to exactly one user account.
Password retrieval is disabled because hashed passwords cannot be reversed. Users must reset their password through a separate flow.
The minimum password length. Set to
1 for the legacy sample; tighten this in any production deployment.Custom Errors
When custom errors are enabled, ASP.NET intercepts HTTP error responses and redirects the browser to a friendly error page rather than exposing stack traces or IIS error details.404 Not Found and 500 Internal Server Error responses redirect to the ErrorController, which renders a generic error view. With mode="On", this behavior applies to all visitors including those accessing from localhost. Change to mode="RemoteOnly" during local debugging to see full exception details on your development machine while still showing friendly errors to remote users.
Target Framework
The<system.web> block pins the application to .NET Framework 4.5 for both runtime execution and compilation.
Instructs the ASP.NET runtime to use .NET 4.5 behavioral quirks mode, enabling breaking changes introduced in 4.5 (such as updated encoding behavior and async improvements).
Tells the Roslyn/C# compiler which framework version to target when compiling views and app code at runtime.
When
true, assemblies are compiled without optimization and script/CSS bundling is disabled. This must be set to false in production. The Web.Release.config transform handles this automatically.Config Transforms
The repository includes two XDT transform files that modifyWeb.config values at publish time without editing the base file directly.
Web.Debug.config is applied during local debug builds. It typically leaves settings unchanged or adds developer-specific overrides such as a local SQL Server connection string.
Web.Release.config is applied when publishing to a staging or production environment. It performs at minimum the following transforms:
debug="true" attribute from <compilation>, switching the runtime to release mode. Additional transforms can swap connection strings, update the RDS endpoint, and change authentication requireSSL to true for HTTPS-only deployments.
When migrating this application to ASP.NET Core,
Web.config is replaced by appsettings.json (and appsettings.Production.json for environment overrides). Connection strings, app settings, and authentication configuration all move to the new JSON format, and secrets should be managed via AWS Secrets Manager or environment variables rather than stored in configuration files.