Skip to content

Commit 56ee24c

Browse files
authored
BuildTask mode should not generate types from InternalsVisibleTo referenced assemblies (#1492)
* Add tests and logic to fix internalsvisibleto * Add test for issue with SN signing and add fix.
1 parent 533aa1b commit 56ee24c

File tree

20 files changed

+209
-25
lines changed

20 files changed

+209
-25
lines changed

azure-pipelines/integration-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ jobs:
5151
- task: MSBuild@1
5252
displayName: 🧪 MSBuild buildtask-sdk-style
5353
inputs:
54-
solution: $(Pipeline.Workspace)\integration-tests\buildtask-sdk\buildtask-sdk.csproj
54+
solution: $(Pipeline.Workspace)\integration-tests\buildtask-sdk\buildtask-sdk.slnx
5555
msbuildArguments: /r
5656
condition: eq(variables.currentSdk, 'true')
57-
- pwsh: dotnet publish
57+
- pwsh: dotnet publish -r win-x64
5858
displayName: 🧪 dotnet publish
5959
workingDirectory: $(Pipeline.Workspace)\integration-tests\buildtask-sdk
6060
condition: eq(variables.currentSdk, 'true')

integration-tests/buildtask-sdk/NativeMethods.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

integration-tests/buildtask-sdk/NativeMethods.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

integration-tests/buildtask-sdk/Program.cs

Lines changed: 0 additions & 7 deletions
This file was deleted.
596 Bytes
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
GetTickCount
2+
GetForegroundWindow
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using Windows.Win32.Foundation;
2+
3+
class Program
4+
{
5+
static void Main(string[] args)
6+
{
7+
Windows.Win32.PInvoke.GetTickCount();
8+
9+
HWND hwnd = Windows.Win32.PInvoke.GetForegroundWindow();
10+
}
11+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net9.0-windows</TargetFramework>
6+
<LangVersion>9</LangVersion>
7+
<PublishAot>true</PublishAot>
8+
<CsWin32RunAsBuildTask>true</CsWin32RunAsBuildTask>
9+
<DisableRuntimeMarshalling>true</DisableRuntimeMarshalling>
10+
11+
<!-- Conflicting type warning as error -->
12+
<MSBuildWarningsAsErrors>$(MSBuildWarningsAsErrors);CS0436</MSBuildWarningsAsErrors>
13+
<SignAssembly>True</SignAssembly>
14+
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)..\TestKey.snk</AssemblyOriginatorKeyFile>
15+
</PropertyGroup>
16+
17+
<ItemGroup>
18+
<PackageReference Include="Microsoft.Windows.CsWin32" Version="$(NuGetPackageVersion)" />
19+
<PackageReference Include="System.Memory" Version="4.6.0" />
20+
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.0" />
21+
</ItemGroup>
22+
23+
<ItemGroup>
24+
<ProjectReference Include="..\dependency\buildtask-sdk-dependency.csproj" />
25+
</ItemGroup>
26+
27+
</Project>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<Solution>
2+
<Project Path="app/buildtask-sdk.csproj" />
3+
<Project Path="dependency/buildtask-sdk-dependency.csproj" />
4+
</Solution>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("buildtask-sdk, PublicKey=0024000004800000940000000602000000240000525341310004000001000100e5999fa77c961399a0969d58b6889d88b0abb6bc639762ae519e94deb639d9169db63d972d351368a893f82adc11ac9c520a945e8806aed1f06f5db55a458ec81365b40d7b940c35e8c285683646e4a632e436089f19c378bf9a27f201b32614be5bb3064f01c3b798856b39ecfb8229b497584254a1cd42fa9cd543fd6bc0c8")]

0 commit comments

Comments
 (0)