Add Binding redirects tests
This commit is contained in:
parent
4ccd88d00e
commit
c82d3cc08d
25 changed files with 645 additions and 55 deletions
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace BindingRedirects
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
private const string ExpectedNewtonSoftVersion = "8.0.0.0";
|
||||
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
return VerifyJsonLoad();
|
||||
}
|
||||
|
||||
private static int VerifyJsonLoad()
|
||||
{
|
||||
WriteLine("=======Verifying Redirected Newtonsoft.Json assembly load=======");
|
||||
|
||||
int result = 0;
|
||||
|
||||
try
|
||||
{
|
||||
var jsonAsm = typeof(Newtonsoft.Json.JsonConvert).Assembly;
|
||||
var version = jsonAsm.GetName().Version.ToString();
|
||||
if (version != ExpectedNewtonSoftVersion)
|
||||
{
|
||||
WriteLine($"Failure - Newtonsoft.Json: ExpectedVersion - {ExpectedNewtonSoftVersion}, ActualVersion - {version}");
|
||||
result = -1;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
WriteLine($"Failed to load type 'Newtonsoft.Json.JsonConvert'");
|
||||
throw ex;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static void WriteLine(string str)
|
||||
{
|
||||
var currentAssembly = Assembly.GetExecutingAssembly().GetName().Name;
|
||||
Console.WriteLine($"{currentAssembly}: {str}");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>281f1cdb-8627-47c7-9bb1-cde8d30d93d1</ProjectGuid>
|
||||
<RootNamespace>dotnet-desktop-binding-redirects</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"version": "1.0.0-*",
|
||||
"compilationOptions": {
|
||||
"emitEntryPoint": true
|
||||
},
|
||||
"dependencies": {
|
||||
"Newtonsoft.Json": "5.0.0",
|
||||
"NuGet.Protocol.Core.v3": "3.3.0"
|
||||
},
|
||||
"frameworks": {
|
||||
"net451": {
|
||||
"frameworkAssemblies": {
|
||||
"System.Configuration": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue