Skip to content

Commit 53afacb

Browse files
Fix emergency resolution (VS2017 for dataflow) - fixes #542
We can't do this because we don't ship the dataflow assembly. Doing so requires some extra build targets which seems like more complexity. [assembly: ProvideBindingRedirection(AssemblyName = "System.Threading.Tasks.Dataflow", OldVersionLowerBound = "0.0.0.0", OldVersionUpperBound = "4.5.9999.9999", NewVersion = "4.6.0.0")]
1 parent bfe2719 commit 53afacb

7 files changed

Lines changed: 24 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
1414
### C# -> VB
1515

1616

17+
## [8.0.1] - 2020-03-13
18+
19+
20+
### Vsix
21+
22+
* Fixes conversion in VS2017
23+
24+
### VB -> C#
25+
26+
27+
### C# -> VB
28+
29+
1730
## [8.0.0] - 2020-03-11
1831

1932
* Known issue: Breaks VS2017 support - please use [7.9.0](https://github.com/icsharpcode/CodeConverter/releases/tag/7.9.0) until the next version is released

CodeConverter/CodeConverter.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
* Completely free and open source: Check out [GitHub](https://github.com/icsharpcode/CodeConverter#code-converter-).</Description>
1111
<Product>Code Converter for C# to/from VB.NET</Product>
1212
<Copyright>Copyright (c) 2017-2020 AlphaSierraPapa for the CodeConverter team</Copyright>
13-
<AssemblyVersion>8.0.0.0</AssemblyVersion>
14-
<FileVersion>8.0.0.0</FileVersion>
13+
<AssemblyVersion>8.0.1.0</AssemblyVersion>
14+
<FileVersion>8.0.1.0</FileVersion>
1515
<Version>8.0.0</Version>
1616
<PackageId>ICSharpCode.CodeConverter</PackageId>
1717
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>

Vsix/CodeConverterPackage.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,22 +84,23 @@ public sealed class CodeConverterPackage : AsyncPackage
8484
internal Cancellation PackageCancellation { get; } = new Cancellation();
8585

8686
private readonly AssemblyName _thisAssemblyName;
87-
private readonly AssemblyName[] _ourAssemblyNames;
87+
private readonly HashSet<string> _ourAssemblyNames;
8888
/// <summary>
8989
/// Initializes a new instance of package class.
9090
/// </summary>
9191
public CodeConverterPackage()
9292
{
9393
var thisAssembly = GetType().Assembly;
9494
_thisAssemblyName = thisAssembly.GetName();
95-
_ourAssemblyNames = new[] { _thisAssemblyName }.Concat(thisAssembly.GetReferencedAssemblies().Where(a => a.Name.StartsWith("ICSharpCode"))).ToArray();
95+
_ourAssemblyNames = new HashSet<string>(new[] { _thisAssemblyName }.Concat(thisAssembly.GetReferencedAssemblies().Where(a => a.Name.StartsWith("ICSharpCode"))).Select(a => a.FullName));
9696
AppDomain.CurrentDomain.AssemblyResolve += LoadWithoutVersionForOurDependencies;
9797
// Inside this method you can place any initialization code that does not require
9898
// any Visual Studio service because at this point the package object is created but
9999
// not sited yet inside Visual Studio environment. The place to do all the other
100100
// initialization is the Initialize method.
101101
}
102102

103+
// System.Threading.Tasks.Dataflow 4.5.24.0 shipped with VS2017 15.9.21+28307.1064 but we want to target 4.6.0.0
103104
private Assembly LoadWithoutVersionForOurDependencies(object sender, ResolveEventArgs args)
104105
{
105106
var requestedAssemblyName = new AssemblyName(args.Name);
@@ -126,7 +127,7 @@ private static Assembly LoadAnyVersionOfAssembly(AssemblyName assemblyName)
126127

127128
private bool IsThisExtensionRequestingAssembly()
128129
{
129-
return GetPossibleRequestingAssemblies().Any(requesting => _ourAssemblyNames.Any(assemblyName => Equals(requesting, assemblyName)));
130+
return GetPossibleRequestingAssemblies().Any(requesting => _ourAssemblyNames.Contains(requesting.FullName));
130131
}
131132

132133
private IEnumerable<AssemblyName> GetPossibleRequestingAssemblies()

Vsix/source.extension.vsixmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
33
<Metadata>
4-
<Identity Id="7e2a69d6-193b-4cdf-878d-3370d5931942" Version="8.0.0.0" Language="en-US" Publisher="IC#Code"/>
4+
<Identity Id="7e2a69d6-193b-4cdf-878d-3370d5931942" Version="8.0.1.0" Language="en-US" Publisher="IC#Code"/>
55
<DisplayName>Code Converter C# to/from VB.NET</DisplayName>
66
<Description xml:space="preserve">Based on Roslyn, this converter allows you to convert C# code to VB.NET and vice versa</Description>
77
<License>license.txt</License>

Web/Web.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.1</TargetFramework>
55
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
6-
<AssemblyVersion>8.0.0.0</AssemblyVersion>
7-
<FileVersion>8.0.0.0</FileVersion>
6+
<AssemblyVersion>8.0.1.0</AssemblyVersion>
7+
<FileVersion>8.0.1.0</FileVersion>
88
<Version>8.0.0</Version>
99
<LangVersion>7.3</LangVersion>
1010
<NoWarn>$(NoWarn);1998</NoWarn>

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
platform: Any CPU
2-
version: 8.0.0.{build}
2+
version: 8.0.1.{build}
33
configuration: Debug
44
image: Visual Studio 2019
55

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pr:
77
variables:
88
solution: '**/CodeConverter.sln'
99
buildPlatform: 'Any CPU'
10-
buildVersion: '8.0.0.$(Build.BuildId)'
10+
buildVersion: '8.0.1.$(Build.BuildId)'
1111

1212
pool:
1313
vmImage: 'windows-2019'

0 commit comments

Comments
 (0)