Skip to content

Commit

Permalink
wip: .NET Core Support
Browse files Browse the repository at this point in the history
This is still work in progress. Current issues:

- [ ] Internals are not visible to tests/SRM, which breaks the build
- [ ] README needs updating with compatibility matrix
- [ ] Extensions built with .NET Core need testing
  • Loading branch information
dwmkerr committed Jul 14, 2020
1 parent 1bbea79 commit 374dbbb
Show file tree
Hide file tree
Showing 22 changed files with 297 additions and 733 deletions.
21 changes: 0 additions & 21 deletions SharpShell/SharedAssemblyInfo.cs

This file was deleted.

36 changes: 0 additions & 36 deletions SharpShell/SharpShell.Tests/Properties/AssemblyInfo.cs

This file was deleted.

95 changes: 15 additions & 80 deletions SharpShell/SharpShell.Tests/SharpShell.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,39 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\NUnit3TestAdapter.3.10.0\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.3.10.0\build\net35\NUnit3TestAdapter.props')" />
<Import Project="..\packages\NUnit.3.11.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.11.0\build\NUnit.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F87EC4C6-1E25-4433-8C15-B9550AF1D0EA}</ProjectGuid>
<TargetFramework>net45</TargetFramework>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SharpShell.Tests</RootNamespace>
<AssemblyName>SharpShell.Tests</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
Expand All @@ -42,58 +12,23 @@
<AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework, Version=3.11.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.11.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Diagnostics\Loggers\FileLogger.cs" />
<Compile Include="Helpers\Win32HelperTests.cs" />
<Compile Include="PidlManagerTests.cs" />
<Compile Include="Registry\InMemoryRegistryKeyTests.cs" />
<Compile Include="Registry\WindowsRegistryKeyTests.cs" />
<Compile Include="Registry\InMemoryRegistryTests.cs" />
<Compile Include="Registry\WindowsRegistryTests.cs" />
<Compile Include="ServerRegistration\FileExtensionClassTests.cs" />
<Compile Include="ServerRegistration\ServerRegistrationManagerTests.cs" />
<Compile Include="ServiceRegistry\ServiceRegistryTests.cs" />
<Compile Include="ShellInteropTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SharpShell\SharpShell.csproj">
<Project>{B5D5F670-BFBA-4D09-91C6-74BB12B7EDD4}</Project>
<Name>SharpShell</Name>
</ProjectReference>
<ProjectReference Include="..\SharpShell\SharpShell.csproj" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<ItemGroup>
<None Include="Key.snk" />
<None Include="packages.config" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="NUnit.Console" Version="3.9.0" />
<PackageReference Include="NUnit.ConsoleRunner" Version="3.9.0" />
<PackageReference Include="NUnit.Extension.NUnitProjectLoader" Version="3.5.0" />
<PackageReference Include="NUnit.Extension.NUnitV2Driver" Version="3.6.0" />
<PackageReference Include="NUnit.Extension.NUnitV2ResultWriter" Version="3.5.0" />
<PackageReference Include="NUnit.Extension.TeamCityEventListener" Version="1.0.3" />
<PackageReference Include="NUnit.Extension.VSProjectLoader" Version="3.8.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.10.0" />
<PackageReference Include="OpenCover" Version="4.6.519" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\NUnit.3.11.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.11.0\build\NUnit.props'))" />
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.3.10.0\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.3.10.0\build\net35\NUnit3TestAdapter.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
13 changes: 4 additions & 9 deletions SharpShell/SharpShell.sln
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2046
# Visual Studio Version 16
VisualStudioVersion = 16.0.30225.117
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpShell", "SharpShell\SharpShell.csproj", "{B5D5F670-BFBA-4D09-91C6-74BB12B7EDD4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpShell", "SharpShell\SharpShell.csproj", "{B5D5F670-BFBA-4D09-91C6-74BB12B7EDD4}"
ProjectSection(ProjectDependencies) = postProject
{56906C34-D601-45B3-8409-048DA1C9F35F} = {56906C34-D601-45B3-8409-048DA1C9F35F}
EndProjectSection
Expand All @@ -16,11 +16,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServerManager", "Tools\Serv
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2. Tools", "2. Tools", "{2B76CB23-07D4-4139-9872-3FF41FEA6F24}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "0. Info", "0. Info", "{A5AA3023-8450-45C8-BBB4-F5DB373AFF7D}"
ProjectSection(SolutionItems) = preProject
SharedAssemblyInfo.cs = SharedAssemblyInfo.cs
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CountLinesExtension", "Samples\ContextMenu\CountLinesExtension\CountLinesExtension.csproj", "{E48D396E-04AC-40C8-9046-66A896EF3568}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PropertySheet", "PropertySheet", "{8D0115C0-3631-46D2-B4BC-5DFB9D6DC614}"
Expand Down Expand Up @@ -81,7 +76,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DeskBand", "DeskBand", "{A7
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebSearchDeskBand", "Samples\DeskBand\WebSearchDeskBand\WebSearchDeskBand.csproj", "{B1A02ADB-14C2-4451-93C4-1A7E33D3EB2D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpShell.Tests", "SharpShell.Tests\SharpShell.Tests.csproj", "{F87EC4C6-1E25-4433-8C15-B9550AF1D0EA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpShell.Tests", "SharpShell.Tests\SharpShell.Tests.csproj", "{F87EC4C6-1E25-4433-8C15-B9550AF1D0EA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NamespaceExtension", "NamespaceExtension", "{915BB9DF-13F0-4E44-865F-4816C1FAB538}"
EndProject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace SharpShell.Diagnostics.Loggers
/// <summary>
/// A logger which logs to the Windows Event Log.
/// </summary>
internal class EventLogLogger : ILogger
public class EventLogLogger : ILogger
{
/// <summary>
/// The source created flag. If true, we have a source.
Expand Down
2 changes: 1 addition & 1 deletion SharpShell/SharpShell/Diagnostics/Loggers/FileLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace SharpShell.Diagnostics.Loggers
/// <summary>
/// SharpShell logger to write to a log file. Safe across processes.
/// </summary>
internal class FileLogger : ILogger
public class FileLogger : ILogger
{
/// <summary>
/// Mutex to allow multiple processes to write to the file.
Expand Down
3 changes: 0 additions & 3 deletions SharpShell/SharpShell/Pidl/PidlManager.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Configuration;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using SharpShell.Interop;

// Notes:
Expand Down
24 changes: 0 additions & 24 deletions SharpShell/SharpShell/Properties/AssemblyInfo.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ public static void SetDisableProcessIsolationValue(Guid classId, RegistrationTyp
/// <param name="serverName">Name of the server.</param>
/// <param name="associationAttributes">The association attributes.</param>
/// <param name="registrationType">Type of the registration.</param>
internal static void RegisterServerAssociations(Guid serverClsid, ServerType serverType, string serverName,
public static void RegisterServerAssociations(Guid serverClsid, ServerType serverType, string serverName,
IEnumerable<COMServerAssociationAttribute> associationAttributes, RegistrationType registrationType)
{
// Go through each association.
Expand Down Expand Up @@ -525,7 +525,7 @@ private static void UnsetIconHandlerDefaultIcon(IRegistryKey classesKey, string
/// <param name="serverName">Name of the server.</param>
/// <param name="associationAttributes">The association attributes.</param>
/// <param name="registrationType">Type of the registration.</param>
internal static void UnregisterServerAssociations(Guid serverClsid, ServerType serverType, string serverName,
public static void UnregisterServerAssociations(Guid serverClsid, ServerType serverType, string serverName,
IEnumerable<COMServerAssociationAttribute> associationAttributes, RegistrationType registrationType)
{
// Go through each association attribute.
Expand Down
2 changes: 1 addition & 1 deletion SharpShell/SharpShell/ServiceRegistry/ServiceRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static ServiceRegistry()
/// <summary>
/// Resets all providers. Typically used only for testing.
/// </summary>
internal static void Reset()
public static void Reset()
{
ServiceProviders.Clear();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.EnterpriseServices;
using System.Linq;
using System.Reflection.Emit;
using System.Runtime.InteropServices;
using System.Security.AccessControl;
using System.Security.Cryptography;
using System.Security.Principal;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using Microsoft.Win32;
using SharpShell.Attributes;
using SharpShell.Extensions;
Expand Down
Loading

0 comments on commit 374dbbb

Please sign in to comment.