Skip to content

Commit ec114ea

Browse files
committed
Visual Studio output fixed
Dependency Loader ignore resource assembly fixed
1 parent 61c2b14 commit ec114ea

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

Core.Common.Standard/KY.Core.Common.Standard.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<RootNamespace>KY.Core</RootNamespace>
66
<AssemblyName>KY.Core.Common</AssemblyName>
7-
<Version>4.6.1</Version>
7+
<Version>4.6.2</Version>
88
<Authors>KY-Programming</Authors>
99
<Company>KY-Programmingp</Company>
1010
<Product>KY.Core</Product>

Core.Common.Standard/Logger/ConsoleTarget.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,24 @@ public override void Write(LogEntry entry)
2323
}
2424
try
2525
{
26-
string formatedMessage;
26+
string formattedMessage;
2727
if (entry.Type == LogType.Error)
2828
{
29-
formatedMessage = string.Format(Resources.ConsoleErrorFormat, entry.Timestamp, entry.CustomType, entry.Message);
29+
formattedMessage = string.Format(Resources.ConsoleErrorFormat, entry.Timestamp, entry.CustomType, entry.Message);
3030
}
3131
else
3232
{
33-
formatedMessage = string.Format(Resources.ConsoleTraceFormat, entry.Timestamp, entry.Message);
33+
formattedMessage = string.Format(Resources.ConsoleTraceFormat, entry.Timestamp, entry.Message);
3434
}
3535

36-
if (entry.Shortable && formatedMessage.Length >= Console.WindowWidth)
36+
if (entry.Shortable && formattedMessage.Length >= Console.WindowWidth)
3737
{
38-
formatedMessage = formatedMessage.Substring(0, Console.WindowWidth - 4) + "...";
38+
formattedMessage = formattedMessage.Substring(0, Console.WindowWidth - 4) + "...";
3939
}
4040

41-
Console.WriteLine(formatedMessage.PadRight(Console.WindowWidth - 1));
41+
Console.WriteLine(formattedMessage.PadRight(Console.WindowWidth - 1));
4242
}
43-
catch (IOException)
43+
catch (IOException exception)
4444
{
4545
this.IsConsoleAvailable = false;
4646
Logger.Warning("Console output is not available");
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using KY.Core.Properties;
23

34
namespace KY.Core
@@ -6,16 +7,20 @@ public class VisualStudioOutputTarget : LogTarget
67
{
78
public override void Write(LogEntry entry)
89
{
9-
string formatedMessage;
10+
if (Logger.Console.IsConsoleAvailable)
11+
{
12+
return;
13+
}
14+
string formattedMessage;
1015
if (entry.Type == LogType.Error)
1116
{
12-
formatedMessage = string.Format(Resources.ConsoleErrorFormat, entry.Timestamp, entry.CustomType, entry.Message);
17+
formattedMessage = string.Format(Resources.ConsoleErrorFormat, entry.Timestamp, entry.CustomType, entry.Message);
1318
}
1419
else
1520
{
16-
formatedMessage = string.Format(Resources.ConsoleTraceFormat, entry.Timestamp, entry.Message);
21+
formattedMessage = string.Format(Resources.ConsoleTraceFormat, entry.Timestamp, entry.Message);
1722
}
18-
System.Diagnostics.Trace.WriteLine(formatedMessage);
23+
Console.WriteLine(formattedMessage);
1924
}
2025
}
2126
}

Core.Common.Standard/NugetPackageDependencyLoader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static void Deactivate()
2222

2323
private static Assembly Resolve(object sender, ResolveEventArgs args)
2424
{
25-
if (args.Name.EndsWith(".resources"))
25+
if (args.Name.Contains(".resources,"))
2626
{
2727
return null;
2828
}

0 commit comments

Comments
 (0)