From 63a87bfd893209fba856f4c2300760f1174698a4 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 11 Mar 2025 09:52:30 -0600 Subject: [PATCH] Create a `Microsoft.VisualStudio.Threading.Only` package This new package has the library, but no analyzers dependency. The analyzers dependency is retained by the original `Microsoft.VisualStudio.Threading` package, along with a new dependency on the `Microsoft.VisualStudio.Threading.Only` package. This allows consumers like StreamJsonRpc to express a dependency on `Microsoft.VisualStudio.Threading.Only` instead of `Microsoft.VisualStudio.Threading` in order to prevent its downstream users from having threading analyzers applied automatically, which they may not want. --- Microsoft.VisualStudio.Threading.sln | 11 ++++++++++ src/LibraryNuspecProperties.props | 12 +++++++++++ ...VisualStudio.Threading.JointPackage.csproj | 19 +++++++++++++++++ .../Microsoft.VisualStudio.Threading.csproj | 21 ++++++------------- 4 files changed, 48 insertions(+), 15 deletions(-) create mode 100644 src/LibraryNuspecProperties.props create mode 100644 src/Microsoft.VisualStudio.Threading.JointPackage/Microsoft.VisualStudio.Threading.JointPackage.csproj diff --git a/Microsoft.VisualStudio.Threading.sln b/Microsoft.VisualStudio.Threading.sln index aab07fca4..57ec45323 100644 --- a/Microsoft.VisualStudio.Threading.sln +++ b/Microsoft.VisualStudio.Threading.sln @@ -51,6 +51,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{C1DAF484-7 test\Directory.Build.targets = test\Directory.Build.targets EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.VisualStudio.Threading.JointPackage", "src\Microsoft.VisualStudio.Threading.JointPackage\Microsoft.VisualStudio.Threading.JointPackage.csproj", "{D149A8B3-A98F-4EDD-8C12-5CCDCBFB68DB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -137,6 +139,14 @@ Global {8CDF7526-D625-4E16-A266-BAF654ABE181}.Release|Any CPU.Build.0 = Release|Any CPU {8CDF7526-D625-4E16-A266-BAF654ABE181}.Release|NonWindows.ActiveCfg = Release|Any CPU {8CDF7526-D625-4E16-A266-BAF654ABE181}.Release|NonWindows.Build.0 = Release|Any CPU + {D149A8B3-A98F-4EDD-8C12-5CCDCBFB68DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D149A8B3-A98F-4EDD-8C12-5CCDCBFB68DB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D149A8B3-A98F-4EDD-8C12-5CCDCBFB68DB}.Debug|NonWindows.ActiveCfg = Debug|Any CPU + {D149A8B3-A98F-4EDD-8C12-5CCDCBFB68DB}.Debug|NonWindows.Build.0 = Debug|Any CPU + {D149A8B3-A98F-4EDD-8C12-5CCDCBFB68DB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D149A8B3-A98F-4EDD-8C12-5CCDCBFB68DB}.Release|Any CPU.Build.0 = Release|Any CPU + {D149A8B3-A98F-4EDD-8C12-5CCDCBFB68DB}.Release|NonWindows.ActiveCfg = Release|Any CPU + {D149A8B3-A98F-4EDD-8C12-5CCDCBFB68DB}.Release|NonWindows.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -152,6 +162,7 @@ Global {7177DEEE-D14D-4A4A-BF6E-8B0CDC26B624} = {96134B19-FB32-4FA0-A565-BD4247D1E5B2} {D5A0D627-7853-43F5-9AF4-E23D062C6ABA} = {96134B19-FB32-4FA0-A565-BD4247D1E5B2} {8CDF7526-D625-4E16-A266-BAF654ABE181} = {96134B19-FB32-4FA0-A565-BD4247D1E5B2} + {D149A8B3-A98F-4EDD-8C12-5CCDCBFB68DB} = {96134B19-FB32-4FA0-A565-BD4247D1E5B2} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {E2124DFF-970E-4BA1-9E50-3ADB0AABF347} diff --git a/src/LibraryNuspecProperties.props b/src/LibraryNuspecProperties.props new file mode 100644 index 000000000..51565ee53 --- /dev/null +++ b/src/LibraryNuspecProperties.props @@ -0,0 +1,12 @@ + + + netstandard2.0;net8.0;net472 + $(TargetFrameworks);net8.0-windows + + Async synchronization primitives, async collections, TPL and dataflow extensions. + The JoinableTaskFactory allows synchronously blocking the UI thread for async work. This + package is applicable to any .NET application (not just Visual Studio). + + Threading Async Lock Synchronization Threadsafe + + diff --git a/src/Microsoft.VisualStudio.Threading.JointPackage/Microsoft.VisualStudio.Threading.JointPackage.csproj b/src/Microsoft.VisualStudio.Threading.JointPackage/Microsoft.VisualStudio.Threading.JointPackage.csproj new file mode 100644 index 000000000..79f6b8825 --- /dev/null +++ b/src/Microsoft.VisualStudio.Threading.JointPackage/Microsoft.VisualStudio.Threading.JointPackage.csproj @@ -0,0 +1,19 @@ + + + + Microsoft.VisualStudio.Threading + false + false + $(NoWarn);NU5128 + + + + + + + + + + + + diff --git a/src/Microsoft.VisualStudio.Threading/Microsoft.VisualStudio.Threading.csproj b/src/Microsoft.VisualStudio.Threading/Microsoft.VisualStudio.Threading.csproj index a83aa0770..3e5321d89 100644 --- a/src/Microsoft.VisualStudio.Threading/Microsoft.VisualStudio.Threading.csproj +++ b/src/Microsoft.VisualStudio.Threading/Microsoft.VisualStudio.Threading.csproj @@ -1,17 +1,14 @@  + - netstandard2.0;net8.0;net472 - - Async synchronization primitives, async collections, TPL and dataflow extensions. - Async synchronization primitives, async collections, TPL and dataflow extensions. - The JoinableTaskFactory allows synchronously blocking the UI thread for async work. This - package is applicable to any .NET application (not just Visual Studio). - Threading Async Lock Synchronization Threadsafe - + Microsoft.VisualStudio.Threading.Only + $(Description) + This package contains only the library, without a dependency on the analyzers. + Use the Microsoft.VisualStudio.Threading package to get the library and analyzers together. + true - $(TargetFrameworks);net8.0-windows true @@ -34,11 +31,5 @@ - - - -