Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ Replace your entire `.csproj` file with the SDK-style format:

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.*" />
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.*" PrivateAssets="all" />
</ItemGroup>

</Project>
Expand Down Expand Up @@ -138,11 +137,12 @@ Convert from `packages.config` to `PackageReference` format in your `.csproj`:
```xml
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.*" />
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.*" PrivateAssets="all" />
<!-- Add other packages your extension uses -->
</ItemGroup>
```

> **Note:** `Microsoft.VSSDK.BuildTools` is automatically included by the SDK.

#### Step 6: Handle VSCT Files

If you have `.vsct` files, they're automatically included. Remove any explicit `<VSCTCompile>` items unless you need custom metadata.
Expand Down Expand Up @@ -182,7 +182,6 @@ If you prefer to set up manually, create a `.csproj` file:

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.*" />
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.*" PrivateAssets="all" />
</ItemGroup>

</Project>
Expand Down
12 changes: 12 additions & 0 deletions src/CodingWithCalvin.VsixSdk/Sdk/Sdk.Vsix.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@
Condition="Exists('$(MSBuildThisFileDirectory)..\analyzers\dotnet\cs\CodingWithCalvin.VsixSdk.Generators.dll')" />
</ItemGroup>

<!--
Implicit package references for VSIX development.
Users can override the version by setting VssdkBuildToolsVersion before SDK import.
-->
<PropertyGroup>
<VssdkBuildToolsVersion Condition="'$(VssdkBuildToolsVersion)' == ''">17.*</VssdkBuildToolsVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="$(VssdkBuildToolsVersion)" PrivateAssets="all" />
</ItemGroup>

<PropertyGroup>
<!-- Identify that this SDK is in use -->
<UsingCodingWithCalvinVsixSdk>true</UsingCodingWithCalvinVsixSdk>
Expand Down
29 changes: 29 additions & 0 deletions src/CodingWithCalvin.VsixSdk/Sdk/Sdk.Vsix.targets
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,35 @@
Text="No .vsixmanifest file found. VSIX projects require a manifest file." />
</Target>

<!--
Generate launchSettings.json for F5 debugging
Only runs when building inside Visual Studio and the file doesn't exist
This configures VS to launch devenv.exe with the experimental instance
-->
<Target Name="GenerateLaunchSettings"
BeforeTargets="BeforeBuild"
Condition="'$(BuildingInsideVisualStudio)' == 'true' and '$(DevEnvDir)' != '' and !Exists('$(MSBuildProjectDirectory)\Properties\launchSettings.json')">

<PropertyGroup>
<_LaunchSettingsContent><![CDATA[{
"profiles": {
"Start Experimental Instance": {
"commandName": "Executable",
"executablePath": "$(DevEnvDir)devenv.exe",
"commandLineArgs": "/rootSuffix Exp"
}
}
}]]></_LaunchSettingsContent>
</PropertyGroup>

<MakeDir Directories="$(MSBuildProjectDirectory)\Properties" Condition="!Exists('$(MSBuildProjectDirectory)\Properties')" />
<WriteLinesToFile File="$(MSBuildProjectDirectory)\Properties\launchSettings.json"
Lines="$(_LaunchSettingsContent)"
Overwrite="true" />

<Message Importance="high" Text="Generated Properties/launchSettings.json for F5 debugging" />
</Target>

<!--
Import VSSDK targets if available
This is the key integration point with Microsoft.VSSDK.BuildTools
Expand Down