Skip to content

Commit 4441556

Browse files
authored
Added preprocessor directive so that the assembly internals are visib… (#6245)
…le to XenServerTest only when specified. Making the internals visible to a friend assembly works only if both assemblies are signed with a strong name or both unsigned. The code won't compile in scenarios where only the source code needs to be built and signed with a .snk key, therefore I'm suggesting using a preprocessor directive that can be switched on and off by the build caller (the other option is to put both source and test projects in a solution and build and sign both at all times, but at the moment I think we can go with the easy option).
2 parents 4207e23 + 8f374c7 commit 4441556

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

.github/workflows/generate-and-build-sdks.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ jobs:
168168
run: |
169169
dotnet test source/XenServerTest `
170170
--disable-build-servers `
171+
-p:DefineConstants=BUILD_FOR_TEST `
171172
--verbosity=normal
172173
173174
- name: Build C# SDK

ocaml/sdk-gen/csharp/autogen/src/Converters.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@
3636
using Newtonsoft.Json.Converters;
3737
using Newtonsoft.Json.Linq;
3838

39+
#if BUILD_FOR_TEST
3940
[assembly: InternalsVisibleTo("XenServerTest")]
41+
#endif
4042

4143
namespace XenAPI
4244
{

0 commit comments

Comments
 (0)