diff --git a/.github/workflows/build-ilspy.yml b/.github/workflows/build-ilspy.yml index 2f627d473..315728067 100644 --- a/.github/workflows/build-ilspy.yml +++ b/.github/workflows/build-ilspy.yml @@ -89,12 +89,20 @@ jobs: path: ${{ env.StagingDirectory }}\${{ matrix.channel }}\*.* if-no-files-found: error - - name: Upload VSIX release build artifacts + - name: Upload VSIX (VS 2019) release build artifacts if: matrix.channel == 'zip' && matrix.configuration == 'release' uses: actions/upload-artifact@v2 with: - name: ILSpy VS Addin ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }}) - path: ILSpy.Addin\bin\${{ matrix.configuration }}\net472\*.vsix + name: ILSpy VS Addin for VS 2017-2019 ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }}) + path: ILSpy.AddIn\bin\${{ matrix.configuration }}\net472\*.vsix + if-no-files-found: error + + - name: Upload VSIX (VS 2022) release build artifacts + if: matrix.channel == 'zip' && matrix.configuration == 'release' + uses: actions/upload-artifact@v2 + with: + name: ILSpy VS Addin for VS 2022 ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }}) + path: ILSpy.AddIn.VS2022\bin\${{ matrix.configuration }}\net472\*.vsix if-no-files-found: error - name: Upload NuGet release build artifacts diff --git a/.gitignore b/.gitignore index 18ce1cf70..daa771ef3 100644 --- a/.gitignore +++ b/.gitignore @@ -11,8 +11,8 @@ _ReSharper*/ *.ReSharper *.patch .vs/ -/ILSpy.AddIn/Packages/* -/ILSpy.AddIn/source.extension.vsixmanifest +/ILSpy.AddIn*/Packages/* +/ILSpy.AddIn*/source.extension.vsixmanifest /ICSharpCode.Decompiler.Tests/TestCases/Disassembler/Pretty/*.dll /ICSharpCode.Decompiler.Tests/TestCases/Disassembler/Pretty/*.result.il /ICSharpCode.Decompiler.Tests/TestCases/Correctness/*.exe diff --git a/BuildTools/update-assemblyinfo.ps1 b/BuildTools/update-assemblyinfo.ps1 index f7fa079b1..65eec9897 100644 --- a/BuildTools/update-assemblyinfo.ps1 +++ b/BuildTools/update-assemblyinfo.ps1 @@ -75,7 +75,8 @@ $templateFiles = ( @{Input="ICSharpCode.Decompiler/Properties/AssemblyInfo.template.cs"; Output="ICSharpCode.Decompiler/Properties/AssemblyInfo.cs"}, @{Input="ICSharpCode.Decompiler/ICSharpCode.Decompiler.nuspec.template"; Output="ICSharpCode.Decompiler/ICSharpCode.Decompiler.nuspec"}, @{Input="ILSpy/Properties/app.config.template"; Output = "ILSpy/app.config"}, - @{Input="ILSpy.AddIn/source.extension.vsixmanifest.template"; Output = "ILSpy.AddIn/source.extension.vsixmanifest"} + @{Input="ILSpy.AddIn/source.extension.vsixmanifest.template"; Output = "ILSpy.AddIn/source.extension.vsixmanifest"}, + @{Input="ILSpy.AddIn.VS2022/source.extension.vsixmanifest.template"; Output = "ILSpy.AddIn.VS2022/source.extension.vsixmanifest"} ); $appxmanifestFiles = ( diff --git a/ILSpy.AddIn/AssemblyFileFinder.cs b/ILSpy.AddIn.Shared/AssemblyFileFinder.cs similarity index 100% rename from ILSpy.AddIn/AssemblyFileFinder.cs rename to ILSpy.AddIn.Shared/AssemblyFileFinder.cs diff --git a/ILSpy.AddIn/Commands/AssemblyReferenceForILSpy.cs b/ILSpy.AddIn.Shared/Commands/AssemblyReferenceForILSpy.cs similarity index 100% rename from ILSpy.AddIn/Commands/AssemblyReferenceForILSpy.cs rename to ILSpy.AddIn.Shared/Commands/AssemblyReferenceForILSpy.cs diff --git a/ILSpy.AddIn/Commands/NuGetReferenceForILSpy.cs b/ILSpy.AddIn.Shared/Commands/NuGetReferenceForILSpy.cs similarity index 100% rename from ILSpy.AddIn/Commands/NuGetReferenceForILSpy.cs rename to ILSpy.AddIn.Shared/Commands/NuGetReferenceForILSpy.cs diff --git a/ILSpy.AddIn/Commands/OpenCodeItemCommand.cs b/ILSpy.AddIn.Shared/Commands/OpenCodeItemCommand.cs similarity index 100% rename from ILSpy.AddIn/Commands/OpenCodeItemCommand.cs rename to ILSpy.AddIn.Shared/Commands/OpenCodeItemCommand.cs diff --git a/ILSpy.AddIn/Commands/OpenILSpyCommand.cs b/ILSpy.AddIn.Shared/Commands/OpenILSpyCommand.cs similarity index 100% rename from ILSpy.AddIn/Commands/OpenILSpyCommand.cs rename to ILSpy.AddIn.Shared/Commands/OpenILSpyCommand.cs diff --git a/ILSpy.AddIn/Commands/OpenProjectOutputCommand.cs b/ILSpy.AddIn.Shared/Commands/OpenProjectOutputCommand.cs similarity index 100% rename from ILSpy.AddIn/Commands/OpenProjectOutputCommand.cs rename to ILSpy.AddIn.Shared/Commands/OpenProjectOutputCommand.cs diff --git a/ILSpy.AddIn/Commands/OpenReferenceCommand.cs b/ILSpy.AddIn.Shared/Commands/OpenReferenceCommand.cs similarity index 100% rename from ILSpy.AddIn/Commands/OpenReferenceCommand.cs rename to ILSpy.AddIn.Shared/Commands/OpenReferenceCommand.cs diff --git a/ILSpy.AddIn/Commands/ProjectItemForILSpy.cs b/ILSpy.AddIn.Shared/Commands/ProjectItemForILSpy.cs similarity index 100% rename from ILSpy.AddIn/Commands/ProjectItemForILSpy.cs rename to ILSpy.AddIn.Shared/Commands/ProjectItemForILSpy.cs diff --git a/ILSpy.AddIn/Commands/ProjectReferenceForILSpy.cs b/ILSpy.AddIn.Shared/Commands/ProjectReferenceForILSpy.cs similarity index 100% rename from ILSpy.AddIn/Commands/ProjectReferenceForILSpy.cs rename to ILSpy.AddIn.Shared/Commands/ProjectReferenceForILSpy.cs diff --git a/ILSpy.AddIn/GlobalSuppressions.cs b/ILSpy.AddIn.Shared/GlobalSuppressions.cs similarity index 100% rename from ILSpy.AddIn/GlobalSuppressions.cs rename to ILSpy.AddIn.Shared/GlobalSuppressions.cs diff --git a/ILSpy.AddIn/Guids.cs b/ILSpy.AddIn.Shared/Guids.cs similarity index 77% rename from ILSpy.AddIn/Guids.cs rename to ILSpy.AddIn.Shared/Guids.cs index bbca1aa1a..4cb5e027c 100644 --- a/ILSpy.AddIn/Guids.cs +++ b/ILSpy.AddIn.Shared/Guids.cs @@ -6,7 +6,11 @@ namespace ICSharpCode.ILSpy.AddIn { static class GuidList { +#if VS2022 + public const string guidILSpyAddInPkgString = "ebf12ca7-a1fd-4aee-a894-4a0c5682fc2f"; +#else public const string guidILSpyAddInPkgString = "a9120dbe-164a-4891-842f-fb7829273838"; +#endif public const string guidILSpyAddInCmdSetString = "85ddb8ca-a842-4b1c-ba1a-94141fdf19d0"; public static readonly Guid guidILSpyAddInCmdSet = new Guid(guidILSpyAddInCmdSetString); diff --git a/ILSpy.AddIn.Shared/ILSpy.AddIn.Shared.projitems b/ILSpy.AddIn.Shared/ILSpy.AddIn.Shared.projitems new file mode 100644 index 000000000..4c01156b5 --- /dev/null +++ b/ILSpy.AddIn.Shared/ILSpy.AddIn.Shared.projitems @@ -0,0 +1,55 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + acab1e5d-b3df-4092-aa72-692f8341e520 + + + ILSpy.AddIn.Shared + + + + + + + + + + + + + + + + + + Resources.resx + True + True + + + + + + + Designer + Resources.Designer.cs + ResXFileCodeGenerator + + + VSPackage.resx + VSPackage.en-US.resources + true + + + true + VSPackage + + + VSPackage.resx + VSPackage.zh-Hans.resources + true + + + \ No newline at end of file diff --git a/ILSpy.AddIn.Shared/ILSpy.AddIn.Shared.shproj b/ILSpy.AddIn.Shared/ILSpy.AddIn.Shared.shproj new file mode 100644 index 000000000..80c9f2877 --- /dev/null +++ b/ILSpy.AddIn.Shared/ILSpy.AddIn.Shared.shproj @@ -0,0 +1,13 @@ + + + + acab1e5d-b3df-4092-aa72-692f8341e520 + 14.0 + + + + + + + + diff --git a/ILSpy.AddIn/ILSpyAddInPackage.cs b/ILSpy.AddIn.Shared/ILSpyAddInPackage.cs similarity index 100% rename from ILSpy.AddIn/ILSpyAddInPackage.cs rename to ILSpy.AddIn.Shared/ILSpyAddInPackage.cs diff --git a/ILSpy.AddIn/ILSpyInstance.cs b/ILSpy.AddIn.Shared/ILSpyInstance.cs similarity index 100% rename from ILSpy.AddIn/ILSpyInstance.cs rename to ILSpy.AddIn.Shared/ILSpyInstance.cs diff --git a/ILSpy.AddIn/PkgCmdID.cs b/ILSpy.AddIn.Shared/PkgCmdID.cs similarity index 100% rename from ILSpy.AddIn/PkgCmdID.cs rename to ILSpy.AddIn.Shared/PkgCmdID.cs diff --git a/ILSpy.AddIn/Resources.Designer.cs b/ILSpy.AddIn.Shared/Resources.Designer.cs similarity index 97% rename from ILSpy.AddIn/Resources.Designer.cs rename to ILSpy.AddIn.Shared/Resources.Designer.cs index 7fd7fbc44..24622b11d 100644 --- a/ILSpy.AddIn/Resources.Designer.cs +++ b/ILSpy.AddIn.Shared/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace ICSharpCode.ILSpy.AddIn { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/ILSpy.AddIn/Resources.resx b/ILSpy.AddIn.Shared/Resources.resx similarity index 100% rename from ILSpy.AddIn/Resources.resx rename to ILSpy.AddIn.Shared/Resources.resx diff --git a/ILSpy.AddIn/SyntaxNodeExtensions.cs b/ILSpy.AddIn.Shared/SyntaxNodeExtensions.cs similarity index 100% rename from ILSpy.AddIn/SyntaxNodeExtensions.cs rename to ILSpy.AddIn.Shared/SyntaxNodeExtensions.cs diff --git a/ILSpy.AddIn/Utils.cs b/ILSpy.AddIn.Shared/Utils.cs similarity index 100% rename from ILSpy.AddIn/Utils.cs rename to ILSpy.AddIn.Shared/Utils.cs diff --git a/ILSpy.AddIn/VSPackage.en-US.resx b/ILSpy.AddIn.Shared/VSPackage.en-US.resx similarity index 100% rename from ILSpy.AddIn/VSPackage.en-US.resx rename to ILSpy.AddIn.Shared/VSPackage.en-US.resx diff --git a/ILSpy.AddIn/VSPackage.resx b/ILSpy.AddIn.Shared/VSPackage.resx similarity index 97% rename from ILSpy.AddIn/VSPackage.resx rename to ILSpy.AddIn.Shared/VSPackage.resx index 345019f09..4cb6bb52e 100644 --- a/ILSpy.AddIn/VSPackage.resx +++ b/ILSpy.AddIn.Shared/VSPackage.resx @@ -135,6 +135,6 @@ Integration of the ILSpy Decompiler into Visual Studio. - Resources\Package.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\ILSpy.AddIn\Resources\Package.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/ILSpy.AddIn/VSPackage.zh-Hans.resx b/ILSpy.AddIn.Shared/VSPackage.zh-Hans.resx similarity index 100% rename from ILSpy.AddIn/VSPackage.zh-Hans.resx rename to ILSpy.AddIn.Shared/VSPackage.zh-Hans.resx diff --git a/ILSpy.AddIn.VS2022/Decompiler/Dummy.cs b/ILSpy.AddIn.VS2022/Decompiler/Dummy.cs new file mode 100644 index 000000000..db6431339 --- /dev/null +++ b/ILSpy.AddIn.VS2022/Decompiler/Dummy.cs @@ -0,0 +1,30 @@ +// Dummy types so that we can use compile some ICS.Decompiler classes in the AddIn context +// without depending on SRM etc. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace ICSharpCode.Decompiler +{ + public class ReferenceLoadInfo + { + public void AddMessage(params object[] args) { } + } + + enum MessageKind { Warning } + + public static class MetadataExtensions + { + public static string ToHexString(this IEnumerable bytes, int estimatedLength) + { + if (bytes == null) + throw new ArgumentNullException(nameof(bytes)); + + StringBuilder sb = new StringBuilder(estimatedLength * 2); + foreach (var b in bytes) + sb.AppendFormat("{0:x2}", b); + return sb.ToString(); + } + } +} diff --git a/ILSpy.AddIn.VS2022/ILSpy-Large.ico b/ILSpy.AddIn.VS2022/ILSpy-Large.ico new file mode 100644 index 000000000..14a26f95a Binary files /dev/null and b/ILSpy.AddIn.VS2022/ILSpy-Large.ico differ diff --git a/ILSpy.AddIn.VS2022/ILSpy.AddIn.VS2022.csproj b/ILSpy.AddIn.VS2022/ILSpy.AddIn.VS2022.csproj new file mode 100644 index 000000000..46bbdffc0 --- /dev/null +++ b/ILSpy.AddIn.VS2022/ILSpy.AddIn.VS2022.csproj @@ -0,0 +1,190 @@ + + + + + + + net472 + ICSharpCode.ILSpy.AddIn + + IC#Code + ILSpy + 1.7.1.0 + 1.7.1.0 + 9.0 + + False + true + TRACE;VSADDIN;VS2022 + + True + Key.snk + + + + full + true + + + + pdbonly + true + + + + False + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + false + false + + + + + + + + + + + + + + + + + + + + + + + + + ..\ILSpy\bin\$(Configuration)\$(TargetFramework)\ + + + + + true + \ + + + + + + + true + \ILSpy + + + + + + true + \ILSpy\zh-Hans\ + + + Always + true + + + + + + + + Designer + + + Designer + + + Designer + + + + Designer + + + + + true + Always + + + Menus.ctmenu + Designer + ILSpyAddIn.vsct + + + Menus.ctmenu + Designer + ILSpyAddIn.vsct + + + + + + + + + + + + + Always + true + + + + + true + false + true + ILSpy.AddIn for Visual Studio 2022 + + + + + + + + + + + True + + + + + + + + diff --git a/ILSpy.AddIn.VS2022/ILSpyAddIn.en-US.vsct b/ILSpy.AddIn.VS2022/ILSpyAddIn.en-US.vsct new file mode 100644 index 000000000..e52c29d25 --- /dev/null +++ b/ILSpy.AddIn.VS2022/ILSpyAddIn.en-US.vsct @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ILSpy.AddIn.VS2022/ILSpyAddIn.vsct b/ILSpy.AddIn.VS2022/ILSpyAddIn.vsct new file mode 100644 index 000000000..9fa465a4d --- /dev/null +++ b/ILSpy.AddIn.VS2022/ILSpyAddIn.vsct @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ILSpy.AddIn.VS2022/ILSpyAddIn.zh-Hans.vsct b/ILSpy.AddIn.VS2022/ILSpyAddIn.zh-Hans.vsct new file mode 100644 index 000000000..406299119 --- /dev/null +++ b/ILSpy.AddIn.VS2022/ILSpyAddIn.zh-Hans.vsct @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ILSpy.AddIn.VS2022/Key.snk b/ILSpy.AddIn.VS2022/Key.snk new file mode 100644 index 000000000..727377dec Binary files /dev/null and b/ILSpy.AddIn.VS2022/Key.snk differ diff --git a/ILSpy.AddIn.VS2022/Properties/AssemblyInfo.cs b/ILSpy.AddIn.VS2022/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..64f95fad1 --- /dev/null +++ b/ILSpy.AddIn.VS2022/Properties/AssemblyInfo.cs @@ -0,0 +1,17 @@ +using System; +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: ComVisible(false)] +[assembly: CLSCompliant(false)] +[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] +[assembly: InternalsVisibleTo("ILSpy.AddIn_IntegrationTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100653c4a319be4f524972c3c5bba5fd243330f8e900287d9022d7821a63fd0086fd3801e3683dbe9897f2ecc44727023e9b40adcf180730af70c81c54476b3e5ba8b0f07f5132b2c3cc54347a2c1a9d64ebaaaf3cbffc1a18c427981e2a51d53d5ab02536b7550e732f795121c38a0abfdb38596353525d034baf9e6f1fd8ac4ac")] +[assembly: InternalsVisibleTo("ILSpy.AddIn_UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100653c4a319be4f524972c3c5bba5fd243330f8e900287d9022d7821a63fd0086fd3801e3683dbe9897f2ecc44727023e9b40adcf180730af70c81c54476b3e5ba8b0f07f5132b2c3cc54347a2c1a9d64ebaaaf3cbffc1a18c427981e2a51d53d5ab02536b7550e732f795121c38a0abfdb38596353525d034baf9e6f1fd8ac4ac")] diff --git a/ILSpy.AddIn.VS2022/Properties/launchSettings.json b/ILSpy.AddIn.VS2022/Properties/launchSettings.json new file mode 100644 index 000000000..48d76ff24 --- /dev/null +++ b/ILSpy.AddIn.VS2022/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "Visual Studio Extension": { + "executablePath": "$(DevEnvDir)devenv.exe", + "commandLineArgs": "/rootsuffix $(VSSDKTargetPlatformRegRootSuffix) /log" + } + } +} diff --git a/ILSpy.AddIn.VS2022/README.md b/ILSpy.AddIn.VS2022/README.md new file mode 100644 index 000000000..7c363f311 --- /dev/null +++ b/ILSpy.AddIn.VS2022/README.md @@ -0,0 +1,3 @@ +Test cases for various types of projects as well as corresponding test plans are located in a separate repository. + +[https://github.com/icsharpcode/ILSpy-Addin-tests](https://github.com/icsharpcode/ILSpy-Addin-tests) \ No newline at end of file diff --git a/ILSpy.AddIn.VS2022/Resources/Images.png b/ILSpy.AddIn.VS2022/Resources/Images.png new file mode 100644 index 000000000..4a217fa71 Binary files /dev/null and b/ILSpy.AddIn.VS2022/Resources/Images.png differ diff --git a/ILSpy.AddIn.VS2022/Resources/Package.ico b/ILSpy.AddIn.VS2022/Resources/Package.ico new file mode 100644 index 000000000..900abec81 Binary files /dev/null and b/ILSpy.AddIn.VS2022/Resources/Package.ico differ diff --git a/ILSpy.AddIn.VS2022/source.extension.vsixmanifest.template b/ILSpy.AddIn.VS2022/source.extension.vsixmanifest.template new file mode 100644 index 000000000..aa768e64c --- /dev/null +++ b/ILSpy.AddIn.VS2022/source.extension.vsixmanifest.template @@ -0,0 +1,26 @@ + + + + + ILSpy 2022 + Integrates the ILSpy decompiler into Visual Studio. + https://ilspy.net + license.txt + ILSpy-Large.ico + + + + amd64 + + + + + + + + + + + + + diff --git a/ILSpy.AddIn.VS2022/zh-Hans/extension.vsixlangpack b/ILSpy.AddIn.VS2022/zh-Hans/extension.vsixlangpack new file mode 100644 index 000000000..c650a50a2 --- /dev/null +++ b/ILSpy.AddIn.VS2022/zh-Hans/extension.vsixlangpack @@ -0,0 +1,7 @@ + + + + ILSpy + 可以在 Visual Studio 中直接打开反编译工具 ILSpy 。 + + \ No newline at end of file diff --git a/ILSpy.AddIn/ILSpy.AddIn.csproj b/ILSpy.AddIn/ILSpy.AddIn.csproj index af12ddabc..560650c04 100644 --- a/ILSpy.AddIn/ILSpy.AddIn.csproj +++ b/ILSpy.AddIn/ILSpy.AddIn.csproj @@ -77,51 +77,8 @@ - - - - - - - - - - - - True - True - Resources.resx - - - - - - - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - true - VSPackage.en-US.resources - VSPackage.resx - - - true - VSPackage - - - true - VSPackage.zh-Hans.resources - VSPackage.resx -