containerize-aspnet-framework▌
github/awesome-copilot · updated Apr 8, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
Generate Dockerfile and configuration files to containerize an ASP.NET .NET Framework application for Windows containers.
- ›Detects .NET Framework version from project file and selects appropriate Windows Server base images (Core or Full, versions 2016–2022)
- ›Modifies web.config to enable environment variable configuration via ConfigurationBuilders for app settings and connection strings
- ›Creates multi-stage Dockerfile with separate build (SDK) and runtime (ASP.NET) stages, including Log
ASP.NET .NET Framework Containerization Prompt
Containerize the ASP.NET (.NET Framework) project specified in the containerization settings below, focusing exclusively on changes required for the application to run in a Windows Docker container. Containerization should consider all settings specified here.
REMEMBER: This is a .NET Framework application, not .NET Core. The containerization process will be different from that of a .NET Core application.
Containerization Settings
This section of the prompt contains the specific settings and configurations required for containerizing the ASP.NET (.NET Framework) application. Prior to running this prompt, ensure that the settings are filled out with the necessary information. Note that in many cases, only the first few settings are required. Later settings can be left as defaults if they do not apply to the project being containerized.
Any settings that are not specified will be set to default values. The default values are provided in [square brackets].
Basic Project Information
-
Project to containerize:
[ProjectName (provide path to .csproj file)]
-
Windows Server SKU to use:
[Windows Server Core (Default) or Windows Server Full]
-
Windows Server version to use:
[2022, 2019, or 2016 (Default 2022)]
-
Custom base image for the build stage of the Docker image ("None" to use standard Microsoft base image):
[Specify base image to use for build stage (Default None)]
-
Custom base image for the run stage of the Docker image ("None" to use standard Microsoft base image):
[Specify base image to use for run stage (Default None)]
Container Configuration
-
Ports that must be exposed in the container image:
- Primary HTTP port:
[e.g., 80] - Additional ports:
[List any additional ports, or "None"]
- Primary HTTP port:
-
User account the container should run as:
[User account, or default to "ContainerUser"]
-
IIS settings that must be configured in the container image:
[List any specific IIS settings, or "None"]
Build configuration
-
Custom build steps that must be performed before building the container image:
[List any specific build steps, or "None"]
-
Custom build steps that must be performed after building the container image:
[List any specific build steps, or "None"]
Dependencies
-
.NET assemblies that should be registered in the GAC in the container image:
[Assembly name and version, or "None"]
-
MSIs that must be copied to the container image and installed:
[MSI names and versions, or "None"]
-
COM components that must be registered in the container image:
[COM component names, or "None"]
System Configuration
-
Registry keys and values that must be added to the container image:
[Registry paths and values, or "None"]
-
Environment variables that must be set in the container image:
[Variable names and values, or "Use defaults"]
-
Windows Server roles and features that must be installed in the container image:
[Role/feature names, or "None"]
File System
-
Files/directories that need to be copied to the container image:
[Paths relative to project root, or "None"]- Target location in container:
[Container paths, or "Not applicable"]
-
Files/directories to exclude from containerization:
[Paths to exclude, or "None"]
.dockerignore Configuration
- Patterns to include in the
.dockerignorefile (.dockerignore will already have common defaults; these are additional patterns):- Additional patterns:
[List any additional patterns, or "None"]
- Additional patterns:
Health Check Configuration
-
Health check endpoint:
[Health check URL path, or "None"]
-
Health check interval and timeout:
[Interval and timeout values, or "Use defaults"]
Additional Instructions
-
Other instructions that must be followed to containerize the project:
[Specific requirements, or "None"]
-
Known issues to address:
[Describe any known issues, or "None"]
Scope
- ✅ App configuration modification to ensure config builders are used to read app settings and connection strings from the environment variables
- ✅ Dockerfile creation and configuration for an ASP.NET application
- ✅ Specifying multiple stages in the Dockerfile to build/publish the application and copy the output to the final image
- ✅ Configuration of Windows container platform compatibility (Windows Server Core or Full)
- ✅ Proper handling of dependencies (GAC assemblies, MSIs, COM components)
- ❌ No infrastructure setup (assumed to be handled separately)
- ❌ No code changes beyond those required for containerization
Execution Process
- Review the containerization settings above to understand the containerization requirements
- Create a
progress.mdfile to track changes with check marks - Determine the .NET Framework version from the project's .csproj file by checking the
TargetFrameworkVersionelement - Select the appropriate Windows Server container image based on:
- The .NET Framework version detected from the project
- The Windows Server SKU specified in containerization settings (Core or Full)
- The Windows Server version specified in containerization settings (2016, 2019, or 2022)
- Windows Server Core tags can be found at: https://github.com/microsoft/dotnet-framework-docker/blob/main/README.aspnet.md#full-tag-listing
- Ensure that required NuGet packages are installed. DO NOT install these if they are missing. If they are not installed, the user must install them manually. If they are not installed, pause executing this prompt and ask the user to install them using the Visual Studio NuGet Package Manager or Visual Studio package manager console. The following packages are required:
Microsoft.Configuration.ConfigurationBuilders.Environment
- Modify the
web.configfile to add configuration builders section and settings to read app settings and connection strings from environment variables:- Add ConfigBuilders section in configSections
- Add configBuilders section in the root
- Configure EnvironmentConfigBuilder for both appSettings and connectionStrings
- Example pattern:
<configSections> <section name="configBuilders" type="System.Configuration.ConfigurationBuildersSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" restartOnExternalChanges="false" requirePermission="false" /> </configSections> <configBuilders> <builders> <add name="Environment" type="Microsoft.Configuration.ConfigurationBuilders.EnvironmentConfigBuilder, Microsoft.Configuration.ConfigurationBuilders.Environment" /> </builders> </configBuilders> <appSettings configBuilders="Environment"> <!-- existing app settings --> </appSettings> <connectionStrings configBuilders="Environment"> <!-- existing connection strings --> </connectionStrings>
- Create a
LogMonitorConfig.jsonfile in the folder where the Dockerfile will be created by copying the referenceLogMonitorConfig.jsonfile at the end of this prompt. The file's contents MUST NOT not be modified and should match the reference content exactly unless instructions in containerization settings specify otherwise.- In particular, make sure the level of issues to be logged is not changed as using
Informationlevel for EventLog sources will cause unnecessary noise.
- In particular, make sure the level of issues to be logged is not changed as using
- Create a Dockerfile in the root of the project directory to containerize the application
- The Dockerfile should use multiple stages:
- Build stage: Use a Windows Server Core image to build the application
- The build stage MUST use a
mcr.microsoft.com/dotnet/framework/sdkbase image unless a custom base image is specified in the settings file - Copy sln, csproj, and packages.config files first
- Copy NuGet.config if one exists and configure any private feeds
- Restore NuGet packages
- Then, copy the rest of the source code and build and publish the application to C:\publish using MSBuild
- The build stage MUST use a
- Final stage: Use the selected Windows Server image to run the application
- The final stage MUST use a
mcr.microsoft.com/dotnet/framework/aspnetbase image unless a custom base image is specified in the settings file - Copy the
LogMonitorConfig.jsonfile to a directory in the container (e.g., C:\LogMonitor) - Download LogMonitor.exe from the Microsoft repository to the same directory
- The correct LogMonitor.exe URL is: https://github.com/microsoft/windows-container-tools/releases/download/v2.1.1/LogMonitor.exe
- Set the working directory to C:\inetpub\wwwroot
- Copy the published output from the build stage (in C:\publish) to the final image
- Set the container's entry point to run LogMonitor.exe with ServiceMonitor.exe to monitor the IIS service
ENTRYPOINT [ "C:\\LogMonitor\\LogMonitor.exe", "C:\\ServiceMonitor.exe", "w3svc" ]
- The final stage MUST use a
- Build stage: Use a Windows Server Core image to build the application
- Be sure to consider all requirements in the containerization settings:
- Windows Server SKU and version
- Exposed ports
- User account for container
- IIS settings
- GAC assembly registration
- MSI installation
- COM component registration
- Registry keys
- Environment variables
- Windows roles and features
- File/directory copying
- Model the Dockerfile after the example provided at the end of this prompt, but ensure it is customized to the specific project requirements and settings.
- IMPORTANT: Use a Windows Server Core base image unless the user has specifically requested a full Windows Server image in the settings file
- The Dockerfile should use multiple stages:
- Create a
.dockerignorefile in the root of the project directory to exclude unnecessary files from the Docker image. The.dockerignorefile MUST include at least the following elements as well as additional patterns as specified in the containerization settings:- packages/
- bin/
- obj/
- .dockerignore
- Dockerfile
- .git/
- .github/
- .vs/
- .vscode/
- **/node_modules/
- *.user
- *.suo
- **/.DS_Store
- **/Thumbs.db
- Any additional patterns specified in the containerization settings
- Configure health checks if specified in the settings:
- Add HEALTHCHECK instruction to Dockerfile if health check endpoint is provided
- Add the dockerfile to the project by adding the following item to the project file:
<None Include="Dockerfile" /> - Mark tasks as completed: [ ] → [✓]
- Continue until all tasks are complete and Docker build succeeds
Build and Runtime Verification
confirm that Docker build succeeds once the Dockerfile is completed. Use the following command to build the Docker image:
docker build -t aspnet-app:latest .
If the build fails, review the error messages and make necessary adjustments to the Dockerfile or project configuration. Report success/failure.
Progress Tracking
Maintain a progress.md file with the following structure:
# Containerization Progress
## Environment Detection
- [ ] .NET Framework version detection (version: ___)
- [ ] Windows Server SKU selection (SKU: ___)
- [ ] Windows Server version selection (Version: ___)
## Configuration Changes
- [ ] Web.config modifications for configuration builders
- [ ] NuGet package source configuration (if applicable)
- [ ] Copy LogMonitorConfig.json and adjust if required by settings
## Containerization
- [ ] Dockerfile creation
- [ ] .dockerignore file creation
- [ ] Build stage created with SDK image
- [ ] sln, csproj, packages.config, and (if applicable) NuGet.config copied for package restore
- [ ] Runtime stage created with runtime image
- [ ] Non-root user configuration
- [ ] Dependency handling (GAC, MSI, COM, registry, additional files, etc.)
- [ ] Health check configuration (if applicable)
- [ ] Special requirements implementation
## Verification
- [ ] Review containerization settings and make sure that all requirements are met
- [ ] Docker build success
Do not pause for confirmation between steps. Continue methodically until the application has been containerized and Docker build succeeds.
YOU ARE NOT DONE UNTIL ALL CHECKBOXES ARE MARKED! This includes building the Docker image successfully and addressing any issues that arise during the build process.
Reference Materials
Example Dockerfile
An example Dockerfile for an ASP.NET (.NET Framework) application using a Windows Server Core base image.
# escape=`
# The escape directive changes the escape character from \ to `
# This is especially useful in Windows Dockerfiles where \ is the path separator
# ============================================================
# Stage 1: Build and publish the application
# ============================================================
# Base Image - Select the appropriate .NET Framework version and Windows Server Core version
# Possible tags include:
# - 4.8.1-windowsservercore-ltsc2025 (Windows Server 2025)
# - 4.8-windowsservercore-ltsc2022 (Windows Server 2022)
# - 4.8-windowsservercore-ltsc2019 (Windows Server 2019)
# - 4.8-windowsservercore-ltsc2016 (Windows Server 2016)
# - 4.7.2-windowsservercore-ltsc2019 (Windows Server 2019)
# - 4.7.2-windowsservercore-ltsc2016 (Windows Server 2016)
# - 4.7.1-windowsservercore-ltsc2016 (Windows Server 2016)
# - 4.7-windowsservercore-ltsc2016 (Windows Server 2016)
# - 4.6.2-windowsservercore-ltsc2016 (Windows Server 2016)
# - 3.5-windowsservercore-ltsc2025 (Windows Server 2025)
# - 3.5-windowsservercore-ltsc2022 (Windows Server 2022)
# - 3.5-windowsservercore-ltsc2019 (Windows How to use containerize-aspnet-framework on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your development machine
- ›Node.js version 16.0+ with npm package manager (verify with
node --version) - ›Active project directory or workspace where you want to add containerize-aspnet-framework
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches containerize-aspnet-framework from GitHub repository github/awesome-copilot and configures it for Cursor.
Select Cursor when prompted
The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Reload or restart Cursor to activate containerize-aspnet-framework. Access the skill through slash commands (e.g., /containerize-aspnet-framework) or your agent's skill management interface.
Security & Verification Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases▌
Task Automation & Efficiency
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Knowledge Enhancement
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Quality Improvement
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
Implementation Guide▌
Prerequisites
- ›Claude Desktop or compatible AI client with skill support
- ›Clear understanding of task or problem to solve
- ›Willingness to iterate and refine outputs
Time Estimate
15-45 minutes depending on use case complexity
Installation Steps
- 1.Install skill using provided installation command
- 2.Test with simple use case relevant to your work
- 3.Evaluate output quality and relevance
- 4.Iterate on prompts to improve results
- 5.Integrate into regular workflow if valuable
Common Pitfalls
- ⚠Expecting perfect results without iteration
- ⚠Not providing enough context in prompts
- ⚠Using skill for tasks outside its intended scope
- ⚠Accepting outputs without review and validation
Best Practices▌
✓ Do
- +Start with clear, specific prompts
- +Provide relevant context and constraints
- +Review and refine all outputs before using
- +Iterate to improve output quality
- +Document successful prompt patterns
✗ Don't
- −Don't use without understanding skill limitations
- −Don't skip validation of outputs
- −Don't share sensitive information in prompts
- −Don't expect skill to replace human judgment
💡 Pro Tips
- ★Be specific about desired format and style
- ★Ask for multiple options to choose from
- ★Request explanations to understand reasoning
- ★Combine AI efficiency with human expertise
When to Use This▌
✓ Use When
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid When
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
Learning Path▌
- 1Familiarize yourself with skill capabilities and limitations
- 2Start with low-risk, non-critical tasks
- 3Progress to more complex and valuable use cases
- 4Build expertise through regular use and experimentation
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.8★★★★★32 reviews- ★★★★★Soo Rao· Dec 28, 2024
I recommend containerize-aspnet-framework for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Chaitanya Patil· Dec 4, 2024
Useful defaults in containerize-aspnet-framework — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Anaya Garcia· Dec 4, 2024
containerize-aspnet-framework reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Piyush G· Nov 23, 2024
containerize-aspnet-framework has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Arjun Wang· Nov 19, 2024
Solid pick for teams standardizing on skills: containerize-aspnet-framework is focused, and the summary matches what you get after install.
- ★★★★★Meera Thomas· Nov 11, 2024
Useful defaults in containerize-aspnet-framework — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Shikha Mishra· Oct 14, 2024
Solid pick for teams standardizing on skills: containerize-aspnet-framework is focused, and the summary matches what you get after install.
- ★★★★★Anika Ndlovu· Oct 10, 2024
containerize-aspnet-framework has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Hana Smith· Oct 2, 2024
I recommend containerize-aspnet-framework for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Rahul Santra· Sep 25, 2024
Registry listing for containerize-aspnet-framework matched our evaluation — installs cleanly and behaves as described in the markdown.
showing 1-10 of 32