Repository navigation
Expand file tree
/
Copy pathBreakingChanges.txt
More file actions
338 lines (260 loc) · 20.2 KB
/
Copy pathBreakingChanges.txt
File metadata and controls
338 lines (260 loc) · 20.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
Changes (3.1 to 4.0)
========================
1. The assemblies' version is 4.0.0.0 (3.1 shipped 3.1.0.0). Code compiled against 3.x has to
be recompiled. On .NET Framework, binding redirects to 4.0.0.0 work only if the code uses no
API that 4.0 removed or changed.
2. .NET Framework 4.7.2 is the lowest supported .NET Framework (was 4.6.2). The tests run on
.NET Framework 4.7.2 and .NET 10.
3. The System.Configuration.ConfigurationManager dependency floor was raised to 8.0.1 (was
4.7.0). 4.7.0 pulled in System.Drawing.Common 4.7.0, which has a critical advisory
(GHSA-rxg9-xrhp-64gj).
4. Five packages were removed. They have no 4.0 replacement and receive no further releases:
- Spring.Services: .NET Remoting exporters and factories, the ASMX web service client proxy
(WebServiceProxyFactory), Enterprise Services (serviced components), WCF integration and
the Windows service application host. These are .NET Framework-only technologies that
Microsoft has not carried forward to modern .NET.
- Spring.Messaging.Ems: TIBCO EMS integration. It needed TIBCO's non-redistributable
TIBCO.EMS.dll and had no runnable tests.
- Spring.Web.Extensions: ASP.NET AJAX integration (the JavaScript exporter), a .NET
Framework-only technology.
- Spring.Template.Velocity and Spring.Template.Velocity.Castle: NVelocity templating, whose
underlying library is unmaintained.
The corresponding XML configuration namespaces (http://www.springframework.net/remoting,
/wcf, /ems and /nvelocity) are no longer registered. A configuration file that still uses one
of them fails schema validation with an ObjectDefinitionStoreException whose message says
"The '<namespace URI>' namespace was provided by <package>, which was removed in Spring.NET
4.0." The matching examples (Calculator, EmsQuickStart, WcfQuickStart and
Web.Extensions.Example) were removed too.
Spring.Web's ASMX web service exporter (Spring.Web.Services.WebServiceExporter and
WebServiceHandlerFactory) is also gone, with no replacement. Remove any *.asmx handler
registration that points at Spring.Web.Services.WebServiceHandlerFactory from web.config,
together with the WebServiceExporter object definitions. Object definitions named after an
.asmx path (which the factory used to configure [WebService] classes) are no longer
consulted: ASP.NET compiles and instantiates the .asmx itself. To keep a service, write the
.asmx class by hand and resolve the object from the application context, or move to
WCF/CoreWCF or ASP.NET Core.
5. Dependency floors were raised: Microsoft.Extensions.Logging.Abstractions 8.0.3,
Microsoft.Bcl.HashCode 6.0.0, Microsoft.Win32.Registry 5.0.0, System.CodeDom 8.0.0,
NHibernate 5.7.1, Quartz 3.22.9, and Microsoft.AspNet.Mvc and Microsoft.AspNet.WebApi.WebHost
5.3.0 (Mvc/WebApi 5.3.0 brings Newtonsoft.Json 13 in place of the vulnerable 6.0.4).
Several assembly versions moved with these floors:
| Assembly | 3.1 | 4.0 |
|-------------------------------------------|----------|----------|
| Microsoft.Bcl.HashCode | 1.0.0.0 | 6.0.0.0 |
| Microsoft.Extensions.Logging.Abstractions | 8.0.0.0 | 8.0.0.3 |
| Quartz | 3.12.0.0 | 3.22.9.0 |
| NHibernate | 5.6.0.0 | 5.7.0.0 |
| System.Web.Mvc, System.Web.Http(.WebHost) | 5.2.7.0 | 5.3.0.0 |
| System.Net.Http.Formatting | 5.2.7.0 | 6.0.0.0 |
| Newtonsoft.Json (via WebApi) | 6.0.0.0 | 13.0.0.0 |
On .NET Framework, an application or library compiled against an older version needs
binding redirects to these. SDK-style projects with AutoGenerateBindingRedirects get them
generated. Classic web.config applications must add them, and the Mvc/WebApi NuGet packages
add their own. Microsoft.AspNet.WebApi.OData 5.x (OData v3) caps WebApi.Core below 5.3.0, so
restoring it next to Spring.Web.Mvc5 reports NU1608. It still runs on 5.3 through the
System.Web.Http redirect.
6. On .NET Framework, Spring.Core no longer depends on the System.Configuration.ConfigurationManager,
System.CodeDom and Microsoft.Win32.Registry packages, because the framework provides those
APIs. Spring.Messaging's .NET Framework build drops the unused Experimental.System.Messaging.Signed
package; it always compiled against the framework's System.Messaging. The packages are still
referenced for the netstandard2.0 target.
7. Spring.Aop no longer depends on Antlr3.Runtime.
8. The libraries now include a net10.0 build (Spring.Core, Spring.Aop, Spring.Data,
Spring.Data.NHibernate5, Spring.Messaging, Spring.Messaging.Nms, Spring.Scheduling.Quartz3 and
Spring.Testing.Microsoft target netstandard2.0, net472 and net10.0). NuGet picks lib/net10.0
on .NET 10, where .NET 10 applications used the netstandard2.0 build before. Applications on
.NET 8 and .NET 9 keep getting the netstandard2.0 build. Spring.Testing.NUnit targets net10.0
and net472 (see item 9).
- Partial-trust (medium-trust) hosting is no longer supported. Code runs with the caller's
trust only: the ExecutePrivileged wrappers and the permission demands are gone.
- Code access security is gone. SecurityPermission demands, the SecurityCritical and
SecurityTreatAsSafe helpers, PermissionSet asserts, and the AspNetHostingPermission,
DirectoryServicesPermission and PermissionSet attributes were removed from Spring.Core,
Spring.Aop and Spring.Web. They were no-ops in full trust, and the framework deprecates
them (SYSLIB0003). Spring.NET no longer supports partially trusted callers or a sandboxed
AppDomain: DynamicReflectionManager no longer falls back to a Spring-owned module when a
security demand fails, and serialization no longer demands SerializationFormatter.
- Legacy serialization is obsolete on .NET 10. [Serializable], ISerializable, the
(SerializationInfo, StreamingContext) constructors and GetObjectData are all still there and
unchanged on .NET Framework and netstandard2.0. In the net10.0 build, those constructors
and GetObjectData overrides carry [Obsolete] with diagnostic SYSLIB0051, as the BCL's own
do, so code that derives from a Spring exception and chains to base(info, context) now gets
SYSLIB0051 when it compiles against net10.0 (an error under TreatWarningsAsErrors; suppress
or annotate the constructor the same way).
- ReflectionUtils.GetCustomAttributes still returns live attribute instances for declarative
security attributes. It now recognises them by the name of their base type instead of
typeof(SecurityAttribute).
9. The test-framework packages moved up a major version:
- Spring.Testing.NUnit requires NUnit 5.0.0 or later (was NUnit 3.14). Its netstandard2.0 build is
gone, because NUnit 5 has none: the package now targets net10.0 and net472, so test projects on
.NET 8 or .NET 9 can no longer reference it (NU1202). The base classes
(AbstractSpringContextTests, AbstractDependencyInjectionSpringContextTests,
AbstractTransactionalSpringContextTests and AbstractTransactionalDbProviderSpringContextTests)
are source compatible: no member, signature or attribute changed, and they still use [SetUp]
and [TearDown]. A test project built on them has to move to NUnit 5. Under NUnit 5 the classic
Assert.AreEqual family compiles only on C# 14, through NUnit's ClassicAssertExtensions. On older
C# versions use NUnit.Framework.Legacy.ClassicAssert or Assert.That. StringAssert,
CollectionAssert, FileAssert and DirectoryAssert remain in NUnit.Framework.
- Spring.Testing.Microsoft requires MSTest.TestFramework 4.5.2 or later (was 3.4.3). The base classes
are source compatible with it, and build for netstandard2.0, net472 and net10.0.
10. LogExceptionHandler.ActionExpressionText is now the message expression only. The level and the
exception come from LogLevel and LogMessageOnly, and the getter returns the expression as set,
not the #log.<Level>(...) wrapper it used to return. A handler configured with
#log.Fatal('msg', #e) no longer logs: that form worked on 3.0.2 and earlier only by accident of
nesting, and nothing has been logged by it since 3.0.3, when logging moved to
Microsoft.Extensions.Logging. It now writes a warning that says so. To migrate:
- Before: ActionExpressionText="#log.Fatal('msg', #e)"
- After: ActionExpressionText="'msg'" LogLevel="Critical"
11. The expression language is parsed by a parser generated with Parlot at build time, without a
runtime dependency on it, instead of the ANTLR 2 runtime that Spring.Core embedded:
- The namespaces Spring.Expressions.Parser.antlr, .antlr.debug, .antlr.collections and
.antlr.collections.impl are gone, with all their public types.
- Spring.Expressions.SpringAST has no base class any more, and getFirstChild, getNextSibling, addChild,
setFirstChild and setNextSibling use SpringAST instead of the AST interface. It lost the protected down and
right fields, ICloneable and Clone, SpringAST(IToken) and initialize(IToken), and the helpers it inherited
from BaseAST: EqualsList, EqualsListPartial, EqualsTree, EqualsTreePartial, findAll, findAllPartial, ToTree,
xmlSerialize, xmlSerializeNode, xmlSerializeRootOpen, xmlSerializeRootClose, encode, decode and
setVerboseStringConversion.
- Syntax errors are still Spring.Expressions.SyntaxErrorException, which is now public and derives from
Exception: catch it instead of RecognitionException or TokenStreamRecognitionException.
- An error can report a later position than it did, at the token that could not be read, and its
message can be different. The expressions accepted and their trees are the same, except that a
QualifiedIdentifier has no child nodes any more (getText() returns the same value). The serialized form of
a parsed expression is the same.
- U+FFFF in an expression is now an invalid char. ANTLR took it for the end of the input and silently dropped
what followed.
- A nested expression too deep for the stack of the thread, or 2,000 levels of parentheses or prefix
operators, is a SyntaxErrorException instead of a stack overflow.
- Evaluating a tree too deep for the stack of the thread throws InsufficientExecutionStackException
instead of overflowing it.
- Spring.Core depends on System.Memory explicitly on .NET Framework and .NET Standard 2.0.
12. AbstractObjectFactory.RegisterDisposableObject is obsolete and does nothing. It never caused disposal:
the factory destroys its singletons itself, in DestroySingleton, which builds the destruction adapter at
that point. The instances registered here were only stored, and for the base factory that pinned every
singleton that needed destruction, with its definition, for the lifetime of the factory, even after the
singleton had been destroyed. Remove calls to it. A singleton that implements IDisposable or has a
destroy method is already destroyed when the factory is disposed.
The protected virtual RegisterDisposableObjectIfNecessary is kept. Its base implementation now only
validates the destroy method, so an unsupported one still fails the creation of the object, and keeps no
reference to the instance.
13. The handler templates in ExceptionHandlerAdvice.ExceptionHandlerDictionary are now copied for each DSL
statement when they are ICloneable, as every AbstractExceptionHandler now is, instead of being shared and
overwritten. Before, two statements with the same action ('log', for example) were one handler instance
listed twice, carrying the exception names of both statements and the constraint and action of the last one,
so both logged the second message. Each statement now has its own copy, and the advice no longer modifies
the template. Code that read the template back after configuration to see the last statement's settings must
look at ExceptionHandlers instead. A custom IExceptionHandler template that is not ICloneable is still shared.
AbstractExceptionHandler gained ICloneable and a virtual Clone method; a subclass with a mutable
reference-typed field of its own should override Clone to copy it. A subclass that already declares its
own public Clone() gets warning CS0114 and should mark it override, or the advice copies its templates
with the base implementation.
14. Spring.Scheduling.Quartz3 is maintenance-only: it stays on Quartz.NET 3.x and receives fixes, no new
features. Spring.Scheduling.Quartz4 is new, for Quartz.NET 4.x. It targets net10.0 only (Quartz 4 does
too), has the same namespace as Quartz3 (Spring.Scheduling.Quartz), and ships the same Spring objects
(SchedulerFactoryObject, the trigger and job detail objects, QuartzJobObject and the rest) adapted to
Quartz 4's API. Moving from Quartz3 means a new package, a new assembly name in type= strings, and
source changes where Quartz changed (IJob.Execute returns ValueTask, QuartzJobObject.ExecuteInternal
takes a CancellationToken, the trigger objects use Key and a typed MisfireInstruction instead of Name,
Group and MisfireInstructionName, JobDetailObject accepts IJob types only). Spring-managed transactions
for the job store are not part of it yet. See src/Spring/Spring.Scheduling.Quartz4/README.md for the
full list and for what to do if the job store has to take part in Spring transactions.
Changes (3.0.x to 3.1)
========================
1. Logging moved from Common.Logging to Microsoft.Extensions.Logging. Configure logging by
assigning Spring.LogManager.LoggerFactory at application startup.
2. All framework log messages are now structured message templates with named placeholders
(issue #265). Consequences for log output:
- Message text is rendered with the invariant culture instead of the current culture.
- Null argument values render as "(null)" instead of an empty string.
- Exceptions that were previously flattened into the message text are now passed as the
structured exception; whether and how the stack trace is rendered is up to the sink.
- A few collection-valued arguments now render as comma-separated lists instead of the
collection type name.
3. AdoPlatformTransactionManager and ConnectionUtils no longer include the connection string
in debug log messages, since it can contain credentials.
4. The Microsoft.Extensions.Logging.Abstractions dependency floor was raised to 8.0.0.
On .NET Framework, ASP.NET applications may need the standard binding redirects for
System.Memory and System.Runtime.CompilerServices.Unsafe (Visual Studio generates these
automatically for projects with AutoGenerateBindingRedirects).
Changes (2.0 to 3.0)
========================
1. .NET Framework 4.6.1 is the lowest framework supported
2. Following features were removed as obsolete: ASP.NET MVC 3 and 4 support, NHibernate 3 and 4 support
Changes (1.3.2 to 2.0)
========================
1. Protected fields were changed to private. Access is now allowed via public/protected property member.
2. Most of members marked as Obsolete before 2.0 release were removed.
3. DbProvider automatically sets BindByName to true for Oracle's ODP.NET OracleCommand instances when created
Changes (1.3.1 to 1.3.2)
========================
Spring.Data
1. Changed AbstractPlatformTransactionManager to set default Transaction Synchronizcation to TransactionSynchronization.NeverChange from TransactionSynchronizationState.Never. Use the setter 'TransactionSynchonization' to change. This was changed so as to avoid an issue with NHibernate Open Session In View functionality and some nested declarative transaction management settings. See https://jira.springsource.org/browse/SPRNET-1438 for more details.
Note: This functionality is an advanced feature of Spring, so if you are using it, you probably know all about it, otherwise you can safely ignore this message.
Changes (1.3 RC1 to 1.3 GA or greater)
========================
Spring.Data
-----------
1. The namespace for MultiDelegatingDbProvider was changed from Spring.Data to Spring.Data.Common as that is consistent with all the other implementations of IDbProvider.
Changes (1.2.0 to 1.3 or greater)
========================
Spring.Core
-----------
1. within an ValidationGroup element (<v:group>,<v:exclusive>,..), nested validator elements now must occur after any
<v:message>, <v:action> or <v:property> elements. The following was allowed previously, but now will raise a schema
validation error:
<v:group ..>
<v:validator ...>
<v:action ...>
change this to
<v:group ..>
<v:action ...>
<v:validator ...>
2. XmlReaderContext constructor now requires an IObjectDefinitionFactory to be specified. Thus XmlReaderContext.ObjectDefinitionFactory
is read only now.
3. Changes to the Apache NMS API, which was not yet a public release when included in Spring 1.2.0 made breaking API changes.
On NmsTemlate,
1) The property 'byte Priority' was changed to 'MsgPriority Priority'
2) The property 'bool Persistent' is no longer part of the NMS API but is still supported in a backward compatible
manner by Spring by translation to standard MsgDeliveryMode enumeration values of Persistent and NonPersistent.
A new property MsgDelivery has been added. The class, CachedMessageProducer, which is unlikely to be use by
end users, was directly upgraded to the latest API without any backwards compatibility support.
4. AbstractApplicationContext.CaseSensitive renamed to AbstractApplicationContext.IsCaseSensitive
5. Spring.Validation: Base class BaseValidator changed to BaseSimpleValidator for single validators as compared to group validators
which now commonly derive from BaseGroupValidator instead of ValidatorGroup
6. IVariableSource implementations now must also implement CanResolveVariable(string variableName) and may throw exceptions in
ResolveVariable() in case the variable cannot resolved by this particular variable source.
In order to distinguish between an existing variable having a null value and a non-existing variable, variable sources
need to be changed to this new contract.
7. a) Signature of CollectionUtils.Contains(ICollection collection, object element) changed to CollectionUtils.Contains(IEnumerable collection, object element)
b) returns 'null' in case of collection==null instead of throwing an exception
8. dropped Spring.Expressions.DateLiteralNode
Spring.Aop
----------
1. AbstractAutoProxyCreator.FindEligibleAdvisors(Type) changed to
AbstractAutoProxyCreator.FindEligibleAdvisors(Type, Name)
2. It is not possible to change a ProxyFactoryObject's product configuration at runtime
if IsSingleton==true since factory object singleton products get cached now.
Changes (1.2 RC1 to 1.2.0 or greater)
=====================================
none
Changes (1.1.2 to 1.2 RC1 or greater)
=====================================
Spring.Core
-----------
1. ContextRegistry.GetContext(string name) now throws an exception if no context has been registered under that name instead of returning null.
2. Removed getter property of IApplicationContext in IApplicationContextAware
3. Removed getter property of IResourceLoader in IResourceLoaderAware
4. AbstractBinding.IsValid property changed to method AbstractBinding.IsValid( IValidationErrors )
Spring.Data
-----------
1. The provider name System.Data.SqlServerCe is now aliased to SqlServerCe-3.5.1 (was SqlServerCe-3.1)
2. Removed setter property RollbackOnly on ITransactionStatus, now use the method SetRollbackOnly() to 'doom' a transaction to always rollback.
Spring.Services
---------------
1. Removed WebServiceProxyFactory.ClientProtocolType property (obsolete)
2. WebServiceExporter generates WebServiceBinding attribute with WSI basic profile 1.1 by default.
Spring.Web
----------
1. Moved Spring.Web.Support.ISharedStateAware to Spring.Objects.ISharedStateAware
2. Dropped IProcess support
3. IHttpHandler instance dependencies won't be injected until PreRequestHandlerExecute stage (to support "session"-scoped deps)