Import Microsoft.VsSDK.targets conditionally#43343
Conversation
VSToolsPath might not be initialized during restore.
|
|
||
| <Import Project="$(VSToolsPath)\vssdk\Microsoft.VsSDK.targets"/> | ||
| <Import Project="$(VSToolsPath)\vssdk\Microsoft.VsSDK.targets" | ||
| Condition="Exists('$(VSToolsPath)\vssdk\Microsoft.VsSDK.targets') and '$(DesignTimeBuild)' != 'true' and '$(BuildingForLiveUnitTesting)' != 'true'"/> |
There was a problem hiding this comment.
😕 Why not just the Exists check?
There was a problem hiding this comment.
We don't need to do any of the work that is implemented in the targets during design time build.
There was a problem hiding this comment.
I would expect the VSSDK targets themselves to avoid doing unnecessary work during DTB. Is this not the case?
There was a problem hiding this comment.
Unfortunately, they do not. Microsoft.VsSDK.targets add following unconditionally:
<PrepareForRunDependsOn>
$(PrepareForRunDependsOn);
GeneratePkgDef;
CopyPkgDef;
CreateVsixContainer;
DeployVsixExtensionFiles;
CopyVsixManifestFile;
CopyVsixExtensionFiles;
</PrepareForRunDependsOn>There was a problem hiding this comment.
DTB does not do a PrepareForRun.
There was a problem hiding this comment.
Please tell me DTB does not do PrepareForRun. That would be bad.
There was a problem hiding this comment.
VSSDK is doing something during design time build: https://dev.azure.com/devdiv/DevDiv/_workitems/edit/365685?fullScreen=false
There was a problem hiding this comment.
You are right. DTB doesn't run PrepareForRun, only PrepareForBuild. I guess there are other ways VSSDK is hooking into the build.
|
@tmat Is there a bug we need to file against the SDK here? |
|
@jasonmalinowski No bug. I'll send a PR to remove the unnecessary conditions here. |
|
@tmat @jasonmalinowski Sent #43444 |
VSToolsPath might not be initialized during restore.