Skip to content
Open
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
9 changes: 8 additions & 1 deletion .azuredevops/pipelines/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ stages:
feedsToUse: select
restoreArguments: --locked-mode

- task: GetAzureAuthToken@5
name: KeyVaultToken
displayName: Get token to code signing certificate
inputs:
ServiceConnection: Code signer
AccessScopes: https://vault.azure.net/.default

- task: DotNetCoreCLI@2
displayName: Build
inputs:
Expand All @@ -58,7 +65,7 @@ stages:
configuration: ${{ variables.Configuration }}
arguments: --no-restore
env:
AuthenticodeClientSecret: $(AuthenticodeClientSecret)
AuthenticodeAccessToken: $(KeyVaultToken.AuthToken)
# Roll-forward behavior set for AzureSignTool dotnet tool (see .config\dotnet-tools.json) which requires .Net 6.0 runtime
DOTNET_ROLL_FORWARD: Major

Expand Down
1 change: 0 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<NoWarn>$(NoWarn);S101;S1121</NoWarn>

<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

The TimestampServerUrl property is being removed here, but it is still referenced in Directory.build.targets line 12. This will cause the code signing command to fail because $(TimestampServerUrl) will be undefined. The variable needs to either remain defined in Directory.Build.props, be added to the Azure DevOps pipeline variable group "Code Sign KV Auth", or be passed as an environment variable in the build task.

Suggested change
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
<TimestampServerUrl Condition=" '$(TimestampServerUrl)' == '' ">http://timestamp.digicert.com</TimestampServerUrl>

Copilot uses AI. Check for mistakes.
<TimestampServerUrl>http://timestamp.digicert.com</TimestampServerUrl>
</PropertyGroup>

<PropertyGroup Condition=" $(Configuration) == 'Release' ">
Expand Down
4 changes: 2 additions & 2 deletions Directory.build.targets
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<Target Name="SignAssemblyWithAuthenticodeSignature" AfterTargets="AfterBuild" Condition="'$(MSBuildProjectFullPath.Contains(&quot;node_modules&quot;))' == 'false' And $(Configuration) == 'Release' And $(SIGN_FILE) != 'false'">
<Target Name="SignAssemblyWithAuthenticodeSignature" AfterTargets="AfterBuild" Condition="'$(MSBuildProjectFullPath.Contains(&quot;node_modules&quot;))' == 'false' And $(Configuration) == 'Release' And $(SIGN_FILE) == 'true'">
<PropertyGroup>
<XmlSerializersTargetPath>$(TargetDir)$(TargetName).XmlSerializers.dll</XmlSerializersTargetPath>
</PropertyGroup>
Expand All @@ -9,6 +9,6 @@
<AssemblyToSign Include="$(XmlSerializersTargetPath)" Condition="Exists('$(XmlSerializersTargetPath)')" />
</ItemGroup>

<Exec Command="dotnet AzureSignTool sign --azure-key-vault-url $(AuthenticodeKeyVaultUrl) --azure-key-vault-tenant-id $(AuthenticodeTenantId) --azure-key-vault-client-id $(AuthenticodeClientId) --azure-key-vault-client-secret $(AuthenticodeClientSecret) --azure-key-vault-certificate $(AuthenticodeCertificateName) --timestamp-rfc3161 $(TimestampServerUrl) --skip-signed %(AssemblyToSign.Identity)" />
<Exec Command="dotnet AzureSignTool sign --azure-key-vault-url $(AuthenticodeKeyVaultUrl) --azure-key-vault-accesstoken $(AuthenticodeAccessToken) --azure-key-vault-certificate $(AuthenticodeCertificateName) --timestamp-rfc3161 $(TimestampServerUrl) --skip-signed %(AssemblyToSign.Identity)" />
</Target>
</Project>
Loading