-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update component debugger to work for VS 2022 (#896)
Update the component debugger to work in the new launch profiles format introduced in VS2022. See https://github.com/dotnet/project-system/blob/main/docs/repo/property-pages/how-to-add-a-new-launch-profile-kind.md for reference. Removes the old user control, and writing code which is now handled by the rule file (ComponentDebuggerLaunchProfile.xaml). Adds rule exporting and ProvideCodeBase so that VS can find the rule and apply it to matching projects. Tested on VS2022 using an existing launchsettings.json and confirmed projects show the new UI, and can add/remove as needed
- Loading branch information
Showing
29 changed files
with
648 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/VisualStudio.Roslyn.SDK/AssemblyVersionGenerator/AssemblyVersionGenerator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Diagnostics; | ||
using Microsoft.CodeAnalysis; | ||
|
||
namespace AssemblyVersionGenerator | ||
{ | ||
[Generator] | ||
public class AssemblyVersionGenerator : ISourceGenerator | ||
{ | ||
public void Execute(GeneratorExecutionContext context) | ||
{ | ||
context.AddSource("assemblyversion.g.cs", $@" | ||
internal class AssemblyVersion | ||
{{ | ||
public const string Version = ""{context.Compilation.Assembly.Identity.Version}""; | ||
}}"); | ||
} | ||
|
||
public void Initialize(GeneratorInitializationContext context) | ||
{ | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/VisualStudio.Roslyn.SDK/AssemblyVersionGenerator/AssemblyVersionGenerator.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<IsRoslynComponent>true</IsRoslynComponent> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="$(MicrosoftCodeAnalysisCommonVersion)" /> | ||
</ItemGroup> | ||
|
||
</Project> |
43 changes: 43 additions & 0 deletions
43
src/VisualStudio.Roslyn.SDK/ComponentDebugger/ComponentDebuggerLaunchProfile.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<Rule Name="ComponentDebuggerLaunchProfile" | ||
Description="Allows a user to debug a Roslyn Component by running it in the context of another projects build." | ||
DisplayName="Roslyn Component" | ||
PageTemplate="commandNameBasedDebugger" | ||
xmlns:sys="clr-namespace:System;assembly=mscorlib" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns="http://schemas.microsoft.com/build/2009/properties"> | ||
|
||
<Rule.Metadata> | ||
<sys:String x:Key="CommandName">DebugRoslynComponent</sys:String> | ||
|
||
<!-- KnownImageIds.ImageCatalogGuid --> | ||
<sys:Guid x:Key="ImageMonikerGuid">AE27A6B0-E345-4288-96DF-5EAF394EE369</sys:Guid> | ||
|
||
<!-- KnownImageIds.Execute --> | ||
<sys:Int32 x:Key="ImageMonikerId">3644</sys:Int32> | ||
</Rule.Metadata> | ||
|
||
<Rule.DataSource> | ||
<DataSource Persistence="LaunchProfile" | ||
HasConfigurationCondition="False" | ||
ItemType="LaunchProfile"/> | ||
</Rule.DataSource> | ||
|
||
<DynamicEnumProperty Name="targetProject" | ||
DisplayName="Target Project" | ||
Description="A project that uses this component, whose compilation will be debugged." | ||
EnumProvider="TargetProjectEnumProvider" /> | ||
|
||
<StringProperty Name="Description" | ||
Description="A Roslyn Component can be debugged in the context of compiling a second project that uses it. Ensure your target project is referencing this component for it to appear in the list."> | ||
<StringProperty.DataSource> | ||
<DataSource PersistedName="Description" | ||
Persistence="ProjectFileWithInterception" | ||
HasConfigurationCondition="False" /> | ||
</StringProperty.DataSource> | ||
<StringProperty.ValueEditors> | ||
<ValueEditor EditorType="Description" /> | ||
</StringProperty.ValueEditors> | ||
</StringProperty> | ||
|
||
</Rule> |
19 changes: 0 additions & 19 deletions
19
src/VisualStudio.Roslyn.SDK/ComponentDebugger/DebuggerOptions.xaml
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
src/VisualStudio.Roslyn.SDK/ComponentDebugger/DebuggerOptions.xaml.cs
This file was deleted.
Oops, something went wrong.
61 changes: 0 additions & 61 deletions
61
src/VisualStudio.Roslyn.SDK/ComponentDebugger/DebuggerOptionsViewModel.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 0 additions & 101 deletions
101
src/VisualStudio.Roslyn.SDK/ComponentDebugger/LaunchSettingsProvider.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.