Skip to content

Commit 9620905

Browse files
committed
Add file for strong naming assembly
If you use `sn -T` on the version 1.3.0 RabbitMQ dll, you get this: ``` lib\net6.0> sn -T .\RabbitMQ.Stream.Client.dll Microsoft (R) .NET Framework Strong Name Utility Version 4.0.30319.0 Copyright (c) Microsoft Corporation. All rights reserved. .\RabbitMQ.Stream.Client.dll does not represent a strongly named assembly ``` Actually do the signing correctly. Thanks for double-checking @Zerpet Add `AltCoverStrongNameKey` to fix builds using AltCover
1 parent 502d27d commit 9620905

File tree

6 files changed

+10
-8
lines changed

6 files changed

+10
-8
lines changed

.github/workflows/build-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ jobs:
7979
- name: Verify
8080
run: dotnet format ./rabbitmq-stream-dotnet-client.sln --no-restore --verbosity=diagnostic --verify-no-changes
8181
- name: Test
82-
run: dotnet test ./Build.csproj --no-build --logger "console;verbosity=detailed" /p:AltCover=true
82+
run: dotnet test ./Build.csproj --no-build --logger "console;verbosity=detailed" /p:AltCover=true /p:AltCoverStrongNameKey=${{github.workspace}}/rabbit.snk
8383
- name: Upload code coverage to Codecov
8484
run: bash <(curl -s https://codecov.io/bash)

Directory.Build.targets

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<!-- vim: set ft=xml: -->
22
<Project>
3+
<PropertyGroup>
4+
<PublicKey>0024000004800000940000000602000000240000525341310004000001000100e5f75a5f3e8c9cf8151b55c3460da0f58823b3139dd0672f7aae5d875416c363cfdbee2d98a09ee53157213447a128893225a56871be16aba8aa57ac7ceb7824f03131c7c9028a8050660652b26ab7568eaeebf022948e496e00e35e01e5f56d67351278ec90b6c0bfc965610281e7bdf25b0c9e625fdde89f2ed5f3f5757bbc</PublicKey>
5+
<TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
6+
</PropertyGroup>
37
<ItemGroup>
48
<EmbeddedFiles Include="$(GeneratedAssemblyInfoFile)"/>
59
</ItemGroup>

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build:
77
dotnet build $(CURDIR)/Build.csproj
88

99
test: build
10-
dotnet test -c Debug $(CURDIR)/Tests/Tests.csproj --no-build --logger:"console;verbosity=detailed" /p:AltCover=true
10+
dotnet test --configuration Debug $(CURDIR)/Tests/Tests.csproj --no-build --logger:"console;verbosity=detailed" /p:AltCover=true /p:AltCoverStrongNameKey=$(CURDIR)/rabbit.snk
1111

1212
rabbitmq-server:
1313
docker run -it --rm --name rabbitmq-stream-docker \

RabbitMQ.Stream.Client/RabbitMQ.Stream.Client.csproj

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<PackageLicenseFile>LICENSE</PackageLicenseFile>
1717
<PackageOutputPath>..\packages</PackageOutputPath>
1818
<RootNamespace>RabbitMQ.Stream.Client</RootNamespace>
19+
<SignAssembly>True</SignAssembly>
1920
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2021
<Title>RabbitMQ Stream Client Library for .NET</Title>
2122
<Copyright>Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term Broadcom refers to Broadcom Inc. and/or its subsidiaries.</Copyright>
@@ -28,12 +29,7 @@
2829
<None Remove="icon.png" />
2930
<Content Include="icon.png" PackagePath="icon.png" />
3031
<None Include="$(MSBuildThisFileDirectory)..\LICENSE" Pack="true" Visible="false" PackagePath="" />
31-
</ItemGroup>
32-
33-
<ItemGroup>
34-
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
35-
<_Parameter1>Tests</_Parameter1>
36-
</AssemblyAttribute>
32+
<InternalsVisibleTo Include="Tests" />
3733
</ItemGroup>
3834

3935
<ItemGroup>

Tests/Tests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4+
<AssemblyOriginatorKeyFile>../rabbit.snk</AssemblyOriginatorKeyFile>
45
<IsPackable>false</IsPackable>
56
<MinVerSkip>true</MinVerSkip>
67
<Copyright>Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term Broadcom refers to Broadcom Inc. and/or its subsidiaries.</Copyright>
78
<Authors>Broadcom</Authors>
89
<Company>Broadcom Inc. and/or its subsidiaries.</Company>
910
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
11+
<SignAssembly>True</SignAssembly>
1012
</PropertyGroup>
1113

1214
<ItemGroup>

rabbit.snk

596 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)