Skip to content

Commit

Permalink
DEV-1 fix Исправил предупреждение совместимости OC
Browse files Browse the repository at this point in the history
  • Loading branch information
NotTastyCupcake committed Nov 11, 2023
1 parent f1dec40 commit 233aea1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Application/Application.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>ProgGym.PrinterMonitor.Application</RootNamespace>
Expand Down
5 changes: 2 additions & 3 deletions src/Application/Services/SearchDeviceService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ public SearchDeviceService(MonitorSettings monitorSettings)
public async Task <List<string>> GetPrinters()

Check warning on line 23 in src/Application/Services/SearchDeviceService.cs

View workflow job for this annotation

GitHub Actions / build

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 23 in src/Application/Services/SearchDeviceService.cs

View workflow job for this annotation

GitHub Actions / build

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
List<string> printers = new List<string>();
#pragma warning disable CA1416 // Проверка совместимости платформы
DirectoryEntry root = new DirectoryEntry(_monitorSettings.DomainPath,
DirectoryEntry root = new(_monitorSettings.DomainPath,
_monitorSettings.DomainUserName,
_monitorSettings.DomainPassword);
#pragma warning restore CA1416 // Проверка совместимости платформы

DirectorySearcher searcher = new DirectorySearcher(root);
searcher.Filter = "(objectClass=printQueue)";
searcher.PropertiesToLoad.Add("cn");
Expand Down

0 comments on commit 233aea1

Please sign in to comment.