Skip to content

Commit

Permalink
Update NuGet packages. Update APIs.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbound committed Feb 19, 2024
1 parent e3692c7 commit b7011de
Show file tree
Hide file tree
Showing 29 changed files with 84 additions and 87 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/Desktop.Linux/bin/Debug/.net7.0/Remotely_Desktop.dll",
"program": "${workspaceFolder}/Desktop.Linux/bin/Debug/.net8.0/Remotely_Desktop.dll",
"args": [],
"cwd": "${workspaceFolder}/Desktop.Linux",
"console": "internalConsole",
Expand Down
28 changes: 14 additions & 14 deletions Agent/Agent.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Copyright>Copyright © 2023 Immense Networks</Copyright>
Expand All @@ -24,19 +24,19 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Hosting.WindowsServices" Version="7.0.10" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="7.0.10" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="7.0.10" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.3.6" />
<PackageReference Include="Microsoft.WSMan.Management" Version="7.3.6" />
<PackageReference Include="Microsoft.WSMan.Runtime" Version="7.3.6" />
<PackageReference Include="System.Management.Automation" Version="7.3.6" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="7.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.WindowsServices" Version="8.0.2" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.2" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.4.1" />
<PackageReference Include="Microsoft.WSMan.Management" Version="7.4.1" />
<PackageReference Include="Microsoft.WSMan.Runtime" Version="7.4.1" />
<PackageReference Include="System.Management.Automation" Version="7.4.1" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Desktop.Core/Desktop.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>.net7.0</TargetFramework>
<TargetFramework>.net8.0</TargetFramework>
<RootNamespace>Remotely.Desktop.Core</RootNamespace>
<AssemblyName>Remotely_Desktop.Core</AssemblyName>
<Platforms>AnyCPU;x64;x86</Platforms>
Expand Down
2 changes: 1 addition & 1 deletion Desktop.Linux/Desktop.Linux.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ApplicationIcon>Assets\favicon.ico</ApplicationIcon>
<AssemblyName>Remotely_Desktop</AssemblyName>
<RootNamespace>Remotely.Desktop.XPlat</RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<Platform>x64</Platform>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<PublishDir>..\Server\wwwroot\Content\Linux-x64\</PublishDir>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<Platform>x64</Platform>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<PublishDir>..\Agent\bin\publish\linux-x64\Desktop</PublishDir>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
Expand Down
2 changes: 1 addition & 1 deletion Desktop.Shared/Desktop.Shared.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions Desktop.Win/Desktop.Win.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<AssemblyName>Remotely_Desktop</AssemblyName>
<RootNamespace>Remotely.Desktop.Win</RootNamespace>
<ApplicationIcon>Assets\favicon.ico</ApplicationIcon>
Expand Down Expand Up @@ -41,7 +41,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="NAudio" Version="2.1.0" />
<PackageReference Include="NAudio" Version="2.2.1" />
<PackageReference Include="SharpDX" Version="4.2.0" />
<PackageReference Include="SharpDX.Direct3D11" Version="4.2.0" />
<PackageReference Include="SharpDX.DXGI" Version="4.2.0" />
Expand All @@ -60,7 +60,7 @@
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="if $(SolutionDir) == *Undefined* (&#xD;&#xA; exit 0&#xD;&#xA;)&#xD;&#xA;if $(ConfigurationName) == Debug (&#xD;&#xA; if $(PlatformName) == AnyCPU (&#xD;&#xA; md &quot;$(SolutionDir)Agent\bin\Debug\net7.0\Desktop\&quot;&#xD;&#xA; xcopy &quot;$(TargetDir)*&quot; &quot;$(SolutionDir)Agent\bin\Debug\net7.0\Desktop\&quot; /y /e /i&#xD;&#xA; )&#xD;&#xA; if $(PlatformName) == x64 (&#xD;&#xA; md &quot;$(SolutionDir)Agent\bin\x64\Debug\net7.0\Desktop\&quot;&#xD;&#xA; xcopy &quot;$(TargetDir)*&quot; &quot;$(SolutionDir)Agent\bin\x64\Debug\net7.0\Desktop\&quot; /y /e /i&#xD;&#xA; )&#xD;&#xA; if $(PlatformName) == x86 (&#xD;&#xA; md &quot;$(SolutionDir)Agent\bin\x86\Debug\net7.0\Desktop\&quot;&#xD;&#xA; xcopy &quot;$(TargetDir)*&quot; &quot;$(SolutionDir)Agent\bin\x86\Debug\net7.0\Desktop\&quot; /y /e /i&#xD;&#xA; )&#xD;&#xA;)" />
<Exec Command="if $(SolutionDir) == *Undefined* (&#xD;&#xA; exit 0&#xD;&#xA;)&#xD;&#xA;if $(ConfigurationName) == Debug (&#xD;&#xA; if $(PlatformName) == AnyCPU (&#xD;&#xA; md &quot;$(SolutionDir)Agent\bin\Debug\net8.0\Desktop\&quot;&#xD;&#xA; xcopy &quot;$(TargetDir)*&quot; &quot;$(SolutionDir)Agent\bin\Debug\net8.0\Desktop\&quot; /y /e /i&#xD;&#xA; )&#xD;&#xA; if $(PlatformName) == x64 (&#xD;&#xA; md &quot;$(SolutionDir)Agent\bin\x64\Debug\net8.0\Desktop\&quot;&#xD;&#xA; xcopy &quot;$(TargetDir)*&quot; &quot;$(SolutionDir)Agent\bin\x64\Debug\net8.0\Desktop\&quot; /y /e /i&#xD;&#xA; )&#xD;&#xA; if $(PlatformName) == x86 (&#xD;&#xA; md &quot;$(SolutionDir)Agent\bin\x86\Debug\net8.0\Desktop\&quot;&#xD;&#xA; xcopy &quot;$(TargetDir)*&quot; &quot;$(SolutionDir)Agent\bin\x86\Debug\net8.0\Desktop\&quot; /y /e /i&#xD;&#xA; )&#xD;&#xA;)" />
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<Platform>x64</Platform>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<PublishDir>..\Server\wwwroot\Content\Win-x64\</PublishDir>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<Platform>x86</Platform>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<PublishDir>..\Server\wwwroot\Content\Win-x86\</PublishDir>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<SelfContained>true</SelfContained>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Platform>x64</Platform>
<PublishDir>C:\Program Files\Remotely\Desktop</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<PublishDir>..\Agent\bin\publish\win-x64\Desktop</PublishDir>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<Platform>x64</Platform>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<PublishDir>..\Agent\bin\publish\win-x64\Desktop</PublishDir>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<Platform>x86</Platform>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<PublishDir>..\Agent\bin\publish\win-x86\Desktop</PublishDir>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<SelfContained>true</SelfContained>
Expand Down
4 changes: 2 additions & 2 deletions Server/Components/Devices/ChatCard.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace Remotely.Server.Components.Devices;

public partial class ChatCard : AuthComponentBase, IAsyncDisposable
public partial class ChatCard : AuthComponentBase
{
private ElementReference _chatMessagesWindow;

Expand Down Expand Up @@ -44,7 +44,7 @@ await Register<ChatReceivedMessage, string>(
HandleChatMessageReceived);
}

private async Task HandleChatMessageReceived(ChatReceivedMessage message)
private async Task HandleChatMessageReceived(object subscriber, ChatReceivedMessage message)
{
if (message.DeviceId != Session.DeviceId)
{
Expand Down
6 changes: 3 additions & 3 deletions Server/Components/Devices/ChatFrame.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Remotely.Server.Components.Devices;

public partial class ChatFrame : AuthComponentBase, IAsyncDisposable
public partial class ChatFrame : AuthComponentBase
{
private ICollection<ChatSession> _chatSessions = Array.Empty<ChatSession>();

Expand All @@ -40,7 +40,7 @@ await Register<ChatReceivedMessage, string>(
await base.OnInitializedAsync();
}

private async Task HandleChatMessageReceived(ChatReceivedMessage message)
private async Task HandleChatMessageReceived(object subscriber, ChatReceivedMessage message)
{
if (message.DidDisconnect ||
ChatCache.ContainsKey(message.DeviceId))
Expand All @@ -66,7 +66,7 @@ private async Task HandleChatMessageReceived(ChatReceivedMessage message)
await Messenger.Send(new ChatSessionsChangedMessage(), CircuitConnection.ConnectionId);
}

private async Task HandleChatSessionsChanged(ChatSessionsChangedMessage message)
private async Task HandleChatSessionsChanged(object subscriber, ChatSessionsChangedMessage message)
{
_chatSessions = ChatCache.GetAllSessions();
await InvokeAsync(StateHasChanged);
Expand Down
4 changes: 2 additions & 2 deletions Server/Components/Devices/DeviceCard.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ await Register<DeviceStateChangedMessage, string>(
HandleDeviceStateChanged);
}

private async Task HandleDeviceCardStateChanged(DeviceCardStateChangedMessage message)
private async Task HandleDeviceCardStateChanged(object subscriber, DeviceCardStateChangedMessage message)
{
if (message.DeviceId == Device.ID)
{
Expand All @@ -113,7 +113,7 @@ private async Task HandleDeviceCardStateChanged(DeviceCardStateChangedMessage me
}
}

private async Task HandleDeviceStateChanged(DeviceStateChangedMessage message)
private async Task HandleDeviceStateChanged(object subscriber, DeviceStateChangedMessage message)
{
if (message.Device.ID != Device.ID)
{
Expand Down
6 changes: 3 additions & 3 deletions Server/Components/Devices/DevicesFrame.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ private string GetSortIcon()
return $"oi-sort-{_sortDirection.ToString().ToLower()}";
}

private async Task HandleDeviceStateChangedMessage(DeviceStateChangedMessage message)
private async Task HandleDeviceStateChangedMessage(object subscriber, DeviceStateChangedMessage message)
{
await _devicesLock.WaitAsync();

Expand Down Expand Up @@ -286,7 +286,7 @@ private async Task HandleDeviceStateChangedMessage(DeviceStateChangedMessage mes
}
}

private async Task HandleDisplayNotificationMessage(DisplayNotificationMessage message)
private async Task HandleDisplayNotificationMessage(object subscriber, DisplayNotificationMessage message)
{
TerminalStore.AddTerminalLine(message.ConsoleText);
ToastService.ShowToast(message.ToastText, classString: message.ClassName);
Expand All @@ -298,7 +298,7 @@ private async Task HandleRefreshClicked()
ToastService.ShowToast("Devices refreshed.");
}

private async Task HandleScriptResultMessage(ScriptResultMessage message)
private async Task HandleScriptResultMessage(object subscriber, ScriptResultMessage message)
{
await AddScriptResult(message.ScriptResult);
}
Expand Down
2 changes: 1 addition & 1 deletion Server/Components/Devices/Terminal.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ private async Task GetNextCompletion(bool forward)
await CircuitConnection.GetPowerShellCompletions(_lastCompletionInput, _lastCursorIndex, CompletionIntent.NextResult, forward);
}

private async Task HandlePowerShellCompletionsMessage(PowerShellCompletionsMessage message)
private async Task HandlePowerShellCompletionsMessage(object subscriber, PowerShellCompletionsMessage message)
{
var completion = message.Completion;
var intent = message.Intent;
Expand Down
2 changes: 1 addition & 1 deletion Server/Components/LoaderHarness.razor
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
await Register<ShowLoaderMessage>(HandleShowLoaderMessage);
}

private async Task HandleShowLoaderMessage(ShowLoaderMessage message)
private async Task HandleShowLoaderMessage(object subscriber, ShowLoaderMessage message)
{
_loaderShown = message.IsShown;
_statusMessage = message.StatusMessage;
Expand Down
18 changes: 10 additions & 8 deletions Server/Components/MessengerSubscriber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,40 @@

namespace Remotely.Server.Components;

public class MessengerSubscriber : ComponentBase, IAsyncDisposable
public class MessengerSubscriber : ComponentBase, IDisposable
{
protected readonly ConcurrentQueue<IAsyncDisposable> _registrations = new();
protected readonly ConcurrentQueue<IDisposable> _registrations = new();

[Inject]
protected IMessenger Messenger { get; init; } = null!;

public async ValueTask DisposeAsync()
public void Dispose()
{
while (_registrations.TryDequeue(out var registration))
{
try
{
await registration.DisposeAsync();
registration.Dispose();
}
catch { }
}
GC.SuppressFinalize(this);
}

protected async Task Register<TMessage, TChannel>(TChannel channel, Func<TMessage, Task> handler)
protected Task Register<TMessage, TChannel>(TChannel channel, RegistrationCallback<TMessage> handler)
where TMessage : class
where TChannel : IEquatable<TChannel>
{
var registration = await Messenger.Register(this, channel, handler);
var registration = Messenger.Register(this, channel, handler);
_registrations.Enqueue(registration);
return Task.CompletedTask;
}

protected async Task Register<TMessage>(Func<TMessage, Task> handler)
protected Task Register<TMessage>(RegistrationCallback<TMessage> handler)
where TMessage : class
{
var registration = await Messenger.Register(this, handler);
var registration = Messenger.Register(this, handler);
_registrations.Enqueue(registration);
return Task.CompletedTask;
}
}
2 changes: 1 addition & 1 deletion Server/Pages/DeviceDetails.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ await Register<ReceiveLogsMessage, string>(
_isLoading = false;
}

private async Task HandleReceiveLogsMessage(ReceiveLogsMessage message)
private async Task HandleReceiveLogsMessage(object subscriber, ReceiveLogsMessage message)
{
_logLines.Enqueue(message.LogChunk);
await InvokeAsync(StateHasChanged);
Expand Down
Loading

0 comments on commit b7011de

Please sign in to comment.