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..6fec95621 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.VS17/source.extension.vsixmanifest.template"; Output = "ILSpy.AddIn.VS17/source.extension.vsixmanifest"} ); $appxmanifestFiles = ( diff --git a/ILSpy.AddIn.Shared/Guids.cs b/ILSpy.AddIn.Shared/Guids.cs index bbca1aa1a..a053166ee 100644 --- a/ILSpy.AddIn.Shared/Guids.cs +++ b/ILSpy.AddIn.Shared/Guids.cs @@ -6,7 +6,11 @@ namespace ICSharpCode.ILSpy.AddIn { static class GuidList { +#if VS17 + 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.VS17/Decompiler/Dummy.cs b/ILSpy.AddIn.VS17/Decompiler/Dummy.cs new file mode 100644 index 000000000..db6431339 --- /dev/null +++ b/ILSpy.AddIn.VS17/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.SharedFiles/ILSpy-Large.ico b/ILSpy.AddIn.VS17/ILSpy-Large.ico similarity index 100% rename from ILSpy.AddIn.SharedFiles/ILSpy-Large.ico rename to ILSpy.AddIn.VS17/ILSpy-Large.ico diff --git a/ILSpy.AddIn.VS17/ILSpy.AddIn.VS17.csproj b/ILSpy.AddIn.VS17/ILSpy.AddIn.VS17.csproj new file mode 100644 index 000000000..75390d238 --- /dev/null +++ b/ILSpy.AddIn.VS17/ILSpy.AddIn.VS17.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;VS17 + + 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.SharedFiles/ILSpyAddIn.en-US.vsct b/ILSpy.AddIn.VS17/ILSpyAddIn.en-US.vsct similarity index 100% rename from ILSpy.AddIn.SharedFiles/ILSpyAddIn.en-US.vsct rename to ILSpy.AddIn.VS17/ILSpyAddIn.en-US.vsct diff --git a/ILSpy.AddIn.VS17/ILSpyAddIn.vsct b/ILSpy.AddIn.VS17/ILSpyAddIn.vsct new file mode 100644 index 000000000..9fa465a4d --- /dev/null +++ b/ILSpy.AddIn.VS17/ILSpyAddIn.vsct @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ILSpy.AddIn.SharedFiles/ILSpyAddIn.zh-Hans.vsct b/ILSpy.AddIn.VS17/ILSpyAddIn.zh-Hans.vsct similarity index 100% rename from ILSpy.AddIn.SharedFiles/ILSpyAddIn.zh-Hans.vsct rename to ILSpy.AddIn.VS17/ILSpyAddIn.zh-Hans.vsct diff --git a/ILSpy.AddIn.VS17/Key.snk b/ILSpy.AddIn.VS17/Key.snk new file mode 100644 index 000000000..727377dec Binary files /dev/null and b/ILSpy.AddIn.VS17/Key.snk differ diff --git a/ILSpy.AddIn.VS17/Properties/AssemblyInfo.cs b/ILSpy.AddIn.VS17/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..64f95fad1 --- /dev/null +++ b/ILSpy.AddIn.VS17/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.VS17/Properties/launchSettings.json b/ILSpy.AddIn.VS17/Properties/launchSettings.json new file mode 100644 index 000000000..48d76ff24 --- /dev/null +++ b/ILSpy.AddIn.VS17/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "Visual Studio Extension": { + "executablePath": "$(DevEnvDir)devenv.exe", + "commandLineArgs": "/rootsuffix $(VSSDKTargetPlatformRegRootSuffix) /log" + } + } +} diff --git a/ILSpy.AddIn.VS17/README.md b/ILSpy.AddIn.VS17/README.md new file mode 100644 index 000000000..7c363f311 --- /dev/null +++ b/ILSpy.AddIn.VS17/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.SharedFiles/Resources/Images.png b/ILSpy.AddIn.VS17/Resources/Images.png similarity index 100% rename from ILSpy.AddIn.SharedFiles/Resources/Images.png rename to ILSpy.AddIn.VS17/Resources/Images.png diff --git a/ILSpy.AddIn.SharedFiles/Resources/Package.ico b/ILSpy.AddIn.VS17/Resources/Package.ico similarity index 100% rename from ILSpy.AddIn.SharedFiles/Resources/Package.ico rename to ILSpy.AddIn.VS17/Resources/Package.ico diff --git a/ILSpy.AddIn.VS17/source.extension.vsixmanifest.template b/ILSpy.AddIn.VS17/source.extension.vsixmanifest.template new file mode 100644 index 000000000..903a2f430 --- /dev/null +++ b/ILSpy.AddIn.VS17/source.extension.vsixmanifest.template @@ -0,0 +1,26 @@ + + + + + ILSpy + Integrates the ILSpy decompiler into Visual Studio. + https://ilspy.net + license.txt + ILSpy-Large.ico + + + + amd64 + + + + + + + + + + + + + diff --git a/ILSpy.AddIn.VS17/zh-Hans/extension.vsixlangpack b/ILSpy.AddIn.VS17/zh-Hans/extension.vsixlangpack new file mode 100644 index 000000000..c650a50a2 --- /dev/null +++ b/ILSpy.AddIn.VS17/zh-Hans/extension.vsixlangpack @@ -0,0 +1,7 @@ + + + + ILSpy + 可以在 Visual Studio 中直接打开反编译工具 ILSpy 。 + + \ No newline at end of file diff --git a/ILSpy.AddIn/ILSpy-Large.ico b/ILSpy.AddIn/ILSpy-Large.ico new file mode 100644 index 000000000..14a26f95a Binary files /dev/null and b/ILSpy.AddIn/ILSpy-Large.ico differ diff --git a/ILSpy.AddIn/ILSpy.AddIn.csproj b/ILSpy.AddIn/ILSpy.AddIn.csproj index 9d96e9027..2eacd380b 100644 --- a/ILSpy.AddIn/ILSpy.AddIn.csproj +++ b/ILSpy.AddIn/ILSpy.AddIn.csproj @@ -110,22 +110,22 @@ true \ILSpy\zh-Hans\ - + Always true - - + + - + Designer - + Designer - + Designer @@ -138,12 +138,12 @@ true Always - + Menus.ctmenu Designer ILSpyAddIn.vsct - + Menus.ctmenu Designer ILSpyAddIn.vsct @@ -177,7 +177,7 @@ - + True diff --git a/ILSpy.AddIn/ILSpyAddIn.en-US.vsct b/ILSpy.AddIn/ILSpyAddIn.en-US.vsct new file mode 100644 index 000000000..e52c29d25 --- /dev/null +++ b/ILSpy.AddIn/ILSpyAddIn.en-US.vsct @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ILSpy.AddIn.SharedFiles/ILSpyAddIn.vsct b/ILSpy.AddIn/ILSpyAddIn.vsct similarity index 100% rename from ILSpy.AddIn.SharedFiles/ILSpyAddIn.vsct rename to ILSpy.AddIn/ILSpyAddIn.vsct diff --git a/ILSpy.AddIn/ILSpyAddIn.zh-Hans.vsct b/ILSpy.AddIn/ILSpyAddIn.zh-Hans.vsct new file mode 100644 index 000000000..406299119 --- /dev/null +++ b/ILSpy.AddIn/ILSpyAddIn.zh-Hans.vsct @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ILSpy.AddIn/Resources/Images.png b/ILSpy.AddIn/Resources/Images.png new file mode 100644 index 000000000..4a217fa71 Binary files /dev/null and b/ILSpy.AddIn/Resources/Images.png differ diff --git a/ILSpy.AddIn/Resources/Package.ico b/ILSpy.AddIn/Resources/Package.ico new file mode 100644 index 000000000..900abec81 Binary files /dev/null and b/ILSpy.AddIn/Resources/Package.ico differ diff --git a/ILSpy.sln b/ILSpy.sln index ad66596a9..d9e3d4337 100644 --- a/ILSpy.sln +++ b/ILSpy.sln @@ -45,8 +45,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.Decompiler.Powe 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.VS17", "ILSpy.AddIn.VS17\ILSpy.AddIn.VS17.csproj", "{09A03980-D14A-4705-A38C-741AD7166DEE}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution + ILSpy.AddIn.Shared\ILSpy.AddIn.Shared.projitems*{09a03980-d14a-4705-a38c-741ad7166dee}*SharedItemsImports = 5 ILSpy.AddIn.Shared\ILSpy.AddIn.Shared.projitems*{9d7be6c0-b7b3-4a50-a54e-18a2d84a3384}*SharedItemsImports = 5 ILSpy.AddIn.Shared\ILSpy.AddIn.Shared.projitems*{acab1e5d-b3df-4092-aa72-692f8341e520}*SharedItemsImports = 13 EndGlobalSection @@ -107,6 +110,10 @@ Global {50060E0C-FA25-41F4-B72F-8490324EC9F0}.Debug|Any CPU.Build.0 = Debug|Any CPU {50060E0C-FA25-41F4-B72F-8490324EC9F0}.Release|Any CPU.ActiveCfg = Release|Any CPU {50060E0C-FA25-41F4-B72F-8490324EC9F0}.Release|Any CPU.Build.0 = Release|Any CPU + {09A03980-D14A-4705-A38C-741AD7166DEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {09A03980-D14A-4705-A38C-741AD7166DEE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {09A03980-D14A-4705-A38C-741AD7166DEE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {09A03980-D14A-4705-A38C-741AD7166DEE}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE