Skip to main content
Frameworks

.NET .gitignore

.gitignore for frameworks projects

View on GitHub

.gitignore Content

# ==============================================================================
# Created by https://gitignores.com/
# COMPREHENSIVE FRAMEWORK TEMPLATE for .NET
# Website: https://dotnet.microsoft.com/
# Repository: https://github.com/dotnet/dotnet
# ==============================================================================

# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# TEMPLATE OVERVIEW & USAGE NOTES
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# • TEMPLATE TYPE: COMPREHENSIVE FRAMEWORK TEMPLATE
# • PURPOSE: Complete .NET framework patterns for C# applications and development artifacts
# • DESIGN PHILOSOPHY: Self-contained with all .NET-specific patterns
# • COMBINATION GUIDANCE: Use standalone; optionally add IDE/OS templates
# • SECURITY CONSIDERATIONS: Includes security patterns for .env files and credentials
# • BEST PRACTICES: Review patterns before use, test with git check-ignore, customize for your project
# • OFFICIAL SOURCES: .NET documentation and community best practices

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# SECURITY & SENSITIVE DATA PROTECTION (ALWAYS FIRST!)
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# CRITICAL: Protect sensitive data from accidental commits to version control

*.crt
*.key
*.keystore
*.pem
*.secret
*.token
*_keys
*_secrets
*_tokens
.env
.env.*
.env.*.local
.env.local
id_dsa
id_rsa

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# BUILD ARTIFACTS & DISTRIBUTION
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

*.appx
*.appxbundle
*.appxupload
*.aps
*.azurePubxml
*.dll
*.exe
*.lib
*.tar.gz
*.zip

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# DEPENDENCY MANAGEMENT & PACKAGE CACHE
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

!**/[Pp]ackages/build/
*.build.csdef
*.cachefile
*.nuget.props
*.nuget.targets
.builds
.cache/
DocProject/buildhelp/
paket-files/
project.fragment.lock.json
project.lock.json

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# DEVELOPMENT & RUNTIME ARTIFACTS
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

*.log
*.log.*
*.tmp
*.tmp_proj
.sass-cache/

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# FRAMEWORK-SPECIFIC PATTERNS
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

!.axoCover/settings.json
!?*.[Cc]ache/
$tf/
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.HTMLClient/GeneratedArtifacts
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
**/[Pp]ackages/*
*-\ [Bb]ackup\ ([0-9]).rdl
*-\ [Bb]ackup\ ([0-9][0-9]).rdl
*-\ [Bb]ackup.rdl
*.[Cc]ache
*.[Pp]ublish.xml
*.[Rr]e[Ss]harper
*.bim.layout
*.bim_*.settings
*.binlog
*.btm.cs
*.btp.cs
*.cer
*.csproj.user
*.csr
*.dbmdl
*.dbproj.schemaview
*.der
*.dotCover
*.DotSettings.user
*.e2e
*.fsproj.user
*.GhostDoc.xml
*.gpState
*.ilk
*.iobj
*.ipdb
*.jfm
*.jks
*.jmconfig
*.ldf
*.mdf
*.meta
*.mm.*
*.ncb
*.ndf
*.nupkg
*.o
*.obj
*.odx.cs
*.opendb
*.opensdf
*.opt
*.p12
*.p7b
*.p7c
*.pch
*.pdb
*.pfx
*.pgc
*.pgd
*.pid
*.pid.lock
*.pidb
*.plg
*.psess
*.publishproj
*.publishsettings
*.pubxml
*.rdl.data
*.rptproj.bak
*.rptproj.rsuser
*.rsp
*.sap
*.sbr
*.scc
*.sdf
*.sln.docstates
*.sln.iml
*.snupkg
*.suo
*.svclog
*.tgz
*.tlb
*.tlh
*.tli
*.truststore
*.tss
*.user
*.userosscache
*.userprefs
*.vbproj.user
*.vbw
*.VC.db
*.VC.VC.opendb
*.VisualState.xml
*.vsp
*.vspscc
*.vspx
*.vssscc
*.xsd.cs
*_h.h
*_i.c
*_p.c
*_wpftmp.csproj
.*crunch*.local.xml
.axoCover/*
.cr/personal
.fake/
.nsight-gpu/
.ntvs_analysis.dat
.paket/paket.exe
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
[Bb]in/
[Bb]uild[Ll]og.*
[Dd]ebug/
[Dd]ebugPS/
[Dd]ebugPublic/
[Ee]xpress/
[Ll]og/
[Ll]ogs/
[Oo]bj/
[Rr]elease/
[Rr]eleasePS/
[Rr]eleases/
[Tt]est[Rr]esult*/
[Ww][Ii][Nn]32/
_Chutzpah*
_NCrunch_*
_pkginfo.txt
_Pvt_Extensions
_ReSharper*/
_TeamCity*
_UpgradeReport_Files/
AppPackages/
artifacts/
ASALocalRun/
AutoTest.Net/
Backup*/
BenchmarkDotNet.Artifacts/
bld/
BundleArtifacts/
ClientBin/
csx/
dlldata.c
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/*.HxC
DocProject/Help/*.HxT
DocProject/Help/html
DocProject/Help/Html2
ecf/
FakesAssemblies/
Generated\ Files/
Generated_Code/
ipch/
nCrunchTemp_*
nunit-*.xml
OpenCover/
orleans.codegen.cs
out/
Package.StoreAssociation.xml
public/
publish/
PublishScripts/
rcf/
ScaffoldingReadMe.txt
ServiceFabricBackup/
StyleCopReport.xml
TestResult.xml
UpgradeLog*.htm
UpgradeLog*.XML
x64/
x86/
~$*

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# TESTING & QUALITY ASSURANCE
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

*.coverage
*.coveragexml
.nyc_output/
coverage*.info
coverage*.json
coverage*.xml
junit.xml
test-results/

# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# TEMPLATE CUSTOMIZATION & BEST PRACTICES
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# 1. REVIEW: Examine all patterns before use
# 2. CUSTOMIZE: Adapt to your project's specific structure
# 3. TEST: Use `git check-ignore` to verify patterns
# 4. SECURE: Always protect sensitive data and credentials
# 5. UPDATE: Review periodically as technology evolves

# RECOMMENDED USAGE PATTERNS:
# ==============================================================================
#
# BASIC USAGE (STANDALONE):
# -------------------------
# cp frameworks/dotnet.gitignore .gitignore
#
# WITH IDE SUPPORT:
# ----------------
# cat frameworks/dotnet.gitignore \
#     ides/visual-studio-code.gitignore | sort -u > .gitignore
#
# CROSS-PLATFORM DEVELOPMENT:
# ---------------------------
# cat frameworks/dotnet.gitignore \
#     os/linux.gitignore \
#     os/macos.gitignore \
#     os/windows.gitignore | sort -u > .gitignore
#
# IMPORTANT NOTES:
# ==============================================================================
# 1. This template is self-contained and includes security patterns
# 2. No need to add common/security.gitignore separately
# 3. Test with `git status --ignored` to ensure proper coverage

Note: This file is fetched from GitHub and cached for 7 days.