Browse Source

Move ILSpy to net6.0-windows

pull/2642/head
Siegfried Pammer 3 years ago
parent
commit
9e54b44b11
  1. 10
      ICSharpCode.Decompiler.Tests/CorrectnessTestRunner.cs
  2. 2
      ICSharpCode.Decompiler.Tests/Helpers/Tester.VB.cs
  3. 14
      ICSharpCode.Decompiler.Tests/Helpers/Tester.cs
  4. 3
      ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
  5. 2
      ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs
  6. 2
      ICSharpCode.Decompiler.Tests/UglyTestRunner.cs
  7. 3
      ILSpy.AddIn.VS2022/ILSpy.AddIn.VS2022.csproj
  8. 2
      ILSpy.AddIn/ILSpy.AddIn.csproj
  9. 6
      ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj
  10. 7
      ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj
  11. 8
      ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj
  12. 3
      ILSpy.Tests/ILSpy.Tests.csproj
  13. 10
      ILSpy.sln
  14. 10
      ILSpy/App.xaml.cs
  15. 7
      ILSpy/ILSpy.csproj
  16. 6
      SharpTreeView/ICSharpCode.TreeView.csproj
  17. 2
      TestPlugin/TestPlugin.csproj
  18. 10
      multitargeting.props.template

10
ICSharpCode.Decompiler.Tests/CorrectnessTestRunner.cs

@ -393,9 +393,9 @@ namespace ICSharpCode.Decompiler.Tests @@ -393,9 +393,9 @@ namespace ICSharpCode.Decompiler.Tests
finally
{
if (outputFile != null)
outputFile.TempFiles.Delete();
outputFile.DeleteTempFiles();
if (decompiledOutputFile != null)
decompiledOutputFile.TempFiles.Delete();
decompiledOutputFile.DeleteTempFiles();
}
}
@ -421,9 +421,9 @@ namespace ICSharpCode.Decompiler.Tests @@ -421,9 +421,9 @@ namespace ICSharpCode.Decompiler.Tests
finally
{
if (outputFile != null)
outputFile.TempFiles.Delete();
outputFile.DeleteTempFiles();
if (decompiledOutputFile != null)
decompiledOutputFile.TempFiles.Delete();
decompiledOutputFile.DeleteTempFiles();
}
}
@ -446,7 +446,7 @@ namespace ICSharpCode.Decompiler.Tests @@ -446,7 +446,7 @@ namespace ICSharpCode.Decompiler.Tests
finally
{
if (decompiledOutputFile != null)
decompiledOutputFile.TempFiles.Delete();
decompiledOutputFile.DeleteTempFiles();
}
}
}

2
ICSharpCode.Decompiler.Tests/Helpers/Tester.VB.cs

@ -42,7 +42,7 @@ namespace ICSharpCode.Decompiler.Tests.Helpers @@ -42,7 +42,7 @@ namespace ICSharpCode.Decompiler.Tests.Helpers
if ((flags & CompilerOptions.UseMcsMask) == 0)
{
CompilerResults results = new CompilerResults(new TempFileCollection());
CompilerResults results = new CompilerResults();
results.PathToAssembly = outputFileName ?? Path.GetTempFileName();
var (roslynVersion, languageVersion) = (flags & CompilerOptions.UseRoslynMask) switch {

14
ICSharpCode.Decompiler.Tests/Helpers/Tester.cs

@ -372,7 +372,7 @@ namespace ICSharpCode.Decompiler.Tests.Helpers @@ -372,7 +372,7 @@ namespace ICSharpCode.Decompiler.Tests.Helpers
if ((flags & CompilerOptions.UseMcsMask) == 0)
{
CompilerResults results = new CompilerResults(new TempFileCollection());
CompilerResults results = new CompilerResults();
results.PathToAssembly = outputFileName ?? Path.GetTempFileName();
var (roslynVersion, languageVersion) = (flags & CompilerOptions.UseRoslynMask) switch {
@ -477,7 +477,7 @@ namespace ICSharpCode.Decompiler.Tests.Helpers @@ -477,7 +477,7 @@ namespace ICSharpCode.Decompiler.Tests.Helpers
}
else
{
CompilerResults results = new CompilerResults(new TempFileCollection());
CompilerResults results = new CompilerResults();
results.PathToAssembly = outputFileName ?? Path.GetTempFileName();
string testBasePath = RoundtripAssembly.TestDir;
if (!Directory.Exists(testBasePath))
@ -802,4 +802,14 @@ namespace ICSharpCode.Decompiler.Tests.Helpers @@ -802,4 +802,14 @@ namespace ICSharpCode.Decompiler.Tests.Helpers
Console.WriteLine("errors: " + errorTask.Result);
}
}
public class CompilerResults
{
public string PathToAssembly { get; set; }
public void DeleteTempFiles()
{
}
}
}

3
ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj

@ -2,8 +2,7 @@ @@ -2,8 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<LangVersion>8.0</LangVersion>
<TargetFramework>net6.0</TargetFramework>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>

2
ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs

@ -656,7 +656,7 @@ namespace ICSharpCode.Decompiler.Tests @@ -656,7 +656,7 @@ namespace ICSharpCode.Decompiler.Tests
finally
{
if (output != null)
output.TempFiles.Delete();
output.DeleteTempFiles();
}
// 2. Decompile

2
ICSharpCode.Decompiler.Tests/UglyTestRunner.cs

@ -150,7 +150,7 @@ namespace ICSharpCode.Decompiler.Tests @@ -150,7 +150,7 @@ namespace ICSharpCode.Decompiler.Tests
finally
{
if (output != null)
output.TempFiles.Delete();
output.DeleteTempFiles();
}
}

3
ILSpy.AddIn.VS2022/ILSpy.AddIn.VS2022.csproj

@ -2,7 +2,6 @@ @@ -2,7 +2,6 @@
<Project>
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" />
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<RootNamespace>ICSharpCode.ILSpy.AddIn</RootNamespace>
@ -55,12 +54,14 @@ @@ -55,12 +54,14 @@
<PackageReference Include="Mono.Cecil" Version="$(MonoCecilVersion)" />
</ItemGroup>
<!--
<ItemGroup>
<ProjectReference Include="..\ILSpy\ILSpy.csproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<Private>false</Private>
</ProjectReference>
</ItemGroup>
-->
<ItemGroup>
<Compile Include="..\ICSharpCode.Decompiler\Metadata\AssemblyReferences.cs" Link="Decompiler\AssemblyReferences.cs" />

2
ILSpy.AddIn/ILSpy.AddIn.csproj

@ -55,12 +55,14 @@ @@ -55,12 +55,14 @@
<PackageReference Include="Mono.Cecil" Version="$(MonoCecilVersion)" />
</ItemGroup>
<!--
<ItemGroup>
<ProjectReference Include="..\ILSpy\ILSpy.csproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<Private>false</Private>
</ProjectReference>
</ItemGroup>
-->
<ItemGroup>
<Compile Include="..\ICSharpCode.Decompiler\Metadata\AssemblyReferences.cs" Link="Decompiler\AssemblyReferences.cs" />

6
ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj

@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
<EnableDefaultItems>false</EnableDefaultItems>
<UseWpf>true</UseWpf>
<TargetFramework>net6.0-windows</TargetFramework>
<ExtrasEnableDefaultPageItems>false</ExtrasEnableDefaultPageItems>
<ExtrasEnableDefaultResourceItems>false</ExtrasEnableDefaultResourceItems>
@ -14,11 +15,6 @@ @@ -14,11 +15,6 @@
<AutoGenerateBindingRedirects>True</AutoGenerateBindingRedirects>
</PropertyGroup>
<Import Project="..\multitargeting.props" Condition="Exists('..\multitargeting.props')" />
<PropertyGroup Condition="!Exists('..\multitargeting.props')">
<TargetFramework>net472</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>

7
ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj

@ -2,16 +2,11 @@ @@ -2,16 +2,11 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<AssemblyName>ILSpy.BamlDecompiler.Plugin</AssemblyName>
<LangVersion>8.0</LangVersion>
<TargetFramework>net6.0-windows</TargetFramework>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<BaseAddress>6488064</BaseAddress>
<UseWpf>true</UseWpf>
</PropertyGroup>
<Import Project="..\multitargeting.props" Condition="Exists('..\multitargeting.props')" />
<PropertyGroup Condition="!Exists('..\multitargeting.props')">
<TargetFramework>net472</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugType>full</DebugType>

8
ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj

@ -3,16 +3,12 @@ @@ -3,16 +3,12 @@
<PropertyGroup>
<AssemblyName>ILSpy.ReadyToRun.Plugin</AssemblyName>
<LangVersion>8.0</LangVersion>
<TargetFramework>net6.0-windows</TargetFramework>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<NeutralResourcesLanguage>en-US</NeutralResourcesLanguage>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<UseWpf>true</UseWpf>
</PropertyGroup>
<Import Project="..\multitargeting.props" Condition="Exists('..\multitargeting.props')" />
<PropertyGroup Condition="!Exists('..\multitargeting.props')">
<TargetFramework>net472</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugType>full</DebugType>

3
ILSpy.Tests/ILSpy.Tests.csproj

@ -2,8 +2,7 @@ @@ -2,8 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<LangVersion>8.0</LangVersion>
<TargetFramework>net6.0-windows</TargetFramework>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>

10
ILSpy.sln

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.202
# Visual Studio Version 17
VisualStudioVersion = 17.0.32014.148
MinimumVisualStudioVersion = 15.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{F45DB999-7E72-4000-B5AD-3A7B485A0896}"
ProjectSection(SolutionItems) = preProject
@ -31,6 +31,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILSpy.AddIn", "ILSpy.AddIn\ @@ -31,6 +31,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILSpy.AddIn", "ILSpy.AddIn\
ProjectSection(ProjectDependencies) = postProject
{0313F581-C63B-43BB-AA9B-07615DABD8A3} = {0313F581-C63B-43BB-AA9B-07615DABD8A3}
{A6BAD2BA-76BA-461C-8B6D-418607591247} = {A6BAD2BA-76BA-461C-8B6D-418607591247}
{1E85EFF9-E370-4683-83E4-8A3D063FF791} = {1E85EFF9-E370-4683-83E4-8A3D063FF791}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.Decompiler.PdbProvider.Cecil", "ICSharpCode.Decompiler.PdbProvider.Cecil\ICSharpCode.Decompiler.PdbProvider.Cecil.csproj", "{B85A155A-9DD6-43BC-A624-2D8EC773D71F}"
@ -46,8 +47,11 @@ EndProject @@ -46,8 +47,11 @@ EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ILSpy.AddIn.Shared", "ILSpy.AddIn.Shared\ILSpy.AddIn.Shared.shproj", "{ACAB1E5D-B3DF-4092-AA72-692F8341E520}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILSpy.AddIn.VS2022", "ILSpy.AddIn.VS2022\ILSpy.AddIn.VS2022.csproj", "{09A03980-D14A-4705-A38C-741AD7166DEE}"
ProjectSection(ProjectDependencies) = postProject
{1E85EFF9-E370-4683-83E4-8A3D063FF791} = {1E85EFF9-E370-4683-83E4-8A3D063FF791}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ILSpy.Installer", "ILSpy.Installer\ILSpy.Installer.csproj", "{A4BA0771-DA4A-4A94-A5EC-5BA10B52816F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILSpy.Installer", "ILSpy.Installer\ILSpy.Installer.csproj", "{A4BA0771-DA4A-4A94-A5EC-5BA10B52816F}"
ProjectSection(ProjectDependencies) = postProject
{0313F581-C63B-43BB-AA9B-07615DABD8A3} = {0313F581-C63B-43BB-AA9B-07615DABD8A3}
{A6BAD2BA-76BA-461C-8B6D-418607591247} = {A6BAD2BA-76BA-461C-8B6D-418607591247}

10
ILSpy/App.xaml.cs

@ -127,25 +127,19 @@ namespace ICSharpCode.ILSpy @@ -127,25 +127,19 @@ namespace ICSharpCode.ILSpy
static Assembly ResolvePluginDependencies(AssemblyLoadContext context, AssemblyName assemblyName)
{
#if !NET472
var rootPath = Path.GetDirectoryName(typeof(App).Assembly.Location);
var assemblyFileName = Path.Combine(rootPath, assemblyName.Name + ".dll");
if (!File.Exists(assemblyFileName))
return null;
return context.LoadFromAssemblyPath(assemblyFileName);
#else
throw new NotImplementedException();
#endif
}
private static async Task InitializeMef()
{
#if !NET472
// Add custom logic for resolution of dependencies.
// This necessary because the AssemblyLoadContext.LoadFromAssemblyPath and related methods,
// do not automatically load dependencies.
AssemblyLoadContext.Default.Resolving += ResolvePluginDependencies;
#endif
// Cannot show MessageBox here, because WPF would crash with a XamlParseException
// Remember and show exceptions in text output, once MainWindow is properly initialized
try
@ -164,11 +158,7 @@ namespace ICSharpCode.ILSpy @@ -164,11 +158,7 @@ namespace ICSharpCode.ILSpy
var name = Path.GetFileNameWithoutExtension(plugin);
try
{
#if NET472
var asm = Assembly.Load(name);
#else
var asm = AssemblyLoadContext.Default.LoadFromAssemblyPath(plugin);
#endif
var parts = await discovery.CreatePartsAsync(asm);
catalog = catalog.AddParts(parts);
}

7
ILSpy/ILSpy.csproj

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<LangVersion>9.0</LangVersion>
<TargetFramework>net6.0-windows</TargetFramework>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
<GenerateSupportedRuntime>false</GenerateSupportedRuntime>
@ -18,11 +18,6 @@ @@ -18,11 +18,6 @@
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<Import Project="..\multitargeting.props" Condition="Exists('..\multitargeting.props')" />
<PropertyGroup Condition="!Exists('..\multitargeting.props')">
<TargetFramework>net472</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugType>full</DebugType>

6
SharpTreeView/ICSharpCode.TreeView.csproj

@ -5,14 +5,10 @@ @@ -5,14 +5,10 @@
<UseWpf>true</UseWpf>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<SignAssembly>True</SignAssembly>
<TargetFramework>net6.0-windows</TargetFramework>
<AssemblyOriginatorKeyFile>..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<Import Project="..\multitargeting.props" Condition="Exists('..\multitargeting.props')" />
<PropertyGroup Condition="!Exists('..\multitargeting.props')">
<TargetFramework>net472</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>

2
TestPlugin/TestPlugin.csproj

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<AssemblyName>Test.Plugin</AssemblyName>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<UseWpf>true</UseWpf>

10
multitargeting.props.template

@ -1,10 +0,0 @@ @@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copy this file to multitargeting.props
-->
<Project>
<PropertyGroup>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<TargetFrameworks>net472;net6.0-windows</TargetFrameworks>
</PropertyGroup>
</Project>
Loading…
Cancel
Save