Skip to content

Commit 380fd65

Browse files
committed
- SetApartmentState
Removed `SetApartmentState` for .net core.
1 parent cb8d525 commit 380fd65

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

Shuttle.Core.Threading/ProcessorThread.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using System.Threading;
23
using Shuttle.Core.Configuration;
34
using Shuttle.Core.Logging;
@@ -36,7 +37,19 @@ public void Start()
3637

3738
_thread = new Thread(Work) {Name = _name};
3839

39-
_thread.SetApartmentState(ApartmentState.MTA);
40+
try
41+
{
42+
_thread.SetApartmentState(ApartmentState.MTA);
43+
}
44+
catch (Exception ex)
45+
{
46+
#if !NETCOREAPP2_0
47+
_log.Warning(ex.Message);
48+
#else
49+
_log.Information(ex.Message);
50+
#endif
51+
}
52+
4053
_thread.IsBackground = true;
4154
_thread.Priority = ThreadPriority.Normal;
4255

Shuttle.Core.Threading/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
[assembly: AssemblyTitle(".NET Standard 2.0")]
3030
#endif
3131

32-
[assembly: AssemblyVersion("10.0.0.0")]
32+
[assembly: AssemblyVersion("10.0.1.0")]
3333
[assembly: AssemblyCopyright("Copyright © Eben Roux 2018")]
3434
[assembly: AssemblyProduct("Shuttle.Core.Threading")]
3535
[assembly: AssemblyCompany("Shuttle")]
3636
[assembly: AssemblyConfiguration("Release")]
37-
[assembly: AssemblyInformationalVersion("10.0.0")]
37+
[assembly: AssemblyInformationalVersion("10.0.1")]
3838
[assembly: ComVisible(false)]

0 commit comments

Comments
 (0)