diff --git a/.nuget/packages.config b/.nuget/packages.config
deleted file mode 100644
index c018944..0000000
--- a/.nuget/packages.config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ConsoleApplication1/ConsoleApplication1.csproj b/ConsoleApplication1/ConsoleApplication1.csproj
index e8d17ab..dbc2485 100644
--- a/ConsoleApplication1/ConsoleApplication1.csproj
+++ b/ConsoleApplication1/ConsoleApplication1.csproj
@@ -1,76 +1,12 @@
-
-
-
+
- Debug
- AnyCPU
- {9C8FF3F3-C560-4390-A113-3A5220F02E15}
+ net48;net6.0
+ ..\bin
Exe
- Properties
- ConsoleApplication1
- ConsoleApplication1
- v4.5
- 512
+ false
-
- AnyCPU
- true
- full
- false
- ..\bin\win\
- DEBUG;TRACE
- prompt
- 4
- true
-
-
- AnyCPU
- pdbonly
- true
- ..\bin\win\
- TRACE
- prompt
- 4
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Designer
-
-
-
- {377C04C5-EE8C-4159-BDDC-37F1A8372705}
- SharpRemote.Test
-
-
- {1B908B3A-2F3B-47B8-B69F-3827B8829586}
- SharpRemote
-
+
+
-
-
\ No newline at end of file
diff --git a/Samples/SampleBrowser/SampleBrowser.csproj b/Samples/SampleBrowser/SampleBrowser.csproj
index 08940d6..ccd23c0 100644
--- a/Samples/SampleBrowser/SampleBrowser.csproj
+++ b/Samples/SampleBrowser/SampleBrowser.csproj
@@ -1,180 +1,72 @@
-
-
-
-
- Debug
- AnyCPU
- {4C11A5D4-F468-4B6E-BB57-2E1B521DBCB2}
- WinExe
- Properties
- SampleBrowser
- SampleBrowser
- v4.5
- 512
- {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- 4
-
-
- AnyCPU
- true
- full
- false
- ..\..\bin\win\
- DEBUG;TRACE
- prompt
- 4
-
-
- AnyCPU
- pdbonly
- true
- ..\..\bin\win\
- TRACE
- prompt
- 4
-
-
-
- ..\..\packages\log4net.2.0.12\lib\net45\log4net.dll
-
-
-
-
-
-
-
-
-
- 4.0
-
-
-
-
-
-
-
- MSBuild:Compile
- Designer
-
-
-
-
-
-
-
- BluetoothView.xaml
-
-
-
-
- HostView.xaml
-
-
-
-
-
- InProcessHostView.xaml
-
-
-
-
-
-
-
-
-
-
-
- LongTermView.xaml
-
-
-
-
- Designer
- MSBuild:Compile
-
-
- MSBuild:Compile
- Designer
-
-
- App.xaml
- Code
-
-
- MainWindow.xaml
- Code
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
- MSBuild:Compile
- Designer
-
-
-
-
- Code
-
-
- True
- True
- Resources.resx
-
-
- True
- Settings.settings
- True
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
-
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
-
-
-
-
-
-
- {41f098da-29dc-48af-9c6c-2bc6f4f0be41}
- SharpRemote.Bluetooth
-
-
- {377C04C5-EE8C-4159-BDDC-37F1A8372705}
- SharpRemote.Test
-
-
- {1B908B3A-2F3B-47B8-B69F-3827B8829586}
- SharpRemote
-
-
-
-
-
+
+
+ net48
+ ..\..\bin
+ Exe
+ false
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+ Designer
+
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/SampleBrowser/packages.config b/Samples/SampleBrowser/packages.config
deleted file mode 100644
index 6419ef8..0000000
--- a/Samples/SampleBrowser/packages.config
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/Samples/SampleLibrary/NativeResource/IErrorListener.cs b/Samples/SampleLibrary/NativeResource/IErrorListener.cs
deleted file mode 100644
index 528aa97..0000000
--- a/Samples/SampleLibrary/NativeResource/IErrorListener.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-namespace SampleLibrary.NativeResource
-{
- public interface IErrorListener
- {
- void ReportError(string error);
- }
-}
\ No newline at end of file
diff --git a/Samples/SampleLibrary/NativeResource/IUsesNativeResource.cs b/Samples/SampleLibrary/NativeResource/IUsesNativeResource.cs
deleted file mode 100644
index ed24332..0000000
--- a/Samples/SampleLibrary/NativeResource/IUsesNativeResource.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-namespace SampleLibrary.NativeResource
-{
- public interface IUsesNativeResource
- {
- void Load(string path);
-
- string CurrentPath { get; }
-
- double CalculateTheMeaningOfEverything();
-
- Metadata Metadata { get; }
-
- ///
- /// Adds a listener to this object.
- ///
- ///
- /// We tell SharpRemote that the parameter is to be marshalled by reference
- /// instead of the default by value. This means that instead of serializing that object, a servant is created
- /// on-the-fly while the actual implementation of this interface is called with a proxy that itself
- /// marshalls all calls to the other side.
- ///
- ///
- void AddListener(IErrorListener listener);
-
- ///
- /// Removes the given listener from this object or does nothing if it hasn't been registered.
- ///
- ///
- void RemoveListener(IErrorListener listener);
- }
-}
\ No newline at end of file
diff --git a/Samples/SampleLibrary/NativeResource/Metadata.cs b/Samples/SampleLibrary/NativeResource/Metadata.cs
deleted file mode 100644
index 83c974a..0000000
--- a/Samples/SampleLibrary/NativeResource/Metadata.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace SampleLibrary.NativeResource
-{
- ///
- /// Example of a custom class that can be seamlessly marshalled across processes.
- ///
- [DataContract]
- public class Metadata
- {
- [DataMember]
- public string FileName { get; set; }
-
- [DataMember]
- public long FileSize { get; set; }
- }
-}
\ No newline at end of file
diff --git a/Samples/SampleLibrary/NativeResource/UsesNativeResource.cs b/Samples/SampleLibrary/NativeResource/UsesNativeResource.cs
deleted file mode 100644
index 90ec578..0000000
--- a/Samples/SampleLibrary/NativeResource/UsesNativeResource.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using System;
-
-namespace SampleLibrary.NativeResource
-{
- ///
- /// An example class that uses a native resource that, due to depending on
- /// a legacy software, can only be executed within an x86 environment.
- ///
- public sealed class UsesNativeResource
- : IUsesNativeResource
- {
- public UsesNativeResource()
- {
- if (Environment.Is64BitProcess)
- throw new NotSupportedException("Can only executed under 32bit!");
- }
-
- public void Load(string path)
- {
- throw new NotImplementedException();
- }
-
- public string CurrentPath
- {
- get { throw new NotImplementedException(); }
- }
-
- public double CalculateTheMeaningOfEverything()
- {
- throw new NotImplementedException();
- }
-
- public Metadata Metadata
- {
- get { throw new NotImplementedException(); }
- }
-
- public void AddListener(IErrorListener listener)
- {
- throw new NotImplementedException();
- }
-
- public void RemoveListener(IErrorListener listener)
- {
- throw new NotImplementedException();
- }
- }
-}
\ No newline at end of file
diff --git a/Samples/SampleLibrary/SampleLibrary.csproj b/Samples/SampleLibrary/SampleLibrary.csproj
deleted file mode 100644
index 072e4a5..0000000
--- a/Samples/SampleLibrary/SampleLibrary.csproj
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {21331D8D-C95A-44AE-BB90-62F9CA0F1AB6}
- Library
- Properties
- SampleLibrary
- SampleLibrary
- v4.5
- 512
-
-
- true
- full
- false
- bin\win\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\win\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/SharpRemote.Bluetooth/EndPoints/Bluetooth/BluetoothRemotingEndPoint.cs b/SharpRemote.Bluetooth/EndPoints/Bluetooth/BluetoothRemotingEndPoint.cs
index e7c5bf7..db00ac3 100644
--- a/SharpRemote.Bluetooth/EndPoints/Bluetooth/BluetoothRemotingEndPoint.cs
+++ b/SharpRemote.Bluetooth/EndPoints/Bluetooth/BluetoothRemotingEndPoint.cs
@@ -4,7 +4,6 @@
using InTheHand.Net;
using InTheHand.Net.Bluetooth;
using InTheHand.Net.Sockets;
-using SharpRemote.EndPoints.Sockets;
// ReSharper disable CheckNamespace
namespace SharpRemote
diff --git a/SharpRemote.Bluetooth/SharpRemote.Bluetooth.csproj b/SharpRemote.Bluetooth/SharpRemote.Bluetooth.csproj
index af08f77..f471998 100644
--- a/SharpRemote.Bluetooth/SharpRemote.Bluetooth.csproj
+++ b/SharpRemote.Bluetooth/SharpRemote.Bluetooth.csproj
@@ -1,72 +1,13 @@
-
-
-
+
- Debug
- AnyCPU
- {41F098DA-29DC-48AF-9C6C-2BC6F4F0BE41}
- Library
- Properties
- SharpRemote
- SharpRemote.Bluetooth
- v4.5
- 512
-
+ net48
+ ..\bin
+ false
-
- true
- full
- false
- ..\bin\win\
- DEBUG;TRACE
- prompt
- 4
- ..\bin\win\SharpRemote.Bluetooth.XML
- true
-
-
- pdbonly
- true
- ..\bin\win\
- TRACE
- prompt
- 4
- ..\bin\win\SharpRemote.Bluetooth.XML
- true
-
-
-
- ..\packages\32feet.NET.3.5.0.0\lib\net\InTheHand.Net.Personal.dll
- True
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
- {1B908B3A-2F3B-47B8-B69F-3827B8829586}
- SharpRemote
-
+
-
-
\ No newline at end of file
diff --git a/SharpRemote.Bluetooth/packages.config b/SharpRemote.Bluetooth/packages.config
deleted file mode 100644
index a2899e3..0000000
--- a/SharpRemote.Bluetooth/packages.config
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/SharpRemote.Host.FailsStartup/SharpRemote.Host.FailsStartup.csproj b/SharpRemote.Host.FailsStartup/SharpRemote.Host.FailsStartup.csproj
index 308ba50..1edb657 100644
--- a/SharpRemote.Host.FailsStartup/SharpRemote.Host.FailsStartup.csproj
+++ b/SharpRemote.Host.FailsStartup/SharpRemote.Host.FailsStartup.csproj
@@ -1,66 +1,11 @@
-
-
-
+
- Debug
- AnyCPU
- {C0C2492B-E3E3-49E2-BA97-76CB07C3F473}
+ net48;net6.0
+ ..\bin
Exe
- Properties
- SharpRemote.Host.FailsStartup
- SharpRemote.Host.FailsStartup
- v4.5
- 512
+ false
-
- AnyCPU
- true
- full
- false
- ..\bin\win\
- DEBUG;TRACE
- prompt
- 4
- true
-
-
- AnyCPU
- pdbonly
- true
- ..\bin\win\
- TRACE
- prompt
- 4
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {1B908B3A-2F3B-47B8-B69F-3827B8829586}
- SharpRemote
-
+
-
-
\ No newline at end of file
diff --git a/SharpRemote.Host/Program.cs b/SharpRemote.Host/Program.cs
index 6373614..1371615 100644
--- a/SharpRemote.Host/Program.cs
+++ b/SharpRemote.Host/Program.cs
@@ -6,6 +6,7 @@
using SharpRemote.Hosting;
using log4net;
using log4net.Config;
+using SharpRemote.CodeGeneration;
namespace SharpRemote.Host
{
@@ -18,7 +19,11 @@ private static void Main(string[] args)
try
{
GlobalContext.Properties["pid"] = Process.GetCurrentProcess().Id;
- XmlConfigurator.Configure(new FileInfo("SharpRemote.Host.exe.config"));
+ var log4NetConfigFileInfo = new FileInfo("SharpRemote.Host.exe.config");
+ if (!log4NetConfigFileInfo.Exists)
+ log4NetConfigFileInfo = new FileInfo("SharpRemote.Host.dll.config");
+
+ XmlConfigurator.Configure(log4NetConfigFileInfo);
AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
@@ -26,6 +31,7 @@ private static void Main(string[] args)
{
silo.Run(IPAddress.Loopback);
}
+
}
catch (Exception e)
{
diff --git a/SharpRemote.Host/SharpRemote.Host.csproj b/SharpRemote.Host/SharpRemote.Host.csproj
index 18db913..927caf1 100644
--- a/SharpRemote.Host/SharpRemote.Host.csproj
+++ b/SharpRemote.Host/SharpRemote.Host.csproj
@@ -1,101 +1,14 @@
-
-
-
+
- Debug
- AnyCPU
- {21218E92-3815-4E5E-9761-C3FB0709F532}
+ net48;net6.0
+ ..\bin
Exe
- Properties
- SharpRemote.Host
- SharpRemote.Host
- v4.5
- 512
-
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
+ false
-
- AnyCPU
- true
- full
- false
- ..\bin\win\
- TRACE;DEBUG
- prompt
- 4
- true
-
-
- AnyCPU
- pdbonly
- true
- ..\bin\win\
- TRACE
- prompt
- 4
- true
-
-
- SharpRemote.Host.Program
-
-
-
- ..\packages\log4net.2.0.12\lib\net45\log4net.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
- Designer
-
-
-
-
- False
- .NET Framework 3.5 SP1 Client Profile
- false
-
-
- False
- .NET Framework 3.5 SP1
- false
-
+
-
- {1B908B3A-2F3B-47B8-B69F-3827B8829586}
- SharpRemote
-
+
-
-
\ No newline at end of file
diff --git a/SharpRemote.Host/packages.config b/SharpRemote.Host/packages.config
deleted file mode 100644
index 6419ef8..0000000
--- a/SharpRemote.Host/packages.config
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/SharpRemote.NETCore/SharpRemote.NETCore.csproj b/SharpRemote.NETCore/SharpRemote.NETCore.csproj
deleted file mode 100644
index dd79b52..0000000
--- a/SharpRemote.NETCore/SharpRemote.NETCore.csproj
+++ /dev/null
@@ -1,313 +0,0 @@
-
-
-
- netcoreapp3.0
- SharpRemote
- SharpRemote
-
-
-
- ..\bin\
- TRACE;DOTNETCORE
-
-
-
- TRACE;DOTNETCORE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/SharpRemote.SystemTest/AssemblySetup.cs b/SharpRemote.SystemTest/AssemblySetup.cs
index fd7d00f..3adec2d 100644
--- a/SharpRemote.SystemTest/AssemblySetup.cs
+++ b/SharpRemote.SystemTest/AssemblySetup.cs
@@ -11,7 +11,7 @@ public sealed class AssemblySetup
[OneTimeSetUp]
public void OneTimeSetUp()
{
- string codeBase = Assembly.GetExecutingAssembly().CodeBase;
+ string codeBase = Assembly.GetExecutingAssembly().Location;
UriBuilder uri = new UriBuilder(codeBase);
string path = Uri.UnescapeDataString(uri.Path);
var directory = Path.GetDirectoryName(path);
diff --git a/SharpRemote.SystemTest/Hosting/HeartbeatMonitorTest.cs b/SharpRemote.SystemTest/Hosting/HeartbeatMonitorTest.cs
index a61f091..dd878cd 100644
--- a/SharpRemote.SystemTest/Hosting/HeartbeatMonitorTest.cs
+++ b/SharpRemote.SystemTest/Hosting/HeartbeatMonitorTest.cs
@@ -117,7 +117,7 @@ public void TestCtor2()
locEndPoint: _localEndPoint,
remoteEndPoint: _remoteEndPoint))
.Should().Throw()
- .WithMessage("Value cannot be null.\r\nParameter name: heartbeat");
+ .WithMessage("Value cannot be null*Parameter*heartbeat*");
}
[Test]
@@ -136,7 +136,7 @@ public void TestCtor3()
locEndPoint: _localEndPoint,
remoteEndPoint: _remoteEndPoint))
.Should().Throw()
- .WithMessage("Value cannot be null.\r\nParameter name: debugger");
+ .WithMessage("Value cannot be null*Parameter*debugger*");
}
[Test]
@@ -154,7 +154,7 @@ public void TestCtor4()
locEndPoint: _localEndPoint,
remoteEndPoint: _remoteEndPoint))
.Should().Throw()
- .WithMessage("Specified argument was out of the range of valid values.\r\nParameter name: heartBeatInterval");
+ .WithMessage("Specified argument was out of the range of valid values*Parameter*heartBeatInterval*");
}
[Test]
@@ -172,7 +172,7 @@ public void TestCtor5()
locEndPoint: _localEndPoint,
remoteEndPoint: _remoteEndPoint))
.Should().Throw()
- .WithMessage("Specified argument was out of the range of valid values.\r\nParameter name: failureThreshold");
+ .WithMessage("Specified argument was out of the range of valid values*Parameter*failureThreshold*");
}
[Test]
diff --git a/SharpRemote.SystemTest/OutOfProcessSilo/CtorTest.cs b/SharpRemote.SystemTest/OutOfProcessSilo/CtorTest.cs
index 17b2ca5..f5d3a6a 100644
--- a/SharpRemote.SystemTest/OutOfProcessSilo/CtorTest.cs
+++ b/SharpRemote.SystemTest/OutOfProcessSilo/CtorTest.cs
@@ -74,19 +74,19 @@ public void TestCtor6()
{
new Action(() => new SharpRemote.Hosting.OutOfProcessSilo(failureSettings: new FailureSettings { HeartbeatSettings = { Interval = TimeSpan.Zero } }))
.Should().Throw()
- .WithMessage("The heartbeat interval must be greater than zero\r\nParameter name: heartbeatSettings.Interval");
+ .WithMessage("The heartbeat interval must be greater than zero*Parameter*heartbeatSettings.Interval*");
new Action(() => new SharpRemote.Hosting.OutOfProcessSilo(failureSettings: new FailureSettings{HeartbeatSettings = { Interval = TimeSpan.FromSeconds(-1) }}))
.Should().Throw()
- .WithMessage("The heartbeat interval must be greater than zero\r\nParameter name: heartbeatSettings.Interval");
+ .WithMessage("The heartbeat interval must be greater than zero*Parameter*heartbeatSettings.Interval*");
new Action(() => new SharpRemote.Hosting.OutOfProcessSilo(failureSettings: new FailureSettings { HeartbeatSettings = { SkippedHeartbeatThreshold = 0} }))
.Should().Throw()
- .WithMessage("The skipped heartbeat threshold must be greater than zero\r\nParameter name: heartbeatSettings.SkippedHeartbeatThreshold");
+ .WithMessage("The skipped heartbeat threshold must be greater than zero*Parameter*heartbeatSettings.SkippedHeartbeatThreshold*");
new Action(() => new SharpRemote.Hosting.OutOfProcessSilo(failureSettings: new FailureSettings { HeartbeatSettings = { SkippedHeartbeatThreshold = -1 } }))
.Should().Throw()
- .WithMessage("The skipped heartbeat threshold must be greater than zero\r\nParameter name: heartbeatSettings.SkippedHeartbeatThreshold");
+ .WithMessage("The skipped heartbeat threshold must be greater than zero*Parameter*heartbeatSettings.SkippedHeartbeatThreshold*");
}
[Test]
@@ -96,19 +96,19 @@ public void TestCtor7()
new Action(
() => new SharpRemote.Hosting.OutOfProcessSilo(failureSettings: new FailureSettings { EndPointConnectTimeout = TimeSpan.FromSeconds(-1) }))
.Should().Throw()
- .WithMessage("EndPointConnectTimeout should be greater than zero\r\nParameter name: failureSettings");
+ .WithMessage("EndPointConnectTimeout should be greater than zero*Parameter*failureSettings*");
new Action(
() => new SharpRemote.Hosting.OutOfProcessSilo(failureSettings: new FailureSettings { EndPointConnectTimeout = TimeSpan.Zero }))
.Should().Throw()
- .WithMessage("EndPointConnectTimeout should be greater than zero\r\nParameter name: failureSettings");
+ .WithMessage("EndPointConnectTimeout should be greater than zero*Parameter*failureSettings*");
new Action(
() => new SharpRemote.Hosting.OutOfProcessSilo(failureSettings: new FailureSettings { ProcessReadyTimeout = TimeSpan.FromSeconds(-1) }))
.Should().Throw()
- .WithMessage("ProcessReadyTimeout should be greater than zero\r\nParameter name: failureSettings");
+ .WithMessage("ProcessReadyTimeout should be greater than zero*Parameter*failureSettings*");
new Action(
() => new SharpRemote.Hosting.OutOfProcessSilo(failureSettings: new FailureSettings { ProcessReadyTimeout = TimeSpan.Zero }))
.Should().Throw()
- .WithMessage("ProcessReadyTimeout should be greater than zero\r\nParameter name: failureSettings");
+ .WithMessage("ProcessReadyTimeout should be greater than zero*Parameter*failureSettings*");
}
}
diff --git a/SharpRemote.SystemTest/OutOfProcessSilo/FailureDetectionTest.cs b/SharpRemote.SystemTest/OutOfProcessSilo/FailureDetectionTest.cs
index 1dfcb10..af1e168 100644
--- a/SharpRemote.SystemTest/OutOfProcessSilo/FailureDetectionTest.cs
+++ b/SharpRemote.SystemTest/OutOfProcessSilo/FailureDetectionTest.cs
@@ -164,6 +164,10 @@ public void TestFailureDetection11()
)]
public void TestFailureDetection2()
{
+ #if NET6_0
+ Assert.Inconclusive("Thread aborting not support in .NET 6.0");
+ #endif
+
Failure? failure = null;
Decision? decision = null;
Resolution? resolution = null;
diff --git a/SharpRemote.SystemTest/OutOfProcessSilo/StartTest.cs b/SharpRemote.SystemTest/OutOfProcessSilo/StartTest.cs
index 7297a2f..c4e241b 100644
--- a/SharpRemote.SystemTest/OutOfProcessSilo/StartTest.cs
+++ b/SharpRemote.SystemTest/OutOfProcessSilo/StartTest.cs
@@ -52,7 +52,7 @@ public void TestStart2()
new Action(silo.Start)
.Should().Throw()
- .WithMessage("The system cannot find the file specified");
+ .WithMessage("*The system cannot find the file specified*");
silo.IsProcessRunning.Should().BeFalse("because we shouldn't have been able to start the process");
silo.HasProcessFailed.Should().BeFalse();
@@ -72,7 +72,7 @@ public void TestStart3()
new Action(silo.Start)
.Should().Throw()
- .WithMessage("The specified executable is not a valid application for this OS platform.");
+ .WithMessage("*The specified executable is not a valid application for this OS platform.");
silo.IsProcessRunning.Should().BeFalse();
silo.HasProcessFailed.Should().BeFalse();
diff --git a/SharpRemote.SystemTest/ServiceDiscovery/NetworkServiceDiscovererTest.cs b/SharpRemote.SystemTest/ServiceDiscovery/NetworkServiceDiscovererTest.cs
index 683986f..1664571 100644
--- a/SharpRemote.SystemTest/ServiceDiscovery/NetworkServiceDiscovererTest.cs
+++ b/SharpRemote.SystemTest/ServiceDiscovery/NetworkServiceDiscovererTest.cs
@@ -36,7 +36,7 @@ public void TestRegisterTooBig()
{
new Action(() => _discoverer.RegisterService("dawwdawd", new IPEndPoint(IPAddress.Any, 0), new byte[500]))
.Should().Throw()
- .WithMessage("The total size of a message may not exceed 512 bytes (this message would be 568 bytes in length)\r\nParameter name: payload");
+ .WithMessage("The total size of a message may not exceed 512 bytes (this message would be 568 bytes in length)*Parameter*payload*");
}
//[Test]
diff --git a/SharpRemote.SystemTest/SharpRemote.SystemTest.csproj b/SharpRemote.SystemTest/SharpRemote.SystemTest.csproj
index b836f98..9fc105d 100644
--- a/SharpRemote.SystemTest/SharpRemote.SystemTest.csproj
+++ b/SharpRemote.SystemTest/SharpRemote.SystemTest.csproj
@@ -1,121 +1,24 @@
-
-
-
-
+
- Debug
- AnyCPU
- {792694CE-6935-4452-9F3C-319ADAA87A26}
- Library
- Properties
- SharpRemote.SystemTest
- SharpRemote.SystemTest
- v4.5
- 512
-
-
+ net48;net6.0
+ ..\bin
+ false
-
- true
- full
- false
- ..\bin\win\
- DEBUG;TRACE
- prompt
- 4
- true
-
-
- pdbonly
- true
- ..\bin\win\
- TRACE
- prompt
- 4
- true
-
-
-
- ..\packages\Castle.Core.4.4.0\lib\net45\Castle.Core.dll
-
-
- ..\packages\FluentAssertions.5.10.3\lib\net45\FluentAssertions.dll
-
-
- ..\packages\FluentAssertions.Extensions.1.0.18\lib\net45\FluentAssertions.Extensions.dll
-
-
- ..\packages\log4net.2.0.12\lib\net45\log4net.dll
-
-
- ..\packages\Moq.4.16.1\lib\net45\Moq.dll
-
-
- ..\packages\NUnit.3.13.2\lib\net45\nunit.framework.dll
-
-
-
-
-
- ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll
-
-
-
- ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll
-
-
- ..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {377C04C5-EE8C-4159-BDDC-37F1A8372705}
- SharpRemote.Test
-
-
- {1B908B3A-2F3B-47B8-B69F-3827B8829586}
- SharpRemote
-
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
- 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/SharpRemote.SystemTest/packages.config b/SharpRemote.SystemTest/packages.config
deleted file mode 100644
index 39d43aa..0000000
--- a/SharpRemote.SystemTest/packages.config
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/SharpRemote.Test/AssemblySetup.cs b/SharpRemote.Test/AssemblySetup.cs
index b6eb30c..8f666fb 100644
--- a/SharpRemote.Test/AssemblySetup.cs
+++ b/SharpRemote.Test/AssemblySetup.cs
@@ -11,7 +11,7 @@ public sealed class AssemblySetup
[OneTimeSetUp]
public void OneTimeSetUp()
{
- string codeBase = Assembly.GetExecutingAssembly().CodeBase;
+ string codeBase = Assembly.GetExecutingAssembly().Location;
UriBuilder uri = new UriBuilder(codeBase);
string path = Uri.UnescapeDataString(uri.Path);
var directory = Path.GetDirectoryName(path);
diff --git a/SharpRemote.Test/CodeGeneration/FailureHandling/ProxyCreatorTest.cs b/SharpRemote.Test/CodeGeneration/FailureHandling/ProxyCreatorTest.cs
index 244723f..cd9407c 100644
--- a/SharpRemote.Test/CodeGeneration/FailureHandling/ProxyCreatorTest.cs
+++ b/SharpRemote.Test/CodeGeneration/FailureHandling/ProxyCreatorTest.cs
@@ -27,25 +27,11 @@ private ProxyCreator Create()
public void Setup()
{
var assemblyName = new AssemblyName("SharpRemote.GeneratedCode.FaultTolerance");
- _assembly = AssemblyBuilder.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.RunAndSave);
+ _assembly = AssemblyBuilder.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run);
string moduleName = assemblyName.Name + ".dll";
_module = _assembly.DefineDynamicModule(moduleName);
}
- public void Save()
- {
- var fname = "SharpRemote.GeneratedCode.FaultTolerance.dll";
- try
- {
- _assembly.Save(fname);
- TestContext.Out.WriteLine("Assembly written to: {0}", Path.Combine(Directory.GetCurrentDirectory(), fname));
- }
- catch (Exception e)
- {
- TestContext.Out.WriteLine("Couldn't write assembly: {0}", e);
- }
- }
-
#region Timeouts
[Test]
@@ -60,7 +46,6 @@ public void TestIReturnsIntTaskMethodStringTimeout1()
var proxy = creator.PrepareProxyFor(subject.Object)
.WithMaximumLatencyOf(TimeSpan.FromSeconds(10))
.Create();
- Save();
Await(proxy.CreateFile("simon")).Should().Be(-21321211);
subject.Verify(x => x.CreateFile("simon"), Times.Once);
@@ -476,8 +461,6 @@ public void TestIReturnsIntTaskDefaultFallback()
var proxy = creator.PrepareProxyFor(subject.Object)
.WithDefaultFallback()
.Create();
- Save();
-
proxy.DoStuff();
subject.Verify(x => x.DoStuff(), Times.Once);
diff --git a/SharpRemote.Test/CodeGeneration/Remoting/RemotingProxyCreatorTest.cs b/SharpRemote.Test/CodeGeneration/Remoting/RemotingProxyCreatorTest.cs
index 18df1ae..d6b555a 100644
--- a/SharpRemote.Test/CodeGeneration/Remoting/RemotingProxyCreatorTest.cs
+++ b/SharpRemote.Test/CodeGeneration/Remoting/RemotingProxyCreatorTest.cs
@@ -34,7 +34,7 @@ public sealed class RemotingProxyCreatorTest
public void SetUp()
{
var assemblyName = new AssemblyName("SharpRemote.GeneratedCode.Proxies");
- _assembly = AssemblyBuilder.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.RunAndSave);
+ _assembly = AssemblyBuilder.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run);
_moduleName = assemblyName.Name + ".dll";
ModuleBuilder module = _assembly.DefineDynamicModule(_moduleName);
@@ -47,12 +47,6 @@ public void SetUp()
_creator = new RemotingProxyCreator(module);
}
- [OneTimeTearDown]
- public void TearDown()
- {
- _assembly.Save(_moduleName);
- }
-
private T TestGenerate()
{
Type type = null;
diff --git a/SharpRemote.Test/CodeGeneration/Remoting/ServantCreatorTest.cs b/SharpRemote.Test/CodeGeneration/Remoting/ServantCreatorTest.cs
index 17b4a75..d889565 100644
--- a/SharpRemote.Test/CodeGeneration/Remoting/ServantCreatorTest.cs
+++ b/SharpRemote.Test/CodeGeneration/Remoting/ServantCreatorTest.cs
@@ -25,7 +25,7 @@ public sealed class ServantCreatorTest
public void SetUp()
{
var assemblyName = new AssemblyName("SharpRemote.GeneratedCode.Servants");
- _assembly = AssemblyBuilder.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.RunAndSave);
+ _assembly = AssemblyBuilder.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run);
_moduleName = assemblyName.Name + ".dll";
ModuleBuilder module = _assembly.DefineDynamicModule(_moduleName);
@@ -47,12 +47,6 @@ public void SetUp()
private string _moduleName;
private ISerializer _serializer;
- [OneTimeTearDown]
- public void TearDown()
- {
- _assembly.Save(_moduleName);
- }
-
private IServant TestGenerate(T subject)
{
Type type = null;
diff --git a/SharpRemote.Test/CodeGeneration/Serialization/AbstractSerializerAcceptanceTest.cs b/SharpRemote.Test/CodeGeneration/Serialization/AbstractSerializerAcceptanceTest.cs
index bc9e19a..02d271f 100644
--- a/SharpRemote.Test/CodeGeneration/Serialization/AbstractSerializerAcceptanceTest.cs
+++ b/SharpRemote.Test/CodeGeneration/Serialization/AbstractSerializerAcceptanceTest.cs
@@ -16,7 +16,6 @@ namespace SharpRemote.Test.CodeGeneration.Serialization
public abstract class AbstractSerializerAcceptanceTest
{
protected abstract ISerializer2 Create();
- protected abstract void Save();
public static IEnumerable GrainIds => new ulong[]
{
@@ -1656,7 +1655,6 @@ private void MethodCallRoundtripObject(T value)
using (var stream = new MemoryStream())
{
serializer.RegisterType();
- Save();
using (var writer = serializer.CreateMethodCallWriter(stream, 5, 6, "GetValue"))
{
@@ -1693,7 +1691,6 @@ private void MethodCallRoundtripSingleton(T value) where T : class
using (var stream = new MemoryStream())
{
serializer.RegisterType();
- Save();
using (var writer = serializer.CreateMethodCallWriter(stream, 5, 6, "GetValue"))
{
diff --git a/SharpRemote.Test/CodeGeneration/Serialization/Binary/BinarySerializerAcceptanceTest.cs b/SharpRemote.Test/CodeGeneration/Serialization/Binary/BinarySerializerAcceptanceTest.cs
index 6726df2..1e71bb7 100644
--- a/SharpRemote.Test/CodeGeneration/Serialization/Binary/BinarySerializerAcceptanceTest.cs
+++ b/SharpRemote.Test/CodeGeneration/Serialization/Binary/BinarySerializerAcceptanceTest.cs
@@ -21,7 +21,7 @@ public sealed class BinarySerializerAcceptanceTest
public void Setup()
{
var assemblyName = new AssemblyName("SharpRemote.GeneratedCode.Serializer");
- _assembly = AssemblyBuilder.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.RunAndSave);
+ _assembly = AssemblyBuilder.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run);
string moduleName = assemblyName.Name + ".dll";
_module = _assembly.DefineDynamicModule(moduleName);
}
@@ -31,20 +31,6 @@ protected override ISerializer2 Create()
return new BinarySerializer2(_module);
}
- protected override void Save()
- {
- var fname = "SharpRemote.GeneratedCode.Serializer.dll";
- try
- {
- _assembly.Save(fname);
- TestContext.Out.WriteLine("Assembly written to: {0}", Path.Combine(Directory.GetCurrentDirectory(), fname));
- }
- catch (Exception e)
- {
- TestContext.Out.WriteLine("Couldn't write assembly: {0}", e);
- }
- }
-
public static IEnumerable SupportedVersions => new[]
{
ProtocolVersion.None,
diff --git a/SharpRemote.Test/CodeGeneration/Serialization/FrameworkTest.cs b/SharpRemote.Test/CodeGeneration/Serialization/FrameworkTest.cs
index 59590e7..d72dc77 100644
--- a/SharpRemote.Test/CodeGeneration/Serialization/FrameworkTest.cs
+++ b/SharpRemote.Test/CodeGeneration/Serialization/FrameworkTest.cs
@@ -14,8 +14,10 @@ public partial class SerializationTest
[Test]
public void TestAppDomainManagerInitializationOptions()
{
+#if !NET6_0
_serializer.ShouldRoundtrip(AppDomainManagerInitializationOptions.None);
_serializer.ShouldRoundtrip(AppDomainManagerInitializationOptions.RegisterWithHost);
+#endif
}
[Test]
@@ -96,8 +98,10 @@ public void TestConsoleSpecialKey()
[Test]
public void TestContextForm()
{
+#if !NET6_0
_serializer.ShouldRoundtrip(ActivationContext.ContextForm.Loose);
_serializer.ShouldRoundtrip(ActivationContext.ContextForm.StoreBounded);
+#endif
}
[Test]
diff --git a/SharpRemote.Test/CodeGeneration/Serialization/Json/JsonSerializerAcceptanceTest.cs b/SharpRemote.Test/CodeGeneration/Serialization/Json/JsonSerializerAcceptanceTest.cs
deleted file mode 100644
index 60054f6..0000000
--- a/SharpRemote.Test/CodeGeneration/Serialization/Json/JsonSerializerAcceptanceTest.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System.IO;
-using NUnit.Framework;
-
-namespace SharpRemote.Test.CodeGeneration.Serialization.Json
-{
- [TestFixture]
- public sealed class JsonSerializerAcceptanceTest
- : AbstractSerializerAcceptanceTest
- {
- protected override ISerializer2 Create()
- {
- return new JsonSerializer();
- }
-
- protected override string Format(MemoryStream stream)
- {
- throw new System.NotImplementedException();
- }
- }
-}
\ No newline at end of file
diff --git a/SharpRemote.Test/CodeGeneration/Serialization/SerializationTest.cs b/SharpRemote.Test/CodeGeneration/Serialization/SerializationTest.cs
index 4eb5a16..185662b 100644
--- a/SharpRemote.Test/CodeGeneration/Serialization/SerializationTest.cs
+++ b/SharpRemote.Test/CodeGeneration/Serialization/SerializationTest.cs
@@ -24,18 +24,12 @@ public sealed partial class SerializationTest
public void TestFixtureSetUp()
{
var assemblyName = new AssemblyName("SharpRemote.GeneratedCode.Serializer");
- _assembly = AssemblyBuilder.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.RunAndSave);
+ _assembly = AssemblyBuilder.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run);
_moduleName = assemblyName.Name + ".dll";
ModuleBuilder module = _assembly.DefineDynamicModule(_moduleName);
_serializer = new BinarySerializer(module);
}
-
- [OneTimeTearDown]
- public void TestFixtureTearDown()
- {
- _assembly.Save(_moduleName);
- }
-
+
public static IEnumerable LevelValues => new[]
{
Level.Error, Level.Alert, Level.All, Level.Critical, Level.Debug,
@@ -441,13 +435,13 @@ public void TestClassWithDeserializationCallback()
var actualValue = _serializer.Roundtrip(value);
const string reason = "because those two callbacks should've been invoked in that order";
- value.Callbacks.Should().Equal(new object[]
+ value.Callbacks.Should().Equal(new []
{
"BeforeSerialization",
"AfterSerialization"
}, reason);
- actualValue.Callbacks.Should().Equal(new object[]
+ actualValue.Callbacks.Should().Equal(new []
{
"BeforeDeserialization",
"AfterDeserialization"
diff --git a/SharpRemote.Test/CodeGeneration/Serialization/SerializerExtensions.cs b/SharpRemote.Test/CodeGeneration/Serialization/SerializerExtensions.cs
index 328cbb2..f13f982 100644
--- a/SharpRemote.Test/CodeGeneration/Serialization/SerializerExtensions.cs
+++ b/SharpRemote.Test/CodeGeneration/Serialization/SerializerExtensions.cs
@@ -24,7 +24,7 @@ public static T ShouldRoundtripEnumeration(this ISerializer serializer, T val
var reader = new BinaryReader(stream, Encoding.UTF8);
var actualValue = (T) serializer.ReadObject(reader, null);
- actualValue.Should().Equal(value, "because serialization should preserve the order of elements in the enumeration");
+ actualValue.Should().BeEquivalentTo(value, "because serialization should preserve the order of elements in the enumeration");
if (value != null)
{
actualValue.Should().NotBeSameAs(value, "because serialization should've created a deep copy");
diff --git a/SharpRemote.Test/CodeGeneration/Serialization/Xml/XmlSerializerAcceptanceTest.cs b/SharpRemote.Test/CodeGeneration/Serialization/Xml/XmlSerializerAcceptanceTest.cs
index 758d95d..a222758 100644
--- a/SharpRemote.Test/CodeGeneration/Serialization/Xml/XmlSerializerAcceptanceTest.cs
+++ b/SharpRemote.Test/CodeGeneration/Serialization/Xml/XmlSerializerAcceptanceTest.cs
@@ -1,5 +1,4 @@
-using System;
-using System.IO;
+using System.IO;
using System.Reflection;
using System.Reflection.Emit;
using System.Text;
@@ -18,7 +17,7 @@ public sealed class XmlSerializerAcceptanceTest
public void Setup()
{
var assemblyName = new AssemblyName("SharpRemote.GeneratedCode.Serializer");
- _assembly = AssemblyBuilder.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.RunAndSave);
+ _assembly = AssemblyBuilder.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run);
string moduleName = assemblyName.Name + ".dll";
_module = _assembly.DefineDynamicModule(moduleName);
}
@@ -28,20 +27,6 @@ protected override ISerializer2 Create()
return new XmlSerializer(_module);
}
- protected override void Save()
- {
- //var fname = "SharpRemote.GeneratedCode.Serializer.dll";
- //try
- //{
- // _assembly.Save(fname);
- // TestContext.Out.WriteLine("Assembly written to: {0}", Path.Combine(Directory.GetCurrentDirectory(), fname));
- //}
- //catch (Exception e)
- //{
- // TestContext.Out.WriteLine("Couldn't write assembly: {0}", e);
- //}
- }
-
protected override string Format(MemoryStream stream)
{
using (var reader = new StreamReader(stream, Encoding.Default, detectEncodingFromByteOrderMarks: true,
diff --git a/SharpRemote.Test/Exceptions/AuthenticationExceptionTest.cs b/SharpRemote.Test/Exceptions/AuthenticationExceptionTest.cs
index ad8f7bd..a896ce6 100644
--- a/SharpRemote.Test/Exceptions/AuthenticationExceptionTest.cs
+++ b/SharpRemote.Test/Exceptions/AuthenticationExceptionTest.cs
@@ -29,7 +29,11 @@ public void TestRoundtrip()
var actualException = exception.Roundtrip();
actualException.Message.Should().Be(message);
actualException.InnerException.Should().BeOfType();
+#if NET6_0
+ actualException.InnerException.Message.Should().Be("Somebody screwed up (Parameter 'foobar')");
+#else
actualException.InnerException.Message.Should().Be("Somebody screwed up\r\nParameter name: foobar");
+#endif
}
}
}
\ No newline at end of file
diff --git a/SharpRemote.Test/Exceptions/AuthenticationRequiredExceptionTest.cs b/SharpRemote.Test/Exceptions/AuthenticationRequiredExceptionTest.cs
index fd10b7e..d05bbbc 100644
--- a/SharpRemote.Test/Exceptions/AuthenticationRequiredExceptionTest.cs
+++ b/SharpRemote.Test/Exceptions/AuthenticationRequiredExceptionTest.cs
@@ -29,7 +29,11 @@ public void TestRoundtrip()
var actualException = exception.Roundtrip();
actualException.Message.Should().Be(message);
actualException.InnerException.Should().BeOfType();
+#if NET6_0
+ actualException.InnerException.Message.Should().Be("Somebody screwed up (Parameter 'foobar')");
+#else
actualException.InnerException.Message.Should().Be("Somebody screwed up\r\nParameter name: foobar");
+#endif
}
}
}
\ No newline at end of file
diff --git a/SharpRemote.Test/Exceptions/ConnectionLostExceptionTest.cs b/SharpRemote.Test/Exceptions/ConnectionLostExceptionTest.cs
index f96488f..ecbe207 100644
--- a/SharpRemote.Test/Exceptions/ConnectionLostExceptionTest.cs
+++ b/SharpRemote.Test/Exceptions/ConnectionLostExceptionTest.cs
@@ -1,5 +1,4 @@
-using System.Net;
-using FluentAssertions;
+using FluentAssertions;
using NUnit.Framework;
using SharpRemote.Test.Extensions;
@@ -15,8 +14,6 @@ public void TestConstruction1()
var exception = new ConnectionLostException();
exception.Message.Should().Be("The connection to the remote endpoint has been lost");
exception.EndPointName.Should().BeNull("because none has been specified in the ctor");
- exception.LocalEndPoint.Should().BeNull("because none has been specified in the ctor");
- exception.RemoteEndPoint.Should().BeNull("because none has been specified in the ctor");
exception.InnerException.Should().BeNull("because none has been specified in the ctor");
}
@@ -26,8 +23,6 @@ public void TestConstruction2()
var exception = new ConnectionLostException("My fancy endpoint");
exception.Message.Should().Be("The connection to the remote endpoint has been lost");
exception.EndPointName.Should().Be("My fancy endpoint");
- exception.LocalEndPoint.Should().BeNull("because none has been specified in the ctor");
- exception.RemoteEndPoint.Should().BeNull("because none has been specified in the ctor");
exception.InnerException.Should().BeNull("because none has been specified in the ctor");
}
@@ -39,8 +34,6 @@ public void TestRoundtrip1()
var actualException = exception.Roundtrip();
actualException.Message.Should().Be("The connection to the remote endpoint has been lost");
actualException.EndPointName.Should().BeNull();
- actualException.LocalEndPoint.Should().BeNull();
- actualException.RemoteEndPoint.Should().BeNull();
}
[Test]
@@ -51,22 +44,6 @@ public void TestRoundtrip2()
var actualException = exception.Roundtrip();
actualException.Message.Should().Be("The connection to the remote endpoint has been lost");
actualException.EndPointName.Should().Be("My fancy endpoint");
- actualException.LocalEndPoint.Should().BeNull();
- actualException.RemoteEndPoint.Should().BeNull();
- }
-
- [Test]
- [SetCulture("en-US")]
- public void TestRoundtrip3()
- {
- var exception = new ConnectionLostException("My fancy endpoint",
- new IPEndPoint(IPAddress.Parse("8.8.8.8"), 21),
- new IPEndPoint(IPAddress.Parse("2.81.90.1"), 23));
- var actualException = exception.Roundtrip();
- actualException.Message.Should().Be("The connection to the remote endpoint has been lost");
- actualException.EndPointName.Should().Be("My fancy endpoint");
- actualException.LocalEndPoint.Should().Be(new IPEndPoint(IPAddress.Parse("8.8.8.8"), 21));
- actualException.RemoteEndPoint.Should().Be(new IPEndPoint(IPAddress.Parse("2.81.90.1"), 23));
}
}
-}
+}
\ No newline at end of file
diff --git a/SharpRemote.Test/Exceptions/RemoteEndpointAlreadyConnectedExceptionTest.cs b/SharpRemote.Test/Exceptions/RemoteEndpointAlreadyConnectedExceptionTest.cs
index 5a7e98d..079478a 100644
--- a/SharpRemote.Test/Exceptions/RemoteEndpointAlreadyConnectedExceptionTest.cs
+++ b/SharpRemote.Test/Exceptions/RemoteEndpointAlreadyConnectedExceptionTest.cs
@@ -15,9 +15,9 @@ public void TestConstruction()
{
var endPoint = new IPEndPoint(IPAddress.Parse("192.21.32.42"), 54321);
var innerException = new ArgumentException("dawdwdw");
- var exception = new RemoteEndpointAlreadyConnectedException("foobar", endPoint, innerException);
+ var exception = new RemoteEndpointAlreadyConnectedException("foobar", endPoint.ToString(), innerException);
exception.Message.Should().Be("foobar");
- exception.BlockingEndPoint.Should().BeSameAs(endPoint);
+ exception.BlockingEndPointName.Should().Be(endPoint.ToString());
exception.InnerException.Should().BeSameAs(innerException);
}
@@ -27,10 +27,10 @@ public void TestSerializationRoundtrip()
var endPoint = new IPEndPoint(IPAddress.Parse("192.21.32.42"), 54321);
var innerException = new ArgumentException("dawdwdw");
var message = "Some error message";
- var exception = new RemoteEndpointAlreadyConnectedException(message, endPoint, innerException);
+ var exception = new RemoteEndpointAlreadyConnectedException(message, endPoint.ToString(), innerException);
var actualException = exception.Roundtrip();
actualException.Message.Should().Be(message);
- actualException.BlockingEndPoint.Should().Be(endPoint);
+ actualException.BlockingEndPointName.Should().Be(endPoint.ToString());
actualException.InnerException.Should().BeOfType();
actualException.InnerException.Message.Should().Be("dawdwdw");
}
diff --git a/SharpRemote.Test/Exceptions/SerializationExceptionTest.cs b/SharpRemote.Test/Exceptions/SerializationExceptionTest.cs
index b0085b5..d5ba432 100644
--- a/SharpRemote.Test/Exceptions/SerializationExceptionTest.cs
+++ b/SharpRemote.Test/Exceptions/SerializationExceptionTest.cs
@@ -29,7 +29,11 @@ public void TestRoundtrip()
var actualException = exception.Roundtrip();
actualException.Message.Should().Be(message);
actualException.InnerException.Should().BeOfType();
+#if NET6_0
+ actualException.InnerException.Message.Should().Be("Somebody screwed up (Parameter 'foobar')");
+#else
actualException.InnerException.Message.Should().Be("Somebody screwed up\r\nParameter name: foobar");
+#endif
}
}
}
diff --git a/SharpRemote.Test/Exceptions/SharpRemoteExceptionTest.cs b/SharpRemote.Test/Exceptions/SharpRemoteExceptionTest.cs
index bf9d05c..efcee42 100644
--- a/SharpRemote.Test/Exceptions/SharpRemoteExceptionTest.cs
+++ b/SharpRemote.Test/Exceptions/SharpRemoteExceptionTest.cs
@@ -29,7 +29,11 @@ public void TestRoundtrip()
var actualException = exception.Roundtrip();
actualException.Message.Should().Be(message);
actualException.InnerException.Should().BeOfType();
+#if NET6_0
+ actualException.InnerException.Message.Should().Be("Somebody screwed up (Parameter 'foobar')");
+#else
actualException.InnerException.Message.Should().Be("Somebody screwed up\r\nParameter name: foobar");
+#endif
}
}
}
\ No newline at end of file
diff --git a/SharpRemote.Test/Exceptions/TypeMismatchExceptionTest.cs b/SharpRemote.Test/Exceptions/TypeMismatchExceptionTest.cs
index 70bbce3..5957408 100644
--- a/SharpRemote.Test/Exceptions/TypeMismatchExceptionTest.cs
+++ b/SharpRemote.Test/Exceptions/TypeMismatchExceptionTest.cs
@@ -29,7 +29,11 @@ public void TestRoundtrip()
var actualException = exception.Roundtrip();
actualException.Message.Should().Be(message);
actualException.InnerException.Should().BeOfType();
+#if NET6_0
+ actualException.InnerException.Message.Should().Be("Somebody screwed up (Parameter 'foobar')");
+#else
actualException.InnerException.Message.Should().Be("Somebody screwed up\r\nParameter name: foobar");
+#endif
}
}
}
diff --git a/SharpRemote.Test/Remoting/AbstractAcceptanceTest.cs b/SharpRemote.Test/Remoting/AbstractAcceptanceTest.cs
index 66bf235..90e66e1 100644
--- a/SharpRemote.Test/Remoting/AbstractAcceptanceTest.cs
+++ b/SharpRemote.Test/Remoting/AbstractAcceptanceTest.cs
@@ -562,7 +562,7 @@ public void TestRaiseEvent2()
const int value = 42;
new Action(() => subject.Raise(x => x.Foobar += null, value))
.Should().Throw()
- .WithMessage("Specified argument was out of the range of valid values.\r\nParameter name: value");
+ .WithMessage("Specified argument was out of the range of valid values*Parameter*value*");
actualValue1.Should().Be(value);
actualValue2.Should().NotHaveValue();
@@ -618,7 +618,7 @@ public void TestRaiseEventThrowException1()
const int value = 42;
new Action(() => subject.Raise(x => x.Foobar += null, value))
.Should().Throw()
- .WithMessage("Specified argument was out of the range of valid values.\r\nParameter name: value");
+ .WithMessage("Specified argument was out of the range of valid values*Parameter*value*");
// This line exists to FORCE the GC to NOT collect the subject, which
// in turn would unregister the servant from the server, thus making the test
@@ -932,7 +932,7 @@ public void TestEventActionStringArray()
subject.Raise(x => x.Do += null, new object[] {new[]{"COM11", "COM13"}});
- values.Should().Equal(new object[]
+ values.Should().Equal(new []
{
"COM11",
"COM13"
@@ -954,7 +954,7 @@ public void TestVoidMethodStringArray()
var proxy = _client.CreateProxy(servantId);
proxy.Do(new[]{"COM11", "COM13"});
- values.Should().Equal(new object[]
+ values.Should().Equal(new []
{
"COM11",
"COM13"
diff --git a/SharpRemote.Test/Remoting/AbstractConnectTest.cs b/SharpRemote.Test/Remoting/AbstractConnectTest.cs
index 6b02218..3b85f43 100644
--- a/SharpRemote.Test/Remoting/AbstractConnectTest.cs
+++ b/SharpRemote.Test/Remoting/AbstractConnectTest.cs
@@ -83,7 +83,7 @@ public void TestConnect5()
{
new Action(() => Connect(rep, (EndPoint)null, TimeSpan.FromSeconds(1)))
.Should().Throw()
- .WithMessage("Value cannot be null.\r\nParameter name: endpoint");
+ .WithMessage("Value cannot be null*Parameter*endpoint*");
}
}
@@ -96,7 +96,7 @@ public void TestConnect6()
new Action(
() => Connect(rep, EndPoint2, TimeSpan.FromSeconds(0)))
.Should().Throw()
- .WithMessage("Specified argument was out of the range of valid values.\r\nParameter name: timeout");
+ .WithMessage("Specified argument was out of the range of valid values*Parameter*timeout*");
}
}
@@ -109,7 +109,7 @@ public void TestConnect7()
new Action(
() => Connect(rep, EndPoint2, TimeSpan.FromSeconds(-1)))
.Should().Throw()
- .WithMessage("Specified argument was out of the range of valid values.\r\nParameter name: timeout");
+ .WithMessage("Specified argument was out of the range of valid values*Parameter*timeout*");
}
}
diff --git a/SharpRemote.Test/Remoting/AbstractTryConnectTest.cs b/SharpRemote.Test/Remoting/AbstractTryConnectTest.cs
index 4de3d5b..181e9ff 100644
--- a/SharpRemote.Test/Remoting/AbstractTryConnectTest.cs
+++ b/SharpRemote.Test/Remoting/AbstractTryConnectTest.cs
@@ -165,7 +165,7 @@ public void TestTryConnect5()
{
new Action(() => TryConnect(rep, (EndPoint)null, TimeSpan.FromSeconds(1)))
.Should().Throw()
- .WithMessage("Value cannot be null.\r\nParameter name: endpoint");
+ .WithMessage("Value cannot be null*Parameter*endpoint*");
}
}
diff --git a/SharpRemote.Test/Remoting/ExceptionTest.cs b/SharpRemote.Test/Remoting/ExceptionTest.cs
index ca4758f..5c4e37f 100644
--- a/SharpRemote.Test/Remoting/ExceptionTest.cs
+++ b/SharpRemote.Test/Remoting/ExceptionTest.cs
@@ -38,12 +38,17 @@ public void TestPreserveRemoteStacktrace()
}
catch (Exception e)
{
+#if NET6_0
+ var property = e.GetType().GetProperty("SerializationStackTraceString", BindingFlags.NonPublic | BindingFlags.Instance);
+#else
var property = e.GetType().GetProperty("RemoteStackTrace", BindingFlags.NonPublic | BindingFlags.Instance);
+#endif
var remoteStackTrace = (string)property.GetValue(e);
remoteStackTrace.Should().NotBeEmpty("because the remote stacktrace of the exception should've been preserved");
var stacktrace = e.StackTrace;
- stacktrace.Should().Contain(remoteStackTrace, "because the remote stacktrace should be part of the actual stacktrace to allow for easier debugging of distributed applications (I want to know where it crashed on the server)");
+ stacktrace.Should().Contain(remoteStackTrace,
+ "because the remote stacktrace should be part of the actual stacktrace to allow for easier debugging of distributed applications (I want to know where it crashed on the server)");
}
}
}
diff --git a/SharpRemote.Test/Remoting/Sockets/TryConnectTest.cs b/SharpRemote.Test/Remoting/Sockets/TryConnectTest.cs
index cad4635..65db7f7 100644
--- a/SharpRemote.Test/Remoting/Sockets/TryConnectTest.cs
+++ b/SharpRemote.Test/Remoting/Sockets/TryConnectTest.cs
@@ -135,7 +135,7 @@ public void TestTryConnect6()
new Action(
() => TryConnect(rep, new IPEndPoint(IPAddress.Loopback, port: 12345), TimeSpan.FromSeconds(value: 0)))
.Should().Throw()
- .WithMessage("Specified argument was out of the range of valid values.\r\nParameter name: timeout");
+ .WithMessage("Specified argument was out of the range of valid values*Parameter*timeout*");
}
}
@@ -148,7 +148,7 @@ public void TestTryConnect7()
new Action(
() => TryConnect(rep, new IPEndPoint(IPAddress.Loopback, port: 12345), TimeSpan.FromSeconds(value: -1)))
.Should().Throw()
- .WithMessage("Specified argument was out of the range of valid values.\r\nParameter name: timeout");
+ .WithMessage("Specified argument was out of the range of valid values*Parameter*timeout*");
}
}
}
diff --git a/SharpRemote.Test/SharpRemote.Test.csproj b/SharpRemote.Test/SharpRemote.Test.csproj
index 3f09765..5b745c6 100644
--- a/SharpRemote.Test/SharpRemote.Test.csproj
+++ b/SharpRemote.Test/SharpRemote.Test.csproj
@@ -1,396 +1,24 @@
-
-
-
-
-
- Debug
- AnyCPU
- {377C04C5-EE8C-4159-BDDC-37F1A8372705}
- Library
- Properties
- SharpRemote.Test
- SharpRemote.Test
- v4.5
- 512
-
-
-
-
-
- true
- full
- false
- ..\bin\win\
- DEBUG;TRACE
- prompt
- 4
- true
- true
-
-
- pdbonly
- true
- ..\bin\win\
- TRACE
- prompt
- 4
- true
- true
-
-
-
- ..\packages\Castle.Core.4.4.0\lib\net45\Castle.Core.dll
-
-
- ..\packages\FluentAssertions.5.10.3\lib\net45\FluentAssertions.dll
-
-
- ..\packages\FluentAssertions.Extensions.1.0.18\lib\net45\FluentAssertions.Extensions.dll
-
-
- ..\packages\log4net.2.0.12\lib\net45\log4net.dll
-
-
- ..\packages\Moq.4.16.1\lib\net45\Moq.dll
-
-
- ..\packages\NUnit.3.13.2\lib\net45\nunit.framework.dll
-
-
-
-
-
-
- ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll
-
-
-
- ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll
-
-
- ..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Designer
-
-
-
-
- {21218e92-3815-4e5e-9761-c3fb0709f532}
- SharpRemote.Host
-
-
- {A358345A-44E1-4767-A20C-A97DE4BAF52C}
- SharpRemote.WebApi
-
-
- {1B908B3A-2F3B-47B8-B69F-3827B8829586}
- SharpRemote
-
-
-
-
-
+
- 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}.
+ net48;net6.0
+ ..\bin
+ false
+ true
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SharpRemote.Test/TypeModel/TypeModelTest.cs b/SharpRemote.Test/TypeModel/TypeModelTest.cs
index a1a206a..086a027 100644
--- a/SharpRemote.Test/TypeModel/TypeModelTest.cs
+++ b/SharpRemote.Test/TypeModel/TypeModelTest.cs
@@ -201,7 +201,7 @@ public void TestAddObject()
description.AssemblyQualifiedName.Should().Be(typeof(object).AssemblyQualifiedName);
model.Types.Should().HaveCount(1);
- model.Types.Should().Equal(new[] {description});
+ model.Types.Should().BeEquivalentTo(new[] {description});
}
[Test]
@@ -515,12 +515,12 @@ public void TestFieldStruct()
field3.FieldType.IsBuiltIn.Should().BeTrue();
((FieldDescription)field3).FieldTypeId.Should().Be(model.GetId());
- model.Types.Should().Contain(new object[]
+ model.Types.Should().Contain(new[]
{
- type, //< FieldStruct
- field1.FieldType, //< double
- field2.FieldType, //< int
- field3.FieldType //< string
+ (TypeDescription)type, //< FieldStruct
+ (TypeDescription)field1.FieldType, //< double
+ (TypeDescription)field2.FieldType, //< int
+ (TypeDescription)field3.FieldType //< string
});
}
diff --git a/SharpRemote.Test/WeakKeyDictionaryTest.cs b/SharpRemote.Test/WeakKeyDictionaryTest.cs
index 0ee721e..5c51f23 100644
--- a/SharpRemote.Test/WeakKeyDictionaryTest.cs
+++ b/SharpRemote.Test/WeakKeyDictionaryTest.cs
@@ -282,7 +282,7 @@ public void TestAdd9()
var dictionary = new WeakKeyDictionary