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

Include BCL assemblies required for VS 2017 build tools #590

Merged
merged 1 commit into from Apr 15, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions azure-pipelines.yml
Expand Up @@ -58,10 +58,10 @@ stages:
displayName: Configure git commit author for testing

- task: UseDotNet@2
displayName: Install .NET Core SDK 5.0.100
displayName: Install .NET Core SDK 5.0.202
inputs:
packageType: sdk
version: 5.0.100
version: 5.0.202

- task: UseDotNet@2
displayName: Install .NET Core 3.1
Expand Down Expand Up @@ -306,10 +306,10 @@ stages:
packageType: sdk
version: 3.1.100
- task: UseDotNet@2
displayName: Install .NET Core SDK 5.0.100
displayName: Install .NET Core SDK 5.0.202
inputs:
packageType: sdk
version: 5.0.100
version: 5.0.202
- script: dotnet --info
displayName: Show dotnet SDK info
- bash: |
Expand Down
2 changes: 1 addition & 1 deletion global.json
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "5.0.100"
"version": "5.0.202"
}
}
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Expand Up @@ -4,7 +4,7 @@
<BaseIntermediateOutputPath>$(MSBuildThisFileDirectory)..\obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
<OutputPath>$(MSBuildThisFileDirectory)..\bin\$(MSBuildProjectName)\$(Configuration)\</OutputPath>
<DocumentationRootFolder>$(MSBuildThisFileDirectory)..\wiki\api</DocumentationRootFolder>
<LangVersion>8.0</LangVersion>
<LangVersion>9.0</LangVersion>

<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)strongname.snk</AssemblyOriginatorKeyFile>
Expand Down
48 changes: 48 additions & 0 deletions src/Nerdbank.GitVersioning.Tasks/AssemblyLoader.cs
@@ -0,0 +1,48 @@
#if NETFRAMEWORK

using System;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;

namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public sealed class ModuleInitializerAttribute : Attribute { }
}

namespace Nerdbank.GitVersioning.Tasks
{
internal static class AssemblyLoader
{
[ModuleInitializer]
internal static void LoaderInitializer()
{
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
}

private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
try
{
var required = new AssemblyName(args.Name);
string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), required.Name + ".dll");
if (File.Exists(path))
{
AssemblyName actual = AssemblyName.GetAssemblyName(path);
if (actual.Version >= required.Version)
{
return Assembly.LoadFile(path);
}
}
}
catch
{
}

return null;
}
}
}

#endif
Expand Up @@ -23,10 +23,13 @@ IMPORTANT: The 3.x release may produce a different version height than prior maj
<file src="$BaseOutputPath$net461\NerdBank.GitVersioning.dll" target="build\MSBuildFull\NerdBank.GitVersioning.dll" />
<file src="$BaseOutputPath$net461\Nerdbank.GitVersioning.Tasks.dll" target="build\MSBuildFull\Nerdbank.GitVersioning.Tasks.dll" />
<file src="$BaseOutputPath$net461\Newtonsoft.Json.dll" target="build\MSBuildFull\Newtonsoft.Json.dll" />
<file src="$BaseOutputPath$net461\PInvoke.Kernel32.dll" target="build\MSBuildFull\PInvoke.Kernel32.dll" />
<file src="$BaseOutputPath$net461\System.Buffers.dll" target="build\MSBuildFull\System.Buffers.dll" />
<file src="$BaseOutputPath$net461\System.Memory.dll" target="build\MSBuildFull\System.Memory.dll" />
<file src="$BaseOutputPath$net461\System.Numerics.Vectors.dll" target="build\MSBuildFull\System.Numerics.Vectors.dll" />
<file src="$BaseOutputPath$net461\System.Runtime.CompilerServices.Unsafe.dll" target="build\MSBuildFull\System.Runtime.CompilerServices.Unsafe.dll" />
<file src="$BaseOutputPath$net461\System.Text.Json.dll" target="build\MSBuildFull\System.Text.Json.dll" />
<file src="$BaseOutputPath$net461\Validation.dll" target="build\MSBuildFull\Validation.dll" />
<file src="$BaseOutputPath$net461\System.Runtime.CompilerServices.Unsafe.dll" target="build\MSBuildFull\System.Runtime.CompilerServices.Unsafe.dll" />
<file src="$BaseOutputPath$net461\PInvoke.Kernel32.dll" target="build\MSBuildFull\PInvoke.Kernel32.dll" />
<file src="$LibGit2SharpNativeBinaries$runtimes\**" target="build\runtimes\" />

<!-- Additional copies to work around DllNotFoundException on Mono (https://github.com/dotnet/Nerdbank.GitVersioning/issues/222) -->
Expand Down