Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make the workload resolver only light up for the specific entrypoint SDKs we control #41268

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<ItemGroup>
<ManifestLines Include="&lt;SdkResolver&gt;" />
<ManifestLines Include="&lt;Path&gt;$(_TargetPathRelativePath)&lt;/Path&gt;" />
<ManifestLines Include="&lt;ResolvableSdkPattern&gt;Microsoft\..*|Samsung\..*|GtkSharp\..*|FSharp\.NET\.Sdk|NuGet\.Build\.Tasks\.Pack&lt;/ResolvableSdkPattern&gt;" />
<ManifestLines Include="&lt;/SdkResolver&gt;" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<SdkResolver>
<Path>..\..\Microsoft.DotNet.MSBuildSdkResolver.dll</Path>
<ResolvableSdkPattern>Microsoft\..*|Samsung\..*|GtkSharp\..*|FSharp\.NET\.Sdk|NuGet\.Build\.Tasks\.Pack</ResolvableSdkPattern>
</SdkResolver>
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<ItemGroup>
<ManifestLines Include="&lt;SdkResolver&gt;" />
<ManifestLines Include="&lt;Path&gt;$(_TargetPathRelativePath)&lt;/Path&gt;" />
<ManifestLines Include="&lt;ResolvableSdkPattern&gt;Microsoft\..*|Samsung\..*|GtkSharp\..*&lt;/ResolvableSdkPattern&gt;" />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the content from the xml, just replicated in this 'generation' step for the .NET framework version of this resolver.

<ManifestLines Include="&lt;/SdkResolver&gt;" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<SdkResolver>
<Path>..\..\Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.dll</Path>
<ResolvableSdkPattern>Microsoft\..*|Samsung\..*|GtkSharp\..*</ResolvableSdkPattern>
</SdkResolver>
1 change: 1 addition & 0 deletions src/VSMSBuildExtensions/VSMSBuildExtensions.proj
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<VSMSBuildExtensionsContent Include="$(ArtifactsBinDir)Microsoft.DotNet.MSBuildSdkResolver\$(Configuration)\net472\arm64\hostfxr.dll" DeploymentSubpath="MSBuildSdkResolver/arm64/" />
<VSMSBuildExtensionsContent Include="$(ArtifactsBinDir)Microsoft.DotNet.MSBuildSdkResolver\$(Configuration)\net472\**\Microsoft.Deployment.DotNet.Releases*.dll" DeploymentSubpath="MSBuildSdkResolver/" />
<VSMSBuildExtensionsContent Include="$(ArtifactsBinDir)Microsoft.DotNet.MSBuildSdkResolver\$(Configuration)\net472\**\Microsoft.DotNet.MSBuildSdkResolver*.dll" DeploymentSubpath="MSBuildSdkResolver/" />
<VSMSBuildExtensionsContent Include="$(ArtifactsBinDir)Microsoft.DotNet.MSBuildSdkResolver\$(Configuration)\net472\SdkResolvers\**\Microsoft.DotNet.MSBuildSdkResolver.xml" DeploymentSubpath="MSBuildSdkResolver/" />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joeloff I think this is the right place to add the generated resolver XML to ensure it gets added to the VSIX, but I don't know how to create/inspect the VSIX to verify. Any guidance I can follow here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The VSIX is just a zip, but it doesn't get produced in the SDK. We only generate the source (.swr file) and VS generates the actual zip, but if you do build -pack, you should end up with a file under artifacts\packages\Debug\NonShipping.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that's very helpful! I cracked open the SWR and found:

folder "InstallDir:\MSBuild\Current\Bin\SdkResolvers\Microsoft.DotNet.MSBuildSdkResolver\Microsoft.DotNet.MSBuildSdkResolver\"
  file source="$(PkgVS_Redist_Common_Net_Core_SDK_MSBuildExtensions)\MSBuildSdkResolver\Microsoft.DotNet.MSBuildSdkResolver\Microsoft.DotNet.MSBuildSdkResolver.xml"

That to me suggests that I have the layout incorrect because I believe the xml needs to be either adjacent to the dll, or in the SdkResolvers\<ResolverName>\<ResolverName>.xml layout pattern. So I'll need to go fix that.

That's validated by digging into the nupkg as well:
image

Here I can see that the directory structure is incorrect.


<VSMSBuildExtensionsContent Update="@(VSMSBuildExtensionsContent)">
<DestinationPath>$(OutputPath)/%(VSMSBuildExtensionsContent.DeploymentSubpath)%(RecursiveDir)%(Filename)%(Extension)</DestinationPath>
Expand Down
Loading