diff --git a/appveyor.yml b/appveyor.yml index 3939583..c504437 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,9 @@ version: 5.0.0.{build} -image: Visual Studio 2019 +image: Visual Studio 2022 configuration: Release platform: Any CPU +nuget: + disable_publish_on_pr: true build_script: - ps: msbuild /t:restore,pack /p:Configuration=Release /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg /p:ContinuousIntegrationBuild=true /p:EmbedUntrackedSources=true /p:PublishRepositoryUrl=true /verbosity:minimal test_script: diff --git a/src/NLog.MSMQ/NLog.MSMQ.csproj b/src/NLog.MSMQ/NLog.MSMQ.csproj index 31bcd87..cf9bdef 100644 --- a/src/NLog.MSMQ/NLog.MSMQ.csproj +++ b/src/NLog.MSMQ/NLog.MSMQ.csproj @@ -1,7 +1,7 @@  - net46;net45;net35 + net46;net45;net35;netstandard2.0 NLog 5.0.0 @@ -22,8 +22,8 @@ Copyright (c) 2004-$(CurrentYear) NLog Project - https://nlog-project.org/ - Docs: - https://github.com/NLog/NLog/wiki/MSMQ-target + Docs: + https://github.com/NLog/NLog/wiki/MSMQ-target NLog;MSMQ;logging;log N.png @@ -45,34 +45,33 @@ MSMQ target for NLog - .NET Framework 4.6 true Full - $(DefineConstants) MSMQ target for NLog - .NET Framework 4.5 true Full - $(DefineConstants) MSMQ target for NLog - .NET Framework 3.5 true Full - $(DefineConstants) - + - - - + + + + + $(Title) @@ -80,7 +79,7 @@ - + diff --git a/src/NLog.MSMQ/Properties/AssemblyInfo.cs b/src/NLog.MSMQ/Properties/AssemblyInfo.cs index 7e49b33..71b050c 100644 --- a/src/NLog.MSMQ/Properties/AssemblyInfo.cs +++ b/src/NLog.MSMQ/Properties/AssemblyInfo.cs @@ -38,7 +38,9 @@ using System.Security; [assembly: AssemblyCulture("")] +#if !NETSTANDARD [assembly: CLSCompliant(true)] +#endif [assembly: ComVisible(false)] [assembly: InternalsVisibleTo("NLog.MSMQ.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100ef8eab4fbdeb511eeb475e1659fe53f00ec1c1340700f1aa347bf3438455d71993b28b1efbed44c8d97a989e0cb6f01bcb5e78f0b055d311546f63de0a969e04cf04450f43834db9f909e566545a67e42822036860075a1576e90e1c43d43e023a24c22a427f85592ae56cac26f13b7ec2625cbc01f9490d60f16cfbb1bc34d9")] [assembly: AllowPartiallyTrustedCallers] diff --git a/src/NLog.MSMQ/Targets/MessageQueueTarget.cs b/src/NLog.MSMQ/Targets/MessageQueueTarget.cs index 3b5c220..222bc87 100644 --- a/src/NLog.MSMQ/Targets/MessageQueueTarget.cs +++ b/src/NLog.MSMQ/Targets/MessageQueueTarget.cs @@ -33,7 +33,11 @@ namespace NLog.Targets { +#if NETSTANDARD + using MSMQ.Messaging; +#else using System.Messaging; +#endif using System.Text; using NLog.Config; using NLog.Layouts; @@ -60,7 +64,7 @@ namespace NLog.Targets [Target("MSMQ")] public class MessageQueueTarget : TargetWithLayout { - private const MessagePriority MessagePriority = System.Messaging.MessagePriority.Normal; + private const MessagePriority DefaultMessagePriority = MessagePriority.Normal; /// /// Initializes a new instance of the class. @@ -187,7 +191,7 @@ protected virtual Message PrepareMessage(LogEventInfo logEvent) } msg.Recoverable = Recoverable; - msg.Priority = MessagePriority; + msg.Priority = DefaultMessagePriority; if (UseXmlEncoding) { diff --git a/tests/NLog.MSMQ.Tests/MessageQueueTargetTests.cs b/tests/NLog.MSMQ.Tests/MessageQueueTargetTests.cs index 8e2760f..fd574eb 100644 --- a/tests/NLog.MSMQ.Tests/MessageQueueTargetTests.cs +++ b/tests/NLog.MSMQ.Tests/MessageQueueTargetTests.cs @@ -31,10 +31,14 @@ // THE POSSIBILITY OF SUCH DAMAGE. // -namespace NLog.MSMQ.Tests +namespace NLog.MessageQueue.Tests { using System.Collections.Generic; +#if NETFRAMEWORK using System.Messaging; +#else + using MSMQ.Messaging; +#endif using NLog.Targets; using Xunit; diff --git a/tests/NLog.MSMQ.Tests/NLog.MSMQ.Tests.csproj b/tests/NLog.MSMQ.Tests/NLog.MSMQ.Tests.csproj index ff77969..ed62e95 100644 --- a/tests/NLog.MSMQ.Tests/NLog.MSMQ.Tests.csproj +++ b/tests/NLog.MSMQ.Tests/NLog.MSMQ.Tests.csproj @@ -1,7 +1,7 @@  - net452;net461 + net452;net461;net6.0 false ../NLogTests.snk @@ -10,11 +10,13 @@ true - + + - - + + +