Skip to content

Commit

Permalink
Upgrade to .Net6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dichternebel committed Dec 10, 2022
1 parent 2dd38e3 commit 8c338c4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
12 changes: 9 additions & 3 deletions Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.IO;
using System.Text.Json;
using System.Threading;
Expand All @@ -13,11 +14,14 @@
using OBSWebsocketDotNet.Communication;
using Serilog;
using Serilog.Sinks.SystemConsole.Themes;
using static Dec.DiscordIPC.Entities.Sticker;

namespace VoiceChannelGrabber
{
class Program
{
private static string baseDir { get; set; }

private static string clientID { get; set; }

private static string clientSecret { get; set; }
Expand All @@ -40,10 +44,12 @@ class Program

static int Main()
{
baseDir = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);

// Initialize serilog logger
Log.Logger = new LoggerConfiguration()
.WriteTo.Console(Serilog.Events.LogEventLevel.Debug, theme: AnsiConsoleTheme.Literate)
.WriteTo.File(Path.Combine(Directory.GetCurrentDirectory(), "logs", $"log-.txt"), Serilog.Events.LogEventLevel.Information, rollingInterval: RollingInterval.Day)
.WriteTo.File(Path.Combine(baseDir, "logs", $"log-.txt"), Serilog.Events.LogEventLevel.Information, rollingInterval: RollingInterval.Day)
.MinimumLevel.Information()
.Enrich.FromLogContext()
.CreateLogger();
Expand All @@ -67,8 +73,8 @@ static int Main()

static async Task MainAsync()
{
var configFile = Path.Combine(System.AppContext.BaseDirectory, "config.json");
tokenJsonFile = Path.Combine(System.AppContext.BaseDirectory, "token.json");
var configFile = Path.Combine(baseDir, "config.json");
tokenJsonFile = Path.Combine(baseDir, "token.json");

if (File.Exists(configFile))
{
Expand Down
10 changes: 5 additions & 5 deletions Properties/PublishProfiles/FolderProfile.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net5.0\publish\</PublishDir>
<PublishDir>bin\Release\net6.0\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
<PublishReadyToRun>True</PublishReadyToRun>
<PublishTrimmed>False</PublishTrimmed>
<PublishSingleFile>true</PublishSingleFile>
<PublishReadyToRun>true</PublishReadyToRun>
<PublishTrimmed>true</PublishTrimmed>
</PropertyGroup>
</Project>

0 comments on commit 8c338c4

Please sign in to comment.