Skip to content

Commit 77c8341

Browse files
committed
.Net9 support and default implementation of FileVersionInfo.
1 parent 12cb763 commit 77c8341

File tree

9 files changed

+55
-29
lines changed

9 files changed

+55
-29
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project tries to adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.1.0] 2025-01-02
9+
10+
### Changed
11+
- .Net9 support and default implementation of FileVersionInfo.
12+
813
## [2.0.0] 2024-09-16
914

1015
### Changed

Directory.Build.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Company>Inktavo</Company>
77
<SignAssembly>True</SignAssembly>
88
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)StrongName.snk</AssemblyOriginatorKeyFile>
9-
<LangVersion>12</LangVersion>
9+
<LangVersion>13</LangVersion>
1010
<PackageTags>IFileSystem;SMB;UNC;System.IO.Abstractions;SMBLibrary;SMBAbstraction;Linux</PackageTags>
1111
<PackageProjectUrl>https://github.com/Printavo/SmbAbstraction</PackageProjectUrl>
1212
<RepositoryUrl>https://github.com/Printavo/SmbAbstraction</RepositoryUrl>
@@ -15,9 +15,9 @@
1515
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1616
<PackageReadmeFile>README.md</PackageReadmeFile>
1717
<DefineConstants Condition="'$(TargetFramework)' != 'net462'">$(DefineConstants);FEATURE_FILE_SYSTEM_ACL_EXTENSIONS</DefineConstants>
18-
<DefineConstants Condition="'$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net7.0' OR '$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'netstandard2.1'">$(DefineConstants);FEATURE_ASYNC_FILE;FEATURE_ENUMERATION_OPTIONS;FEATURE_ADVANCED_PATH_OPERATIONS;FEATURE_PATH_JOIN_WITH_SPAN;FEATURE_SPAN</DefineConstants>
19-
<DefineConstants Condition="'$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net7.0' OR '$(TargetFramework)' == 'net6.0'">$(DefineConstants);FEATURE_FILE_MOVE_WITH_OVERWRITE;FEATURE_SUPPORTED_OS_ATTRIBUTE;FEATURE_FILE_SYSTEM_WATCHER_FILTERS;FEATURE_ENDS_IN_DIRECTORY_SEPARATOR;FEATURE_PATH_JOIN_WITH_PARAMS;FEATURE_PATH_JOIN_WITH_FOUR_PATHS;FEATURE_FILE_SYSTEM_INFO_LINK_TARGET;FEATURE_CREATE_SYMBOLIC_LINK;FEATURE_FILESTREAM_OPTIONS</DefineConstants>
20-
<DefineConstants Condition="'$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net7.0'">$(DefineConstants);FEATURE_PATH_EXISTS;FEATURE_FILE_SYSTEM_WATCHER_WAIT_WITH_TIMESPAN;FEATURE_FILE_ATTRIBUTES_VIA_HANDLE;FEATURE_CREATE_TEMP_SUBDIRECTORY;FEATURE_READ_LINES_ASYNC;FEATURE_UNIX_FILE_MODE</DefineConstants>
18+
<DefineConstants Condition="'$(TargetFramework)' == 'net9.0' OR '$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net7.0' OR '$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'netstandard2.1'">$(DefineConstants);FEATURE_ASYNC_FILE;FEATURE_ENUMERATION_OPTIONS;FEATURE_ADVANCED_PATH_OPERATIONS;FEATURE_PATH_JOIN_WITH_SPAN;FEATURE_SPAN</DefineConstants>
19+
<DefineConstants Condition="'$(TargetFramework)' == 'net9.0' OR '$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net7.0' OR '$(TargetFramework)' == 'net6.0'">$(DefineConstants);FEATURE_FILE_MOVE_WITH_OVERWRITE;FEATURE_SUPPORTED_OS_ATTRIBUTE;FEATURE_FILE_SYSTEM_WATCHER_FILTERS;FEATURE_ENDS_IN_DIRECTORY_SEPARATOR;FEATURE_PATH_JOIN_WITH_PARAMS;FEATURE_PATH_JOIN_WITH_FOUR_PATHS;FEATURE_FILE_SYSTEM_INFO_LINK_TARGET;FEATURE_CREATE_SYMBOLIC_LINK;FEATURE_FILESTREAM_OPTIONS</DefineConstants>
20+
<DefineConstants Condition="'$(TargetFramework)' == 'net9.0' OR '$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net7.0'">$(DefineConstants);FEATURE_PATH_EXISTS;FEATURE_FILE_SYSTEM_WATCHER_WAIT_WITH_TIMESPAN;FEATURE_FILE_ATTRIBUTES_VIA_HANDLE;FEATURE_CREATE_TEMP_SUBDIRECTORY;FEATURE_READ_LINES_ASYNC;FEATURE_UNIX_FILE_MODE</DefineConstants>
2121
<DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants>
2222
<Nullable>annotations</Nullable>
2323
</PropertyGroup>

InkSoft.SmbAbstraction.Examples/SmbAbstraction.Examples.Console/InkSoft.SmbAbstraction.Examples.Console.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<Configurations>Debug</Configurations>
66
<IsPackable>false</IsPackable>
77
</PropertyGroup>

InkSoft.SmbAbstraction.Examples/SmbAbstraction.Examples.DependencyInjection/InkSoft.SmbAbstraction.Examples.DependencyInjection.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<Configurations>Debug</Configurations>
66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88
<ItemGroup>
9-
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
10-
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
11-
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
12-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
9+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0" />
10+
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.0" />
11+
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0" />
12+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
1313
<!--<PackageReference Include="InkSoft.SmbAbstraction" Version="*" />-->
1414
<ProjectReference Include="..\..\InkSoft.SmbAbstraction\InkSoft.SmbAbstraction.csproj" />
1515
</ItemGroup>

InkSoft.SmbAbstraction.IntegrationTests/InkSoft.SmbAbstraction.IntegrationTests.csproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="GenerateGitIgnore">
22
<PropertyGroup>
3-
<TargetFramework>net8.0</TargetFramework>
3+
<TargetFramework>net9.0</TargetFramework>
44
<IsPackable>false</IsPackable>
55
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
66
<IsTestProject>true</IsTestProject>
77
<Configurations>Debug</Configurations>
88
</PropertyGroup>
99
<ItemGroup>
10-
<PackageReference Include="MartinCostello.Logging.XUnit" Version="0.4.0" />
11-
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
12-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
13-
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
14-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
15-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
16-
<PackageReference Include="xunit" Version="2.9.0" />
17-
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
10+
<PackageReference Include="MartinCostello.Logging.XUnit" Version="0.5.1" />
11+
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.0" />
12+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0" />
13+
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.0" />
14+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
15+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
16+
<PackageReference Include="xunit" Version="2.9.2" />
17+
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
1818
<PrivateAssets>all</PrivateAssets>
1919
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2020
</PackageReference>
21-
<PackageReference Include="coverlet.collector" Version="6.0.2">
21+
<PackageReference Include="coverlet.collector" Version="6.0.3">
2222
<PrivateAssets>all</PrivateAssets>
2323
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2424
</PackageReference>

InkSoft.SmbAbstraction.Tests/InkSoft.SmbAbstraction.Tests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net8.0</TargetFramework>
3+
<TargetFramework>net9.0</TargetFramework>
44
<IsPackable>false</IsPackable>
55
<IsTestProject>true</IsTestProject>
66
<Configurations>Debug</Configurations>
77
</PropertyGroup>
88
<ItemGroup>
9-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
10-
<PackageReference Include="xunit" Version="2.9.0" />
11-
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
9+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
10+
<PackageReference Include="xunit" Version="2.9.2" />
11+
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
1212
<PrivateAssets>all</PrivateAssets>
1313
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1414
</PackageReference>
15-
<PackageReference Include="coverlet.collector" Version="6.0.2">
15+
<PackageReference Include="coverlet.collector" Version="6.0.3">
1616
<PrivateAssets>all</PrivateAssets>
1717
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1818
</PackageReference>

InkSoft.SmbAbstraction/InkSoft.SmbAbstraction.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<PackageId>InkSoft.SmbAbstraction</PackageId>
4-
<Version>2.0.0</Version>
5-
<TargetFrameworks>net8.0;netstandard2.0;netstandard2.1</TargetFrameworks>
4+
<Version>2.1.0</Version>
5+
<TargetFrameworks>net9.0;net8.0;netstandard2.0;netstandard2.1</TargetFrameworks>
66
<NeutralLanguage>en-US</NeutralLanguage>
77
<Description>This project is a fork of https://github.com/jordanlytle/SmbAbstraction with a few key differences: 1) It uses the original SMBLibrary as opposed to SMBLibraryLite, 2) It conforms to newer versions of https://github.com/TestableIO/System.IO.Abstractions interfaces, and 3) it also targets .Net Standard 2.0. This library implements the System.IO.Abstractions interfaces for interacting with the filesystem and adds support for interacting with UNC or SMB paths from non-Windows (and Windows) clients outside an Active Directory domain.</Description>
88
<EmbedUntrackedSources>true</EmbedUntrackedSources>
@@ -15,9 +15,9 @@
1515
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1616
</PropertyGroup>
1717
<ItemGroup>
18-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
18+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
1919
<PackageReference Include="SMBLibrary" Version="1.5.3.5" />
20-
<PackageReference Include="System.IO.Abstractions" Version="21.0.29" />
20+
<PackageReference Include="System.IO.Abstractions" Version="21.2.1" />
2121
<None Include="PackageIcon.png" Pack="true" PackagePath="" />
2222
</ItemGroup>
2323
</Project>

InkSoft.SmbAbstraction/SmbFileSystem.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public SmbFileSystem(ISmbClientFactory smbClientFactory, ISmbCredentialProvider
2323
DriveInfo = new SmbDriveInfoFactory(this, smbClientFactory, credentialProvider, smbFileSystemOptions, loggerFactory);
2424
DirectoryInfo = new SmbDirectoryInfoFactory(this, smbClientFactory, credentialProvider, smbFileSystemOptions, loggerFactory);
2525
FileInfo = new SmbFileInfoFactory(this, smbClientFactory, credentialProvider, smbFileSystemOptions, loggerFactory);
26+
FileVersionInfo = new SmbFileVersionInfoFactory(this);
2627
Path = new SmbPath(this);
2728
File = new SmbFile(this, smbClientFactory, credentialProvider, smbFileSystemOptions, loggerFactory);
2829
Directory = new SmbDirectory(this, smbClientFactory, credentialProvider, smbFileSystemOptions, loggerFactory);
@@ -44,6 +45,9 @@ public SmbFileSystem(ISmbClientFactory smbClientFactory, ISmbCredentialProvider
4445
/// <inheritdoc cref="SmbFileInfoFactory"/>
4546
public override IFileInfoFactory FileInfo { get; }
4647

48+
/// <inheritdoc cref="SmbFileVersionInfoFactory"/>
49+
public override IFileVersionInfoFactory FileVersionInfo { get; }
50+
4751
/// <inheritdoc cref="SmbPath"/>
4852
public override IPath Path { get; }
4953

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.IO.Abstractions;
3+
4+
namespace InkSoft.SmbAbstraction;
5+
6+
/// <inheritdoc />
7+
#if FEATURE_SERIALIZABLE
8+
[Serializable]
9+
#endif
10+
public class SmbFileVersionInfoFactory(IFileSystem fileSystem): IFileVersionInfoFactory
11+
{
12+
/// <inheritdoc />
13+
public IFileSystem FileSystem { get; } = fileSystem;
14+
15+
/// <inheritdoc />
16+
public IFileVersionInfo GetVersionInfo(string fileName) => new FileVersionInfoWrapper(System.Diagnostics.FileVersionInfo.GetVersionInfo(fileName));
17+
}

0 commit comments

Comments
 (0)