diff --git a/src/NuGetReferenceSwitcher.Presentation/Models/ProjectModel.cs b/src/NuGetReferenceSwitcher.Presentation/Models/ProjectModel.cs index 40e7d48..2bf020e 100644 --- a/src/NuGetReferenceSwitcher.Presentation/Models/ProjectModel.cs +++ b/src/NuGetReferenceSwitcher.Presentation/Models/ProjectModel.cs @@ -6,14 +6,15 @@ // Rico Suter, mail@rsuter.com //----------------------------------------------------------------------- +using EnvDTE; +using EnvDTE80; +using MyToolkit.Collections; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Windows.Threading; using System.Xml; -using EnvDTE; -using MyToolkit.Collections; using VSLangProj; namespace NuGetReferenceSwitcher.Presentation.Models @@ -27,11 +28,11 @@ public class ProjectModel /// Initializes a new instance of the class. /// The native project object. /// The native application object. - public ProjectModel(VSProject project, DTE application) + public ProjectModel(VSProject project, DTE2 application) { _vsProject = project; - Name = project.Project.Name; + Name = project.Project.Name; SolutionFile = new FileInfo(application.Solution.FileName); LoadReferences(); } @@ -56,7 +57,7 @@ public string PreviousConfigurationPath { get { return GetConfigurationPath(".previous.nugetreferenceswitcher"); } } - + /// Gets the current project reference to NuGet reference transformations. public List CurrentToNuGetTransformations { @@ -75,10 +76,10 @@ public string Path get { return _vsProject.Project.FileName; } } - /// Deletes the previous configuration file and renames the current + /// Deletes the previous configuration file and renames the current /// configuration file to the path of the previous configuration file. public void DeleteConfigurationFile() - { + { if (File.Exists(CurrentConfigurationPath)) { if (File.Exists(PreviousConfigurationPath)) @@ -118,7 +119,7 @@ public bool AddReference(string assemblyPath) return true; } - return false; + return false; } /// Removes the project from the solution. @@ -146,10 +147,9 @@ private List LoadTransformationsFromFile(strin .Select(l => l.Split('\t')) .Where(l => l.Length == 3).ToArray(); - - foreach (var line in lines) - list.Add(new FromProjectToNuGetTransformation { + list.Add(new FromProjectToNuGetTransformation + { FromProjectName = line[0], FromProjectPath = PathUtilities.MakeAbsolute(line[1], configurationPath), ToAssemblyPath = PathUtilities.MakeAbsolute(line[2], configurationPath) diff --git a/src/NuGetReferenceSwitcher.Presentation/Models/Reference4.cs b/src/NuGetReferenceSwitcher.Presentation/Models/Reference4.cs index e918fc0..9be5e84 100644 --- a/src/NuGetReferenceSwitcher.Presentation/Models/Reference4.cs +++ b/src/NuGetReferenceSwitcher.Presentation/Models/Reference4.cs @@ -1,51 +1,56 @@ -using System; -using System.Collections.Generic; -using System.Linq; +using EnvDTE; +using System; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; -using EnvDTE; using VSLangProj; namespace NuGetReferenceSwitcher.Presentation.Models { [Guid("F71B6036-80F1-4F08-BC59-B5D92865F629")] public interface Reference4 - { - // Reference - [DispId(1)] DTE DTE { get; } - [DispId(2)] References Collection { get; } - [DispId(3)] Project ContainingProject { get; } - [DispId(4)] void Remove(); - [DispId(5)] string Name { get; } - [DispId(6)] prjReferenceType Type { get; } - [DispId(7)] string Identity { get; } - [DispId(8)] string Path { get; } - [DispId(9)] string Description { get; } - [DispId(10)] string Culture { get; } - [DispId(11)] int MajorVersion { get; } - [DispId(12)] int MinorVersion { get; } - [DispId(13)] int RevisionNumber { get; } - [DispId(14)] int BuildNumber { get; } - [DispId(15)] bool StrongName { get; } - [DispId(16)] Project SourceProject { get; } - [DispId(17)] bool CopyLocal { get; set; } - [DispId(18), TypeLibFunc(1088)] dynamic get_Extender(string ExtenderName); - [DispId(19)] dynamic ExtenderNames { get; } - [DispId(20)] string ExtenderCATID { get; } - [DispId(21)] string PublicKeyToken { get; } - [DispId(22)] string Version { get; } - // Reference2 - [DispId(100)] string RuntimeVersion { get; } - // Reference3 - [DispId(120)] bool SpecificVersion { get; set; } // The property we actually need - [DispId(121)] string SubType { get; set; } - [DispId(122)] bool Isolated { get; set; } - [DispId(123)] string Aliases { get; set; } - [DispId(124)] uint RefType { get; } - [DispId(125)] bool AutoReferenced { get; } - [DispId(126)] bool Resolved { get; } - // Reference4 - [DispId(127)] bool EmbedInteropTypes { get; set; } + { + // Reference + [DispId(1)] DTE DTE { get; } + + [DispId(2)] References Collection { get; } + [DispId(3)] Project ContainingProject { get; } + + [DispId(4)] void Remove(); + + [DispId(5)] string Name { get; } + [DispId(6)] prjReferenceType Type { get; } + [DispId(7)] string Identity { get; } + [DispId(8)] string Path { get; } + [DispId(9)] string Description { get; } + [DispId(10)] string Culture { get; } + [DispId(11)] int MajorVersion { get; } + [DispId(12)] int MinorVersion { get; } + [DispId(13)] int RevisionNumber { get; } + [DispId(14)] int BuildNumber { get; } + [DispId(15)] bool StrongName { get; } + [DispId(16)] Project SourceProject { get; } + [DispId(17)] bool CopyLocal { get; set; } + + [DispId(18), TypeLibFunc(1088)] dynamic get_Extender(string ExtenderName); + + [DispId(19)] dynamic ExtenderNames { get; } + [DispId(20)] string ExtenderCATID { get; } + [DispId(21)] string PublicKeyToken { get; } + [DispId(22)] string Version { get; } + + // Reference2 + [DispId(100)] string RuntimeVersion { get; } + + // Reference3 + [DispId(120)] bool SpecificVersion { get; set; } // The property we actually need + + [DispId(121)] string SubType { get; set; } + [DispId(122)] bool Isolated { get; set; } + [DispId(123)] string Aliases { get; set; } + [DispId(124)] uint RefType { get; } + [DispId(125)] bool AutoReferenced { get; } + [DispId(126)] bool Resolved { get; } + + // Reference4 + [DispId(127)] bool EmbedInteropTypes { get; set; } } -} +} \ No newline at end of file diff --git a/src/NuGetReferenceSwitcher.Presentation/NuGetReferenceSwitcher.Presentation.csproj b/src/NuGetReferenceSwitcher.Presentation/NuGetReferenceSwitcher.Presentation.csproj index 58ff0e6..fdf8820 100644 --- a/src/NuGetReferenceSwitcher.Presentation/NuGetReferenceSwitcher.Presentation.csproj +++ b/src/NuGetReferenceSwitcher.Presentation/NuGetReferenceSwitcher.Presentation.csproj @@ -37,40 +37,17 @@ StrongNameKey.snk - - True - - - False - - - True - - - True - - - + - - - - - - true - - - true - - + - + ..\packages\MyToolkit.2.3.12.0\lib\portable-net45+wp8+win8+wpa81\MyToolkit.dll - + ..\packages\MyToolkit.Extended.2.3.12.0\lib\net45\MyToolkit.Extended.dll @@ -84,9 +61,6 @@ - - True - @@ -126,11 +100,11 @@ - \ No newline at end of file diff --git a/src/NuGetReferenceSwitcher.Presentation/ViewModels/MainDialogModel.cs b/src/NuGetReferenceSwitcher.Presentation/ViewModels/MainDialogModel.cs index 41a9a7a..ebb2c05 100644 --- a/src/NuGetReferenceSwitcher.Presentation/ViewModels/MainDialogModel.cs +++ b/src/NuGetReferenceSwitcher.Presentation/ViewModels/MainDialogModel.cs @@ -6,6 +6,13 @@ // Rico Suter, mail@rsuter.com //----------------------------------------------------------------------- +using EnvDTE; +using EnvDTE80; +using MyToolkit.Build; +using MyToolkit.Collections; +using MyToolkit.Mvvm; +using MyToolkit.Utilities; +using NuGetReferenceSwitcher.Presentation.Models; using System; using System.Collections.Generic; using System.IO; @@ -14,13 +21,6 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Threading; -using EnvDTE; -using EnvDTE80; -using MyToolkit.Build; -using MyToolkit.Collections; -using MyToolkit.Mvvm; -using MyToolkit.Utilities; -using NuGetReferenceSwitcher.Presentation.Models; using VSLangProj; namespace NuGetReferenceSwitcher.Presentation.ViewModels @@ -51,7 +51,7 @@ public MainDialogModel() public bool RemoveProjects { get; set; } /// Gets or sets the Visual Studio application object. - public DTE Application { get; set; } + public DTE2 Application { get; set; } /// Gets or sets the used UI dispatcher. public Dispatcher Dispatcher { get; set; } @@ -73,7 +73,7 @@ public string ExtensionVersion get { return ExtensionAssembly != null ? ExtensionAssembly.GetVersionWithBuildTime() : "n/a"; } } - /// Initializes the view model. Must only be called once per view model instance + /// Initializes the view model. Must only be called once per view model instance /// (after the InitializeComponent method of a ). public override async void Initialize() { @@ -134,7 +134,7 @@ await RunTaskAsync(token => Task.Run(() => PathUtilities.MakeRelative(assemblyToProjectSwitch.ToProject.Path, project.CurrentConfigurationPath) + "\t" + PathUtilities.MakeRelative(fromAssemblyPath, project.CurrentConfigurationPath) + - "\n"; + "\n"; } else { @@ -186,7 +186,7 @@ await RunTaskAsync(token => Task.Run(() => { MessageBox.Show("The project '" + transformation.ToAssemblyPath + "' could not be added. " + "\nSkipped.", "Could not add project", MessageBoxButton.OK, MessageBoxImage.Error); - } + } } } @@ -273,4 +273,4 @@ private void RemoveProjectsFromSolution(List projectsToDelete) } } } -} +} \ No newline at end of file diff --git a/src/NuGetReferenceSwitcher.Presentation/Views/MainDialog.xaml.cs b/src/NuGetReferenceSwitcher.Presentation/Views/MainDialog.xaml.cs index f415c56..875f109 100644 --- a/src/NuGetReferenceSwitcher.Presentation/Views/MainDialog.xaml.cs +++ b/src/NuGetReferenceSwitcher.Presentation/Views/MainDialog.xaml.cs @@ -6,23 +6,21 @@ // Rico Suter, mail@rsuter.com //----------------------------------------------------------------------- -using System.Linq; -using System.Reflection; -using System.Windows; -using System.Windows.Documents; -using System.Windows.Forms; -using System.Windows.Input; using EnvDTE; - +using EnvDTE80; using Microsoft.VisualStudio.PlatformUI; - using MyToolkit.Collections; using MyToolkit.Mvvm; using NuGetReferenceSwitcher.Presentation.Models; using NuGetReferenceSwitcher.Presentation.ViewModels; +using System.Linq; +using System.Reflection; +using System.Windows; +using System.Windows.Documents; +using System.Windows.Forms; +using System.Windows.Input; using Button = System.Windows.Controls.Button; using KeyEventArgs = System.Windows.Input.KeyEventArgs; -using Window = System.Windows.Window; namespace NuGetReferenceSwitcher.Presentation.Views { @@ -30,15 +28,15 @@ namespace NuGetReferenceSwitcher.Presentation.Views public partial class MainDialog : DialogWindow { private OpenFileDialog _dlg; - + /// Initializes a new instance of the class. /// The application object. /// The assembly of the extension. - public MainDialog(DTE application, Assembly extensionAssembly) + public MainDialog(DTE2 application, Assembly extensionAssembly) { InitializeComponent(); - Model.ExtensionAssembly = extensionAssembly; + Model.ExtensionAssembly = extensionAssembly; Model.Application = application; Model.Dispatcher = Dispatcher; @@ -103,4 +101,4 @@ private void OnSelectProjectFile(object sender, RoutedEventArgs e) fntpSwitch.ToProjectPath = _dlg.FileName; } } -} +} \ No newline at end of file diff --git a/src/NuGetReferenceSwitcher.Presentation/packages.config b/src/NuGetReferenceSwitcher.Presentation/packages.config index a633c3a..3f856b6 100644 --- a/src/NuGetReferenceSwitcher.Presentation/packages.config +++ b/src/NuGetReferenceSwitcher.Presentation/packages.config @@ -1,5 +1,5 @@  - - + + \ No newline at end of file diff --git a/src/NuGetReferenceSwitcher.VS22.sln b/src/NuGetReferenceSwitcher.VS22.sln new file mode 100644 index 0000000..cff888b --- /dev/null +++ b/src/NuGetReferenceSwitcher.VS22.sln @@ -0,0 +1,34 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.2.32505.173 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{ACE60C03-4FB9-498F-A6E3-8D20C10F0C4E}" + ProjectSection(SolutionItems) = preProject + IntegrationTests.testsettings = IntegrationTests.testsettings + UnitTests.testsettings = UnitTests.testsettings + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGetReferenceSwitcher.VS22", "NuGetReferenceSwitcher.VS22\NuGetReferenceSwitcher.VS22.csproj", "{BF9A4C82-BEB4-4BCE-8CDF-5AA6D4A16E46}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGetReferenceSwitcher.Presentation", "NuGetReferenceSwitcher.Presentation\NuGetReferenceSwitcher.Presentation.csproj", "{72D2BBE2-B1F7-4782-B7BD-CA377F895746}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BF9A4C82-BEB4-4BCE-8CDF-5AA6D4A16E46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BF9A4C82-BEB4-4BCE-8CDF-5AA6D4A16E46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BF9A4C82-BEB4-4BCE-8CDF-5AA6D4A16E46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BF9A4C82-BEB4-4BCE-8CDF-5AA6D4A16E46}.Release|Any CPU.Build.0 = Release|Any CPU + {72D2BBE2-B1F7-4782-B7BD-CA377F895746}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {72D2BBE2-B1F7-4782-B7BD-CA377F895746}.Debug|Any CPU.Build.0 = Debug|Any CPU + {72D2BBE2-B1F7-4782-B7BD-CA377F895746}.Release|Any CPU.ActiveCfg = Release|Any CPU + {72D2BBE2-B1F7-4782-B7BD-CA377F895746}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/src/NuGetReferenceSwitcher.VS22/GlobalSuppressions.cs b/src/NuGetReferenceSwitcher.VS22/GlobalSuppressions.cs new file mode 100644 index 0000000..a893f9d --- /dev/null +++ b/src/NuGetReferenceSwitcher.VS22/GlobalSuppressions.cs @@ -0,0 +1,11 @@ +// This file is used by Code Analysis to maintain SuppressMessage +// attributes that are applied to this project. Project-level +// suppressions either have no target or are given a specific target +// and scoped to a namespace, type, member, etc. +// +// To add a suppression to this file, right-click the message in the +// Error List, point to "Suppress Message(s)", and click "In Project +// Suppression File". You do not need to add suppressions to this +// file manually. + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1017:MarkAssembliesWithComVisible")] diff --git a/src/NuGetReferenceSwitcher.VS22/Guids.cs b/src/NuGetReferenceSwitcher.VS22/Guids.cs new file mode 100644 index 0000000..2b62ceb --- /dev/null +++ b/src/NuGetReferenceSwitcher.VS22/Guids.cs @@ -0,0 +1,15 @@ +// Guids.cs +// MUST match guids.h + +using System; + +namespace RicoSuter.NuGetReferenceSwitcher +{ + static class GuidList + { + public const string guidNuGetReferenceSwitcherPkgString = "87a7b0e9-e41c-47c8-953c-b81650401edb"; + public const string guidNuGetReferenceSwitcherCmdSetString = "ae6a9753-b188-45b5-8563-70bc990bf707"; + + public static readonly Guid guidNuGetReferenceSwitcherCmdSet = new Guid(guidNuGetReferenceSwitcherCmdSetString); + }; +} \ No newline at end of file diff --git a/src/NuGetReferenceSwitcher.VS22/Key.snk b/src/NuGetReferenceSwitcher.VS22/Key.snk new file mode 100644 index 0000000..3dfa651 Binary files /dev/null and b/src/NuGetReferenceSwitcher.VS22/Key.snk differ diff --git a/src/NuGetReferenceSwitcher.VS22/MyToolkit.Extended.dll b/src/NuGetReferenceSwitcher.VS22/MyToolkit.Extended.dll new file mode 100644 index 0000000..7b01c2d Binary files /dev/null and b/src/NuGetReferenceSwitcher.VS22/MyToolkit.Extended.dll differ diff --git a/src/NuGetReferenceSwitcher.VS22/MyToolkit.dll b/src/NuGetReferenceSwitcher.VS22/MyToolkit.dll new file mode 100644 index 0000000..992a30d Binary files /dev/null and b/src/NuGetReferenceSwitcher.VS22/MyToolkit.dll differ diff --git a/src/NuGetReferenceSwitcher.VS22/NuGetReferenceSwitcher.VS22.csproj b/src/NuGetReferenceSwitcher.VS22/NuGetReferenceSwitcher.VS22.csproj new file mode 100644 index 0000000..b710f0e --- /dev/null +++ b/src/NuGetReferenceSwitcher.VS22/NuGetReferenceSwitcher.VS22.csproj @@ -0,0 +1,331 @@ + + + + 17.0 + 12.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + 12.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + Program + $(DevEnvDir)\devenv.exe + /rootsuffix Exp + + + + + + Debug + AnyCPU + 2.0 + {BF9A4C82-BEB4-4BCE-8CDF-5AA6D4A16E46} + {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Properties + RicoSuter.NuGetReferenceSwitcher + NuGetReferenceSwitcher + True + Key.snk + v4.7.2 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\build\Output\VS22\ + TRACE + prompt + 4 + true + + + + ..\packages\MessagePack.2.5.124\lib\netstandard2.0\MessagePack.dll + + + ..\packages\MessagePack.Annotations.2.5.124\lib\netstandard2.0\MessagePack.Annotations.dll + + + ..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll + + + + ..\packages\Microsoft.IO.Redist.6.0.0\lib\net472\Microsoft.IO.Redist.dll + + + ..\packages\Microsoft.NET.StringTools.17.10.4\lib\net472\Microsoft.NET.StringTools.dll + + + ..\packages\Microsoft.ServiceHub.Framework.4.5.31\lib\net472\Microsoft.ServiceHub.Framework.dll + + + ..\packages\Microsoft.VisualStudio.Composition.17.7.40\lib\net472\Microsoft.VisualStudio.Composition.dll + + + ..\packages\Microsoft.VisualStudio.RemoteControl.16.3.52\lib\net45\Microsoft.VisualStudio.RemoteControl.dll + + + ..\packages\Microsoft.VisualStudio.RpcContracts.17.10.21\lib\netstandard2.0\Microsoft.VisualStudio.RpcContracts.dll + + + + + + + + + ..\packages\Microsoft.VisualStudio.Telemetry.17.10.32\lib\net45\Microsoft.VisualStudio.Telemetry.dll + + + ..\packages\Microsoft.VisualStudio.Threading.17.10.41\lib\net472\Microsoft.VisualStudio.Threading.dll + + + ..\packages\Microsoft.VisualStudio.Utilities.17.9.37000\lib\net472\Microsoft.VisualStudio.Utilities.dll + + + ..\packages\Microsoft.VisualStudio.Utilities.Internal.16.3.56\lib\net45\Microsoft.VisualStudio.Utilities.Internal.dll + + + ..\packages\Microsoft.VisualStudio.Validation.17.8.8\lib\netstandard2.0\Microsoft.VisualStudio.Validation.dll + + + ..\packages\Microsoft.Win32.Registry.5.0.0\lib\net461\Microsoft.Win32.Registry.dll + + + ..\packages\MyToolkit.2.3.12.0\lib\portable-net45+wp8+win8+wpa81\MyToolkit.dll + True + + + ..\packages\MyToolkit.Extended.2.3.12.0\lib\net45\MyToolkit.Extended.dll + True + + + ..\packages\Nerdbank.Streams.2.10.69\lib\netstandard2.0\Nerdbank.Streams.dll + + + + ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll + + + + + ..\packages\StreamJsonRpc.2.18.48\lib\netstandard2.0\StreamJsonRpc.dll + + + + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + ..\packages\System.Collections.Immutable.8.0.0\lib\net462\System.Collections.Immutable.dll + + + + ..\packages\System.Composition.AttributedModel.8.0.0\lib\net462\System.Composition.AttributedModel.dll + + + ..\packages\System.Composition.Convention.8.0.0\lib\net462\System.Composition.Convention.dll + + + ..\packages\System.Composition.Hosting.8.0.0\lib\net462\System.Composition.Hosting.dll + + + ..\packages\System.Composition.Runtime.8.0.0\lib\net462\System.Composition.Runtime.dll + + + ..\packages\System.Composition.TypedParts.8.0.0\lib\net462\System.Composition.TypedParts.dll + + + + + + + ..\packages\System.Diagnostics.DiagnosticSource.8.0.0\lib\net462\System.Diagnostics.DiagnosticSource.dll + + + + ..\packages\System.IO.Pipelines.8.0.0\lib\net462\System.IO.Pipelines.dll + + + + ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll + + + + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + ..\packages\System.Reflection.Metadata.8.0.0\lib\net462\System.Reflection.Metadata.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + + + ..\packages\System.Security.AccessControl.6.0.0\lib\net461\System.Security.AccessControl.dll + + + ..\packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll + + + ..\packages\System.Text.Encodings.Web.8.0.0\lib\net462\System.Text.Encodings.Web.dll + + + ..\packages\System.Text.Json.8.0.0\lib\net462\System.Text.Json.dll + + + ..\packages\System.Threading.AccessControl.8.0.0\lib\net462\System.Threading.AccessControl.dll + + + ..\packages\System.Threading.Tasks.Dataflow.8.0.0\lib\net462\System.Threading.Tasks.Dataflow.dll + + + ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll + + + ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll + + + + + + True + + + + + + {00020430-0000-0000-C000-000000000046} + 2 + 0 + 0 + primary + False + False + + + + + + True + True + Resources.resx + + + + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + true + VSPackage + + + + + + Designer + + + + + + + + Menus.ctmenu + + + + + + + + Always + true + + + Always + true + + + + + + {72D2BBE2-B1F7-4782-B7BD-CA377F895746} + NuGetReferenceSwitcher.Presentation + BuiltProjectOutputGroup%3bBuiltProjectOutputGroupDependencies%3bGetCopyToOutputDirectoryItems%3bSatelliteDllsProjectOutputGroup%3b + DebugSymbolsProjectOutputGroup%3b + + + + + False + Microsoft .NET Framework 4.5 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + + + + + + + + + + + + + true + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + \ No newline at end of file diff --git a/src/NuGetReferenceSwitcher.VS22/NuGetReferenceSwitcher.vsct b/src/NuGetReferenceSwitcher.VS22/NuGetReferenceSwitcher.vsct new file mode 100644 index 0000000..d689748 --- /dev/null +++ b/src/NuGetReferenceSwitcher.VS22/NuGetReferenceSwitcher.vsct @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/NuGetReferenceSwitcher.VS22/NuGetReferenceSwitcherPackage.cs b/src/NuGetReferenceSwitcher.VS22/NuGetReferenceSwitcherPackage.cs new file mode 100644 index 0000000..c89570c --- /dev/null +++ b/src/NuGetReferenceSwitcher.VS22/NuGetReferenceSwitcherPackage.cs @@ -0,0 +1,71 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Rico Suter. All rights reserved. +// +// http://nugetreferenceswitcher.codeplex.com/license +// Rico Suter, mail@rsuter.com +//----------------------------------------------------------------------- + +using EnvDTE; +using EnvDTE80; +using Microsoft.VisualStudio.Shell; +using Microsoft.VisualStudio.Shell.Interop; +using NuGetReferenceSwitcher.Presentation.Views; +using System; +using System.ComponentModel.Design; +using System.Linq; +using System.Runtime.InteropServices; +using System.Windows; +using System.Windows.Interop; + +namespace RicoSuter.NuGetReferenceSwitcher +{ + [PackageRegistration(UseManagedResourcesOnly = true)] + [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)] + [ProvideMenuResource("Menus.ctmenu", 1)] + [Guid(GuidList.guidNuGetReferenceSwitcherPkgString)] + public sealed class NuGetReferenceSwitcherPackage : Package + { + protected override void Initialize() + { + base.Initialize(); + + var mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService; + if (null != mcs) + { + var menuCommandId = new CommandID(GuidList.guidNuGetReferenceSwitcherCmdSet, (int)PkgCmdIDList.cmdidSwitchNuGetAndProjectReferences); + var menuItem = new MenuCommand(OnShowDialog, menuCommandId); + mcs.AddCommand(menuItem); + } + } + + private void OnShowDialog(object sender, EventArgs e) + { + var application = (DTE2)GetService(typeof(SDTE)); + if (application.Solution == null || !application.Solution.IsOpen) + MessageBox.Show("Please open a solution first. ", "No solution"); + else + { + if (application.Solution.IsDirty) // solution must be saved otherwise adding/removing projects will raise errors + { + MessageBox.Show("Please save your solution first. \n" + + "Select the solution in the Solution Explorer and press Ctrl-S. ", + "Solution not saved"); + } + else if (application.Solution.Projects.OfType().Any(p => p.IsDirty)) + { + MessageBox.Show("Please save your projects first. \n" + + "Select the project in the Solution Explorer and press Ctrl-S. ", + "Project not saved"); + } + else + { + var window = new MainDialog(application, GetType().Assembly); + var helper = new WindowInteropHelper(window); + helper.Owner = (IntPtr)application.MainWindow.HWnd; + window.ShowModal(); + } + } + } + } +} \ No newline at end of file diff --git a/src/NuGetReferenceSwitcher.VS22/PkgCmdID.cs b/src/NuGetReferenceSwitcher.VS22/PkgCmdID.cs new file mode 100644 index 0000000..25bb133 --- /dev/null +++ b/src/NuGetReferenceSwitcher.VS22/PkgCmdID.cs @@ -0,0 +1,12 @@ +// PkgCmdID.cs +// MUST match PkgCmdID.h + +namespace RicoSuter.NuGetReferenceSwitcher +{ + static class PkgCmdIDList + { + public const uint cmdidSwitchNuGetAndProjectReferences = 0x100; + + + }; +} \ No newline at end of file diff --git a/src/NuGetReferenceSwitcher.VS22/Properties/AssemblyInfo.cs b/src/NuGetReferenceSwitcher.VS22/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..cb68f08 --- /dev/null +++ b/src/NuGetReferenceSwitcher.VS22/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +using System; +using System.Reflection; +using System.Resources; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("NuGetReferenceSwitcher")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Rico Suter")] +[assembly: AssemblyProduct("NuGetReferenceSwitcher")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: ComVisible(false)] +[assembly: CLSCompliant(false)] +[assembly: NeutralResourcesLanguage("en-US")] + +[assembly: AssemblyVersion("1.9.*")] diff --git a/src/NuGetReferenceSwitcher.VS22/Resources.Designer.cs b/src/NuGetReferenceSwitcher.VS22/Resources.Designer.cs new file mode 100644 index 0000000..132edf7 --- /dev/null +++ b/src/NuGetReferenceSwitcher.VS22/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace RicoSuter.NuGetReferenceSwitcher { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // 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", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RicoSuter.NuGetReferenceSwitcher.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/src/NuGetReferenceSwitcher.VS22/Resources.resx b/src/NuGetReferenceSwitcher.VS22/Resources.resx new file mode 100644 index 0000000..891c592 --- /dev/null +++ b/src/NuGetReferenceSwitcher.VS22/Resources.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/NuGetReferenceSwitcher.VS22/Resources/Images.png b/src/NuGetReferenceSwitcher.VS22/Resources/Images.png new file mode 100644 index 0000000..bf17e6b Binary files /dev/null and b/src/NuGetReferenceSwitcher.VS22/Resources/Images.png differ diff --git a/src/NuGetReferenceSwitcher.VS22/Resources/Package.ico b/src/NuGetReferenceSwitcher.VS22/Resources/Package.ico new file mode 100644 index 0000000..449296f Binary files /dev/null and b/src/NuGetReferenceSwitcher.VS22/Resources/Package.ico differ diff --git a/src/NuGetReferenceSwitcher.VS22/VSPackage.resx b/src/NuGetReferenceSwitcher.VS22/VSPackage.resx new file mode 100644 index 0000000..1e3f16d --- /dev/null +++ b/src/NuGetReferenceSwitcher.VS22/VSPackage.resx @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + NuGetReferenceSwitcher + + + Information about my package + + + 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/src/NuGetReferenceSwitcher.VS22/packages.config b/src/NuGetReferenceSwitcher.VS22/packages.config new file mode 100644 index 0000000..e567a3d --- /dev/null +++ b/src/NuGetReferenceSwitcher.VS22/packages.config @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/NuGetReferenceSwitcher.VS22/source.extension.vsixmanifest b/src/NuGetReferenceSwitcher.VS22/source.extension.vsixmanifest new file mode 100644 index 0000000..4ef3414 --- /dev/null +++ b/src/NuGetReferenceSwitcher.VS22/source.extension.vsixmanifest @@ -0,0 +1,32 @@ + + + + + NuGet Reference Switcher for Visual Studio 2022 + Visual Studio extension which automatically switches NuGet assembly references to project references and vice-versa. This is useful when developing applications which reference own NuGet packages: When developing an application, switch to project references so that all code is editable and debuggable. After finishing the development, create new NuGet package versions, switch back to NuGet references and upgrade to the new NuGet versions. + https://nugetreferenceswitcher.codeplex.com + Deployment, NuGet, Dependency management + + + + amd64 + + + amd64 + + + + + + + + + + + + \ No newline at end of file