diff --git a/Examples/CSExamples/JustMock.NonElevatedExamples.VS2017/JustMock.NonElevatedExamples.VS2017.csproj b/Examples/CSExamples/JustMock.NonElevatedExamples.VS2017/JustMock.NonElevatedExamples.VS2017.csproj
index c8e23f20..6c82ba64 100644
--- a/Examples/CSExamples/JustMock.NonElevatedExamples.VS2017/JustMock.NonElevatedExamples.VS2017.csproj
+++ b/Examples/CSExamples/JustMock.NonElevatedExamples.VS2017/JustMock.NonElevatedExamples.VS2017.csproj
@@ -20,6 +20,7 @@
+ PackageReference
true
@@ -39,12 +40,6 @@
4
-
- ..\packages\MSTest.TestFramework.2.2.8\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll
-
-
- ..\packages\MSTest.TestFramework.2.2.8\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll
-
@@ -77,16 +72,13 @@
-
+
+ 2.2.8
+
+
+ 2.2.8
+
-
-
- This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
-
\ No newline at end of file
diff --git a/Examples/CSExamples/JustMock.NonElevatedExamples.VS2017/packages.config b/Examples/CSExamples/JustMock.NonElevatedExamples.VS2017/packages.config
deleted file mode 100644
index bc45eeab..00000000
--- a/Examples/CSExamples/JustMock.NonElevatedExamples.VS2017/packages.config
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/Examples/CSExamples/JustMock.NonElevatedExamples.VS2019/JustMock.NonElevatedExamples.VS2019.csproj b/Examples/CSExamples/JustMock.NonElevatedExamples.VS2019/JustMock.NonElevatedExamples.VS2019.csproj
index 75572365..d37c61a1 100644
--- a/Examples/CSExamples/JustMock.NonElevatedExamples.VS2019/JustMock.NonElevatedExamples.VS2019.csproj
+++ b/Examples/CSExamples/JustMock.NonElevatedExamples.VS2019/JustMock.NonElevatedExamples.VS2019.csproj
@@ -20,6 +20,7 @@
+ PackageReference
true
@@ -39,12 +40,6 @@
4
-
- ..\packages\MSTest.TestFramework.2.2.8\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll
-
-
- ..\packages\MSTest.TestFramework.2.2.8\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll
-
@@ -77,16 +72,13 @@
-
+
+ 2.2.8
+
+
+ 2.2.8
+
-
-
- This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
-
\ No newline at end of file
diff --git a/Examples/CSExamples/JustMock.NonElevatedExamples.VS2019/packages.config b/Examples/CSExamples/JustMock.NonElevatedExamples.VS2019/packages.config
deleted file mode 100644
index 1c8e18df..00000000
--- a/Examples/CSExamples/JustMock.NonElevatedExamples.VS2019/packages.config
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/Examples/CSExamples/JustMock.NonElevatedExamples.VS2022/JustMock.NonElevatedExamples.VS2022.csproj b/Examples/CSExamples/JustMock.NonElevatedExamples.VS2022/JustMock.NonElevatedExamples.VS2022.csproj
index 102b25d5..f9c508f9 100644
--- a/Examples/CSExamples/JustMock.NonElevatedExamples.VS2022/JustMock.NonElevatedExamples.VS2022.csproj
+++ b/Examples/CSExamples/JustMock.NonElevatedExamples.VS2022/JustMock.NonElevatedExamples.VS2022.csproj
@@ -2,7 +2,7 @@
JustMock.NonElevatedExamples.VS2022
- net6
+ net6.0
false
@@ -15,7 +15,7 @@
- $(registry:HKEY_LOCAL_MACHINE\Software\Telerik\JustMock@BinaryPath)netcoreapp2.0\Telerik.JustMock.dll
+ $(registry:HKEY_LOCAL_MACHINE\Software\Telerik\JustMock@BinaryPath)\netcoreapp2.0\Telerik.JustMock.dll
diff --git a/Examples/VBExamples/JustMock.NonElevatedExamples.VS2017/JustMock.NonElevatedExamples.VS2017.vbproj b/Examples/VBExamples/JustMock.NonElevatedExamples.VS2017/JustMock.NonElevatedExamples.VS2017.vbproj
index f341b007..82742544 100644
--- a/Examples/VBExamples/JustMock.NonElevatedExamples.VS2017/JustMock.NonElevatedExamples.VS2017.vbproj
+++ b/Examples/VBExamples/JustMock.NonElevatedExamples.VS2017/JustMock.NonElevatedExamples.VS2017.vbproj
@@ -20,6 +20,7 @@
+ PackageReference
true
@@ -52,14 +53,6 @@
On
-
- ..\packages\MSTest.TestFramework.2.2.8\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll
- True
-
-
- ..\packages\MSTest.TestFramework.2.2.8\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll
- True
-
@@ -116,7 +109,12 @@
-
+
+ 2.2.8
+
+
+ 2.2.8
+
diff --git a/Examples/VBExamples/JustMock.NonElevatedExamples.VS2017/packages.config b/Examples/VBExamples/JustMock.NonElevatedExamples.VS2017/packages.config
deleted file mode 100644
index bc45eeab..00000000
--- a/Examples/VBExamples/JustMock.NonElevatedExamples.VS2017/packages.config
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/Examples/VBExamples/JustMock.NonElevatedExamples.VS2019/JustMock.NonElevatedExamples.VS2019.vbproj b/Examples/VBExamples/JustMock.NonElevatedExamples.VS2019/JustMock.NonElevatedExamples.VS2019.vbproj
index a92fa2de..f34b6b91 100644
--- a/Examples/VBExamples/JustMock.NonElevatedExamples.VS2019/JustMock.NonElevatedExamples.VS2019.vbproj
+++ b/Examples/VBExamples/JustMock.NonElevatedExamples.VS2019/JustMock.NonElevatedExamples.VS2019.vbproj
@@ -52,14 +52,6 @@
On
-
- ..\packages\MSTest.TestFramework.2.2.8\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll
- True
-
-
- ..\packages\MSTest.TestFramework.2.2.8\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll
- True
-
@@ -108,7 +100,9 @@
-
+
+ 2.2.8
+
diff --git a/Examples/VBExamples/JustMock.NonElevatedExamples.VS2019/packages.config b/Examples/VBExamples/JustMock.NonElevatedExamples.VS2019/packages.config
deleted file mode 100644
index 1c8e18df..00000000
--- a/Examples/VBExamples/JustMock.NonElevatedExamples.VS2019/packages.config
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/Examples/VBExamples/JustMock.NonElevatedExamples.VS2022/JustMock.NonElevatedExamples.VS2022.vbproj b/Examples/VBExamples/JustMock.NonElevatedExamples.VS2022/JustMock.NonElevatedExamples.VS2022.vbproj
index 4551466b..0f06b907 100644
--- a/Examples/VBExamples/JustMock.NonElevatedExamples.VS2022/JustMock.NonElevatedExamples.VS2022.vbproj
+++ b/Examples/VBExamples/JustMock.NonElevatedExamples.VS2022/JustMock.NonElevatedExamples.VS2022.vbproj
@@ -15,7 +15,7 @@
- $(registry:HKEY_LOCAL_MACHINE\Software\Telerik\JustMock@BinaryPath)netcoreapp2.0\Telerik.JustMock.dll
+ $(registry:HKEY_LOCAL_MACHINE\Software\Telerik\JustMock@BinaryPath)\netcoreapp2.0\Telerik.JustMock.dll
diff --git a/Telerik.JustMock.MSTest2.Tests/Telerik.JustMock.MSTest2.Tests.csproj b/Telerik.JustMock.MSTest2.Tests/Telerik.JustMock.MSTest2.Tests.csproj
index c63b8690..6eaa6dfa 100644
--- a/Telerik.JustMock.MSTest2.Tests/Telerik.JustMock.MSTest2.Tests.csproj
+++ b/Telerik.JustMock.MSTest2.Tests/Telerik.JustMock.MSTest2.Tests.csproj
@@ -1,7 +1,7 @@

- netcoreapp2.1;netcoreapp3.1;net5.0
- net451;net472;$(NetCoreSupportedVersions)
+ netcoreapp3.1;net5.0
+ net461;net472;$(NetCoreSupportedVersions)
Debug;Release;ReleaseFree;DebugFree
Telerik.JustMock.MSTest2.Tests
Telerik.JustMock.Tests
@@ -90,7 +90,7 @@
-
+
\ No newline at end of file
diff --git a/Telerik.JustMock.NUnit.Tests/Telerik.JustMock.NUnit.Tests.csproj b/Telerik.JustMock.NUnit.Tests/Telerik.JustMock.NUnit.Tests.csproj
index 5cead419..1c582c65 100644
--- a/Telerik.JustMock.NUnit.Tests/Telerik.JustMock.NUnit.Tests.csproj
+++ b/Telerik.JustMock.NUnit.Tests/Telerik.JustMock.NUnit.Tests.csproj
@@ -1,6 +1,6 @@

- net451;netcoreapp2.1;netcoreapp3.1
+ net451;netcoreapp3.1
Debug;Release;DebugFree;ReleaseFree
Telerik.JustMock.NUnit.Tests
Telerik.JustMock.Tests
@@ -69,10 +69,10 @@
-
-
-
+
+
+
-
+
\ No newline at end of file
diff --git a/Telerik.JustMock.XUnit.Tests/Telerik.JustMock.XUnit.Tests.csproj b/Telerik.JustMock.XUnit.Tests/Telerik.JustMock.XUnit.Tests.csproj
index 58baaacf..4fba7c04 100644
--- a/Telerik.JustMock.XUnit.Tests/Telerik.JustMock.XUnit.Tests.csproj
+++ b/Telerik.JustMock.XUnit.Tests/Telerik.JustMock.XUnit.Tests.csproj
@@ -1,6 +1,6 @@

- net452;net472;netcoreapp2.1;netcoreapp3.1
+ net452;net472;netcoreapp3.1
Debug;Release;DebugFree;ReleaseFree
Telerik.JustMock.XUnit.Tests
Telerik.JustMock.Tests
diff --git a/Telerik.JustMock/AttributesToAvoidReplicating.cs b/Telerik.JustMock/AttributesToAvoidReplicating.cs
new file mode 100644
index 00000000..81ee5a9d
--- /dev/null
+++ b/Telerik.JustMock/AttributesToAvoidReplicating.cs
@@ -0,0 +1,42 @@
+/*
+ JustMock Lite
+ Copyright © 2023 Progress Software Corporation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+using System;
+
+namespace Telerik.JustMock
+{
+ ///
+ /// A list of attributes that must not be replicated when building a proxy. JustMock
+ /// tries to copy all attributes from the types and methods being proxied, but that is
+ /// not always a good idea for every type of attribute. Add additional attributes
+ /// to this list that prevent the proxy from working correctly.
+ ///
+#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
+ public static class AttributesToAvoidReplicating
+ {
+ public static void Add(Type attribute)
+ {
+ Core.ProfilerInterceptor.GuardInternal(() => Core.Castle.DynamicProxy.Generators.AttributesToAvoidReplicating.Add(attribute));
+ }
+
+ public static void Add()
+ {
+ Core.ProfilerInterceptor.GuardInternal(() => Core.Castle.DynamicProxy.Generators.AttributesToAvoidReplicating.Add());
+ }
+ }
+#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
+}
diff --git a/Telerik.JustMock/AutoMock/MockingContainer.cs b/Telerik.JustMock/AutoMock/MockingContainer.cs
index f4b8f048..595f250b 100644
--- a/Telerik.JustMock/AutoMock/MockingContainer.cs
+++ b/Telerik.JustMock/AutoMock/MockingContainer.cs
@@ -54,23 +54,23 @@ public MockingContainer(AutoMockSettings settings = null)
{
}
- ///
- /// Implementation detail.
- ///
- protected override bool ShouldAddComponent(Type component, Type implementation)
- {
- if (implementation == typeof(SelfBindingResolver))
- {
- return false;
- }
-
- return base.ShouldAddComponent(component, implementation);
- }
-
- ///
- /// Implementation detail.
- ///
- protected override void AddComponents()
+ ///
+ /// Implementation detail.
+ ///
+ protected override bool ShouldAddComponent(Type component, Type implementation)
+ {
+ if (implementation == typeof(SelfBindingResolver))
+ {
+ return false;
+ }
+
+ return base.ShouldAddComponent(component, implementation);
+ }
+
+ ///
+ /// Implementation detail.
+ ///
+ protected override void AddComponents()
{
base.AddComponents();
diff --git a/Telerik.JustMock/AutoMock/Ninject/Activation/Blocks/ActivationBlock.cs b/Telerik.JustMock/AutoMock/Ninject/Activation/Blocks/ActivationBlock.cs
index 3b109700..0bc6fe27 100644
--- a/Telerik.JustMock/AutoMock/Ninject/Activation/Blocks/ActivationBlock.cs
+++ b/Telerik.JustMock/AutoMock/Ninject/Activation/Blocks/ActivationBlock.cs
@@ -1,40 +1,41 @@
-#region License
-//
-// Author: Nate Kohari
-// Copyright (c) 2007-2010, Enkari, Ltd.
-//
-// Dual-licensed under the Apache License, Version 2.0, and the Microsoft Public License (Ms-PL).
-// See the file LICENSE.txt for details.
-//
-#endregion
-#region Using Directives
-using System;
-using System.Collections.Generic;
-using Telerik.JustMock.AutoMock.Ninject.Infrastructure;
-using Telerik.JustMock.AutoMock.Ninject.Infrastructure.Disposal;
-using Telerik.JustMock.AutoMock.Ninject.Parameters;
-using Telerik.JustMock.AutoMock.Ninject.Planning.Bindings;
-using Telerik.JustMock.AutoMock.Ninject.Syntax;
-#endregion
+// -------------------------------------------------------------------------------------------------
+//
+// Copyright (c) 2007-2010 Enkari, Ltd. All rights reserved.
+// Copyright (c) 2010-2017 Ninject Project Contributors. All rights reserved.
+//
+// Dual-licensed under the Apache License, Version 2.0, and the Microsoft Public License (Ms-PL).
+// You may not use this file except in compliance with one of the Licenses.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+// or
+// http://www.microsoft.com/opensource/licenses.mspx
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// -------------------------------------------------------------------------------------------------
namespace Telerik.JustMock.AutoMock.Ninject.Activation.Blocks
{
+ using System;
+ using System.Collections.Generic;
+
+ using Telerik.JustMock.AutoMock.Ninject.Infrastructure;
+ using Telerik.JustMock.AutoMock.Ninject.Infrastructure.Disposal;
+ using Telerik.JustMock.AutoMock.Ninject.Parameters;
+ using Telerik.JustMock.AutoMock.Ninject.Planning.Bindings;
+ using Telerik.JustMock.AutoMock.Ninject.Syntax;
+
///
/// A block used for deterministic disposal of activated instances. When the block is
/// disposed, all instances activated via it will be deactivated.
///
public class ActivationBlock : DisposableObject, IActivationBlock
{
- ///
- /// Gets or sets the parent resolution root (usually the kernel).
- ///
- public IResolutionRoot Parent { get; private set; }
-
- ///
- /// Occurs when the object is disposed.
- ///
- public event EventHandler Disposed;
-
///
/// Initializes a new instance of the class.
///
@@ -42,25 +43,23 @@ public class ActivationBlock : DisposableObject, IActivationBlock
public ActivationBlock(IResolutionRoot parent)
{
Ensure.ArgumentNotNull(parent, "parent");
- Parent = parent;
+
+ this.Parent = parent;
}
///
- /// Releases resources held by the object.
+ /// Gets the parent resolution root (usually the kernel).
///
- public override void Dispose(bool disposing)
- {
- lock (this)
- {
- if (disposing && !IsDisposed)
- {
- var evt = Disposed;
- if (evt != null) evt(this, EventArgs.Empty);
- Disposed = null;
- }
+ public IResolutionRoot Parent { get; private set; }
- base.Dispose(disposing);
- }
+ ///
+ /// Injects the specified existing instance, without managing its lifecycle.
+ ///
+ /// The instance to inject.
+ /// The parameters to pass to the request.
+ public void Inject(object instance, params IParameter[] parameters)
+ {
+ this.Parent.Inject(instance, parameters);
}
///
@@ -71,6 +70,7 @@ public override void Dispose(bool disposing)
public bool CanResolve(IRequest request)
{
Ensure.ArgumentNotNull(request, "request");
+
return this.Parent.CanResolve(request);
}
@@ -85,6 +85,7 @@ public bool CanResolve(IRequest request)
public bool CanResolve(IRequest request, bool ignoreImplicitBindings)
{
Ensure.ArgumentNotNull(request, "request");
+
return this.Parent.CanResolve(request, ignoreImplicitBindings);
}
@@ -97,7 +98,8 @@ public bool CanResolve(IRequest request, bool ignoreImplicitBindings)
public IEnumerable
public class ActivationCache : NinjectComponent, IActivationCache, IPruneable
{
-#if SILVERLIGHT_20 || SILVERLIGHT_30 || WINDOWS_PHONE || NETCF || MONO
- ///
- /// The objects that were activated as reference equal weak references.
- ///
- private readonly IDictionary