Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build #77

Merged
merged 4 commits into from
Jun 16, 2024
Merged
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
2 changes: 2 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
6.0.423
7.0.120
8.0.302
- name: Restore dependencies
run: dir "C:\Program Files\dotnet\\shared\Microsoft.WindowsDesktop.App\"
- name: Restore dependencies
run: dotnet restore WinFormsComInterop.Build.sln
- name: Build
Expand Down
22 changes: 13 additions & 9 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
<Project>
<PropertyGroup>
<DotnetInstallLocation>C:\Program Files\dotnet</DotnetInstallLocation>
<DotnetInstallLocation Condition="$(NetCoreRoot) == ''">C:\Program Files\dotnet\</DotnetInstallLocation>
<DotnetInstallLocation Condition="$(NetCoreRoot) != ''">$(NetCoreRoot)</DotnetInstallLocation>
<AccessibilityLocation Condition="$(TargetFramework) == 'net8.0'">$(DotnetInstallLocation)shared\Microsoft.WindowsDesktop.App\8.0.6\Accessibility.dll</AccessibilityLocation>
<AccessibilityLocation Condition="$(TargetFramework) == 'net7.0'">$(DotnetInstallLocation)shared\Microsoft.WindowsDesktop.App\7.0.20\Accessibility.dll</AccessibilityLocation>
<AccessibilityLocation Condition="$(TargetFramework) == 'net6.0'">$(DotnetInstallLocation)shared\Microsoft.WindowsDesktop.App\6.0.31\Accessibility.dll</AccessibilityLocation>
</PropertyGroup>
<ItemGroup>
<Reference Update="Accessibility" Condition="$(TargetFramework) == 'net8.0'">
<HintPath>$(DotnetInstallLocation)\shared\Microsoft.WindowsDesktop.App\8.0.6\Accessibility.dll</HintPath>
</Reference>
<Reference Update="Accessibility" Condition="$(TargetFramework) == 'net7.0'">
<HintPath>$(DotnetInstallLocation)\shared\Microsoft.WindowsDesktop.App\7.0.20\Accessibility.dll</HintPath>
</Reference>
<Reference Update="Accessibility" Condition="$(TargetFramework) == 'net6.0'">
<HintPath>$(DotnetInstallLocation)\shared\Microsoft.WindowsDesktop.App\6.0.27\Accessibility.dll</HintPath>
<Reference Update="Accessibility" Condition="($(TargetFramework) == 'net8.0') or ($(TargetFramework) == 'net7.0') or ($(TargetFramework) == 'net6.0')">
<HintPath>$(AccessibilityLocation)</HintPath>
</Reference>
</ItemGroup>
<Target Name="CustomClean" BeforeTargets="CoreBuild">
<Error Text="Accessibility does not exists in location $(AccessibilityLocation)'" Condition="($(TargetFramework) == 'net8.0') and (!Exists('$(AccessibilityLocation)'))" />
<Error Text="Accessibility does not exists in location $(AccessibilityLocation)'" Condition="($(TargetFramework) == 'net7.0') and (!Exists('$(AccessibilityLocation)'))" />
<Error Text="Accessibility does not exists in location $(AccessibilityLocation)'" Condition="($(TargetFramework) == 'net6.0') and (!Exists('$(AccessibilityLocation)'))" />
</Target>

</Project>
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.302",
"version": "8.0.200",
"allowPrerelease": true,
"rollForward": "major"
}
Expand Down
Loading