Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tmds.DBus.Protocol: drop dependency on System.Security.Principal.Windows. #186

Merged
merged 1 commit into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Tmds.DBus.Protocol/DBusEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ public static string? UserId
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
#if NET6_0_OR_GREATER
return System.Security.Principal.WindowsIdentity.GetCurrent().User?.Value;
#else
throw new NotSupportedException("Cannot determine Windows UserId. You must manually assign it.");
#endif
}
else
{
Expand Down
5 changes: 3 additions & 2 deletions src/Tmds.DBus.Protocol/Tmds.DBus.Protocol.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0</TargetFrameworks>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>10</LangVersion>
Expand All @@ -24,8 +24,9 @@

<ItemGroup>
<PackageReference Include="Nerdbank.Streams" Version="2.9.112" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard'">
<PackageReference Include="System.Threading.Channels" Version="7.0.0" />
<PackageReference Include="System.Security.Principal.Windows" Version="5.0.0" />
</ItemGroup>

</Project>