dotnet-framework-4.8-expert
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese.NET Framework 4.8 Expert
.NET Framework 4.8 专家
Purpose
用途
Provides legacy .NET Framework development expertise specializing in WCF services, ASP.NET MVC, and enterprise application maintenance. Supports extending and integrating legacy .NET 4.8 applications with modern patterns while managing technical debt and migration strategies.
提供传统.NET Framework开发专业支持,专注于WCF服务、ASP.NET MVC以及企业级应用维护。支持采用现代模式扩展和集成传统.NET 4.8应用,同时管理技术债务与迁移策略。
When to Use
适用场景
- Maintaining or extending .NET Framework 4.8 applications
- Developing WCF services for enterprise integrations
- Working with ASP.NET MVC 5 web applications
- Managing Entity Framework 6 database access
- Integrating legacy COM components
- Planning migration strategies to modern .NET
- 维护或扩展.NET Framework 4.8应用
- 开发用于企业集成的WCF服务
- 开发ASP.NET MVC 5 Web应用
- 管理Entity Framework 6数据库访问
- 集成传统COM组件
- 规划向现代.NET迁移的策略
Quick Start
快速入门
Invoke When
适用调用场景
- Maintaining .NET Framework 4.x applications
- Building or extending WCF SOAP/REST services
- ASP.NET MVC 5 development
- Entity Framework 6 database operations
- Windows Service development
- COM interop requirements
- 维护.NET Framework 4.x应用
- 构建或扩展WCF SOAP/REST服务
- ASP.NET MVC 5开发
- Entity Framework 6数据库操作
- Windows Service开发
- COM互操作需求
Don't Invoke When
不适用调用场景
- New projects (use .NET 8+ with dotnet-core-expert)
- Modern web APIs (use ASP.NET Core)
- Cross-platform needs (use .NET 8)
- Containerized deployments (prefer .NET 8)
- 新项目(使用.NET 8+,搭配dotnet-core-expert)
- 现代Web API(使用ASP.NET Core)
- 跨平台需求(使用.NET 8)
- 容器化部署(优先使用.NET 8)
Core Competencies
核心能力
.NET Framework 4.8 Features
.NET Framework 4.8 特性
- .NET Framework 4.8 security and compatibility features
- Windows Forms and WPF application development
- Entity Framework 6 for database access
- Windows Communication Foundation (WCF) services
- ASP.NET MVC 5 web application development
- Windows Services and background processing
- .NET Framework 4.8安全与兼容性特性
- Windows Forms和WPF应用开发
- 基于Entity Framework 6的数据库访问
- Windows Communication Foundation (WCF)服务
- ASP.NET MVC 5 Web应用开发
- Windows Service与后台处理
WCF Services Architecture
WCF服务架构
- Service contracts and data contracts
- Binding configurations (WSHttpBinding, BasicHttpBinding)
- Service hosting and deployment
- Security configurations (Transport, Message, Mixed)
- RESTful services with WebHttpBinding
- Duplex communication patterns
- 服务契约与数据契约
- 绑定配置(WSHttpBinding、BasicHttpBinding)
- 服务托管与部署
- 安全配置(传输安全、消息安全、混合安全)
- 基于WebHttpBinding的RESTful服务
- 双工通信模式
ASP.NET MVC 5 Development
ASP.NET MVC 5 开发
- MVC pattern implementation
- Razor view engine and HTML helpers
- Model binding and validation
- Authentication and authorization
- Route configuration and attribute routing
- Integration with JavaScript frameworks
- MVC模式实现
- Razor视图引擎与HTML辅助工具
- 模型绑定与验证
- 身份验证与授权
- 路由配置与属性路由
- 与JavaScript框架集成
Legacy System Integration
遗留系统集成
- COM Interop for legacy component integration
- Third-party library management
- Database connectivity with ADO.NET
- XML and SOAP web service consumption
- Performance optimization for legacy code
- Migration strategies to modern frameworks
- 用于遗留组件集成的COM互操作
- 第三方库管理
- 基于ADO.NET的数据库连接
- XML与SOAP Web服务消费
- 遗留代码性能优化
- 向现代框架迁移的策略
Decision Framework
决策框架
When to Modernize vs. Maintain
现代化改造 vs 维护 决策
Evaluating legacy .NET Framework application?
│
├─ Is it actively developed (>1 feature/month)?
│ │
│ ├─ YES → Does it need cross-platform or containers?
│ │ │
│ │ ├─ YES → **Plan migration to .NET 8** ✓
│ │ │ (use Upgrade Assistant)
│ │ │
│ │ └─ NO → Business-critical?
│ │ │
│ │ ├─ YES → **Incremental modernization** ✓
│ │ │ (strangler fig pattern)
│ │ │
│ │ └─ NO → **Maintain in place** ✓
│ │
│ └─ NO → End-of-life planned?
│ │
│ ├─ YES → **Minimal maintenance** ✓
│ │ (security patches only)
│ │
│ └─ NO → **Maintain in place** ✓
│ (with documentation focus)Evaluating legacy .NET Framework application?
│
├─ Is it actively developed (>1 feature/month)?
│ │
│ ├─ YES → Does it need cross-platform or containers?
│ │ │
│ │ ├─ YES → **Plan migration to .NET 8** ✓
│ │ │ (use Upgrade Assistant)
│ │ │
│ │ └─ NO → Business-critical?
│ │ │
│ │ ├─ YES → **Incremental modernization** ✓
│ │ │ (strangler fig pattern)
│ │ │
│ │ └─ NO → **Maintain in place** ✓
│ │
│ └─ NO → End-of-life planned?
│ │
│ ├─ YES → **Minimal maintenance** ✓
│ │ (security patches only)
│ │
│ └─ NO → **Maintain in place** ✓
│ (with documentation focus)WCF vs. Modern Alternatives
WCF vs 现代替代方案
| Aspect | WCF | ASP.NET Web API 2 | gRPC |
|---|---|---|---|
| Protocol | SOAP, REST | REST | HTTP/2 |
| Best for | Enterprise SOAP | REST APIs | High-perf services |
| Interop | Excellent (.NET, Java) | Universal | Limited |
| Complexity | High | Medium | Medium |
| Maintenance | Legacy | Legacy | Modern |
| 维度 | WCF | ASP.NET Web API 2 | gRPC |
|---|---|---|---|
| 协议 | SOAP, REST | REST | HTTP/2 |
| 适用场景 | 企业级SOAP服务 | REST API | 高性能服务 |
| 互操作性 | 优秀(.NET、Java) | 通用 | 有限 |
| 复杂度 | 高 | 中等 | 中等 |
| 维护性 | 遗留技术 | 遗留技术 | 现代技术 |
Entity Framework 6 vs. Alternatives
Entity Framework 6 vs 替代方案
| Aspect | EF6 | Dapper | ADO.NET |
|---|---|---|---|
| Complexity | Low | Medium | High |
| Performance | Good | Excellent | Best |
| Flexibility | Good | Excellent | Full control |
| Best for | CRUD apps | Performance-critical | Complex queries |
| 维度 | EF6 | Dapper | ADO.NET |
|---|---|---|---|
| 复杂度 | 低 | 中等 | 高 |
| 性能 | 良好 | 优秀 | 最佳 |
| 灵活性 | 良好 | 优秀 | 完全可控 |
| 适用场景 | CRUD应用 | 性能关键型应用 | 复杂查询场景 |
Best Practices
最佳实践
.NET Framework Development
.NET Framework 开发
- Dependency Management: Use NuGet Package Manager, pin versions
- Configuration: Use web.config/app.config transforms for environments
- Logging: Implement comprehensive logging (log4net, Serilog)
- Error Handling: Global exception handlers, proper error pages
- Testing: MSTest or NUnit for unit tests, integration tests
- 依赖管理:使用NuGet包管理器,固定版本
- 配置:针对不同环境使用web.config/app.config转换
- 日志:实现全面的日志记录(log4net、Serilog)
- 错误处理:全局异常处理器、合适的错误页面
- 测试:使用MSTest或NUnit进行单元测试、集成测试
WCF Services
WCF服务
- Security: Use wsHttpBinding with message security
- Binding Selection: Match bindings to requirements
- Throttling: Configure throttling, instancing, concurrency
- Error Handling: Use fault contracts, implement IErrorHandler
- Testing: Use WCF Test Client or Postman
- 安全:使用wsHttpBinding搭配消息安全
- 绑定选择:根据需求匹配绑定类型
- 限流配置:配置限流、实例化、并发设置
- 错误处理:使用错误契约,实现IErrorHandler
- 测试:使用WCF测试客户端或Postman
ASP.NET MVC
ASP.NET MVC
- Controller Patterns: Use dependency injection, avoid business logic
- View Models: Separate view models from domain models
- Validation: Use data annotations and IValidatableObject
- Security: Anti-forgery tokens, output encoding, authorization
- 控制器模式:使用依赖注入,避免业务逻辑
- 视图模型:将视图模型与领域模型分离
- 验证:使用数据注解与IValidatableObject
- 安全:防伪造令牌、输出编码、授权控制
Database Access (EF6)
数据库访问(EF6)
- Context Management: Context per request, repository pattern
- Query Optimization: Use Include() for eager loading, avoid N+1
- Migrations: Use Code First Migrations, version control
- Performance: Compiled queries, caching strategies
- 上下文管理:每个请求对应一个上下文,采用仓储模式
- 查询优化:使用Include()进行预加载,避免N+1问题
- 迁移:使用Code First迁移,版本控制
- 性能:编译查询、缓存策略
Legacy Application Management
遗留应用管理
- Technical Debt: Document and prioritize, address critical issues
- Testing: Add unit tests around new features
- Security: Keep .NET Framework patched
- Documentation: Maintain architecture diagrams, data flows
- Migration: Evaluate .NET Upgrade Assistant
- 技术债务:记录并排序优先级,处理关键问题
- 测试:为新功能添加单元测试
- 安全:保持.NET Framework补丁更新
- 文档:维护架构图、数据流文档
- 迁移:评估.NET Upgrade Assistant工具
Common Use Cases
常见用例
Enterprise Legacy Applications
企业遗留应用
- Maintaining existing line-of-business applications
- Adding new features to established systems
- Performance optimization of legacy code
- Integration with modern services and APIs
- Database migration and schema updates
- 维护现有业务线应用
- 为成熟系统添加新功能
- 遗留代码性能优化
- 与现代服务和API集成
- 数据库迁移与架构更新
WCF Service Applications
WCF服务应用
- Enterprise service bus implementations
- Integration with third-party systems
- SOAP web service development
- RESTful API creation with WCF
- Service orchestration and choreography
- 企业服务总线实现
- 与第三方系统集成
- SOAP Web服务开发
- 使用WCF创建RESTful API
- 服务编排与 choreography
Windows Desktop Applications
Windows桌面应用
- Line-of-business desktop applications
- Database-driven client applications
- Integration with Office automation
- File processing and reporting tools
- 业务线桌面应用
- 数据库驱动的客户端应用
- 与Office自动化集成
- 文件处理与报告工具
When to Use This Expert
何时使用该专家
Ideal Scenarios:
- Maintaining existing .NET Framework 4.8 applications
- Extending legacy enterprise systems
- Integrating new features with existing WCF services
- ASP.NET MVC application enhancement
- Windows service development and maintenance
Alternative Solutions:
- For new applications: Consider .NET Core/.NET 6+
- For web APIs: Consider ASP.NET Core
- For modern desktop apps: Consider WPF with .NET 6+ or MAUI
理想场景:
- 维护现有.NET Framework 4.8应用
- 扩展遗留企业系统
- 为现有WCF服务集成新功能
- ASP.NET MVC应用增强
- Windows Service开发与维护
替代方案:
- 新项目:考虑使用.NET Core/.NET 6+
- Web API:考虑使用ASP.NET Core
- 现代桌面应用:考虑使用.NET 6+的WPF或MAUI
Additional Resources
额外资源
- Detailed Technical Reference: See REFERENCE.md
- Code Examples & Patterns: See EXAMPLES.md
- 详细技术参考:查看 REFERENCE.md
- 代码示例与模式:查看 EXAMPLES.md