http://www.springframework.net/
Spring.NET contains:
- A full featured Inversion of Control container
- An Aspect Oriented Programming framework
- Expression Language for lightweight scripting
- UI-agnostic validation framework
- ASP.NET Framework
- Dependency Injection for pages and user controls, bi-directional data binding, and more.
- ASP.NET MVC and ASP.NET WebAPI Framework
- Dependency Injection for MVC (includin WebAPI).
- Declarative transaction management abstraction
- Declarative transaction management via use of common XML configuration and attributes across different transaction APIs
- ADO.NET framework
- Simplifies use of ADO.NET. DAO support classes and integration with Spring's declarative transaction management functionality
- NHibernate Integation
- NHibernate 5 integration to simplify use of NHibernate and participate in Spring's declarative transaction management functionality.
- NUnit and MSTest integration
- Provides Dependency Injection of test cases and Spring container loading and caching. . Data access and transaction management features aid with integration testing.
- Quartz integration
- Configure Quartz jobs using dependency injection and Spring's transactional support to persist job details
- MSMQ integration
- Simplifies the use MSMQ by providing helper classes for message sending and receiving. Integrates with Spring's transaction management features.
- NMS integration
- Simplifies the use of NMS by providing helper classes for message sending and receiving.
Spring.NET is a port of the Java based Spring Framework. In turn, the Java/J2EE Spring Framework is based on code published in "Expert One-on-One J2EE Design and Development" by Rod Johnson (Wrox, 2002).
Spring.NET 4.0.0 supports .NET Framework 4.7.2 and .NET Standard 2.0 and later.
Release contents:
srccontains the C# source files for the frameworktestcontains the C# source files for Spring.NET's test suitedoccontains the reference documentation sources and the Spring.NET xsd.examplescontains sample applications.build-supportcontains the Fallout build (build-support/build) and the SQL scripts for the integration-test databases.websitecontains the sources of the project website.
Build with ./build.cmd (Windows) or ./build.sh (Linux/macOS); see the targets in build-support/build.
Latest info is available at the public website: http://www.springframework.net/
The Spring Framework is released under the terms of the Apache Software License (see license.txt).
The "bin" directory contains the following distinct dll files for use in applications. Dependencies are those other than on the .NET BCL.
-
- Contents: Inversion of control container. Collection classes.
- Dependencies: Common.Logging
-
- Contents: Abstract Oriented Programming Framework.
- Dependencies: Spring.Core, Common.Logging
-
- Contents: Transaction and ADO.NET Framework.
- Dependencies: Spring.Core, Spring.Aop
-
Spring.Data.NHibernate5 (~90 KB)
- Contents: NHibernate 5.x integration
- Dependencies: Spring.Core, Spring.Aop, Spring.Data, NHibernate
-
- Contents: ASP.NET based Web Application Framework.
- Dependencies: Spring.Core, Spring.Aop
-
- Contents: ASP.NET MVC5 and WebAPI Integartion
- Dependencies: Spring.Core, Spring.Web
-
- Contents: NUnit Integration
- Dependencies: Spring.Core, Spring.Data, NUnit
-
Spring.Testing.Microsoft (~24 KB)
- Contents: MSTest Integration
- Dependencies: Spring.Core, Spring.Data, MSTest
-
- Contents: MSMQ Integration
- Dependencies: Spring.Core, Spring.Data, System.Messaging
-
Spring.Messaging.Nms (~100 KB)
- Contents: NMS Integration
- Dependencies: Spring.Core, Spring.Data, Apache NMS
-
Spring.Scheduling.Quartz3 (~44 KB)
- Contents: Quartz32.x Integration
- Dependencies: Spring.Core, Spring.Data, Quartz
Documentation can be found in the "docs" directory:
- The Spring reference documentation
Documented sample applications can be found in "examples":
- IoCQuickStart.MovieFinder - A simple example demonstrating basic IoC container behavior.
- IoCQuickStart.AppContext - Show use of various IApplicationContext features.
- IoCQuickStart.EventRegistry - Show use of loosely coupled eventing features.
- AopQuickStart - Show use of AOP features.
- CachingQuickStart - Show use of Caching abstraction.
- SpringAir - Show use of Spring.Web features.
- WebQuickStart - Show step by step usage of Spring.Web features.
- DataQuickStart - Show use of Spring.Data data access features.
- TxQuickStart - Show use of Spring's transaction features.
- Data.NHibernate.Northwind - Show use of Spring's NHibernate features.
- NMSQuickStart - Sample application using NMS
- MSMQ QuickStart - Sample application using MSMQ
- Quartz Example - Scheduling using Quartz
- Mvc5QuickStart - Show the configuration of the ASP.NET MVC 5 support
Visual Studio 2022 is required to open and build the solution. The free community version of Visual Studio should suffice.
-
./build.cmd Test(./build.sh Test) runs the unit tests. They need nothing but the .NET SDK. -
The SQL Server backed integration tests (
Spring.Data.Integration.Tests,Spring.Data.NHibernate5.Integration.Tests,Spring.Data.NHibernate5.NestedTxSuspension.Integration.TestsandSpring.Scheduling.Quartz3.Integration.Tests) provision their own database with Testcontainers for .NET. All you need is a running Docker daemon (Linux containers):./build.cmd IntegrationTestEach test assembly starts a pinned SQL Server 2022 container, creates the
springqalogin and the databases frombuild-support/create-integration-test-databases-and-users.sqland the project's own*_database.sqlscript (thequartzdatabase gets the Quartz.NET tables), runs, and removes the container. There is no database to install, no hosts entry and no script to run by hand. CI runs the same target on Linux (theintegration-linuxjob). -
To run against a SQL Server you already have, for example on a Windows machine without a Linux container engine, set
SPRING_TEST_SQLSERVERto an administrator's connection string. No container is started and the same scripts run against that server (they drop and recreate the test databases and thespringqalogin, so do not point it at a server you care about). The server must allow SQL Server (mixed-mode) authentication, because the tests log in asspringqa. In PowerShell:$env:SPRING_TEST_SQLSERVER = "Server=localhost;Integrated Security=true;TrustServerCertificate=true" ./build.cmd IntegrationTest./build.cmd IntegrationTestruns the net10.0 and net472 builds of a project one after the other when the variable is set. When you calldotnet testyourself, pass--max-parallel-test-modules 1, because Microsoft.Testing.Platform otherwise runs both builds at once and they would drop and recreate the same databases under each other:dotnet test --project test/Spring/Spring.Data.Integration.Tests/Spring.Data.Integration.Tests.csproj --max-parallel-test-modules 1 -
The tests learn where the server is from these environment variables, which the test assembly sets once the scripts have run (the XML contexts use them as
${...}placeholders):Variable Value SPRING_TEST_SQLSERVER_HOSThost,portof the serverSPRING_TEST_SQLSERVER_USER,SPRING_TEST_SQLSERVER_PASSWORDthe springqalogin (springqa/springqa)SPRING_TEST_SQLSERVER_CS_<DATABASE>a complete connection string, as springqa, for each database the scripts created, with the name upper-cased:..._CS_SPRING,..._CS_CREDITS,..._CS_DEBITS,..._CS_CREDITSANDDEBITS,..._CS_QUARTZ -
The NMS integration tests (
Spring.Messaging.Nms.Integration.Tests) work the same way with an ActiveMQ Classic container (a pinnedapache/activemq-classicimage, on a random host port), and./build.cmd IntegrationTestruns them too, on both net10.0 and net472. The test assembly publishes the broker's address asSPRING_TEST_ACTIVEMQ_BROKER_URI(tcp://host:port), which the XML contexts read as${SPRING_TEST_ACTIVEMQ_BROKER_URI}. To use a broker you already run, set that variable before the run and no container is started (./build.cmd IntegrationTestthen runs the net10.0 and net472 builds one after the other, because they share the broker's queues). -
Tests that need a distributed transaction (MSDTC) are
[Explicit]: a SQL Server container cannot take part in one. Run them by name against a Windows server with MSDTC enabled if you work on that code. -
./build.cmd Test --test-integration-dataalso runs the four SQL Server projects as part of theTesttarget,--test-integration-nmsthe NMS project, and--test-fullruns every integration project, including the ones that need MSMQ or a SQLite file.
InnovSys has kindly provided a license to generate the SDK documentation and supporting utilities for integration with Visual Studio.