Skip to content

Commit 35a1776

Browse files
authored
Update StabilityMatrix.Native.csproj
In the .csproj file, the expression of $([System.Runtime.InteropServices.RuntimeInformation]...) is not a directly supported MSBuild expression. MSBuild does not support calling runtime APIs directly in <PropertyGroup>. This results in the inability to directly debug or run the StabilityMatrix.Avalonia project after opening the project with VisualStudio. Should be replaced by a RuntimeIdentifier based condition, for example: <PropertyGroup Condition="'$(RuntimeIdentifier)' == 'win-x64'"> <IsWindows>true</IsWindows> </PropertyGroup> <PropertyGroup Condition="'$(RuntimeIdentifier)' == 'osx-x64' Or '$(RuntimeIdentifier)' == 'osx-arm64'"> <IsOSX>true</IsOSX> </PropertyGroup> <PropertyGroup Condition="'$(RuntimeIdentifier)' == 'linux-x64'"> <IsLinux>true</IsLinux> </PropertyGroup>
1 parent 25d648b commit 35a1776

File tree

1 file changed

+32
-31
lines changed

1 file changed

+32
-31
lines changed
Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
5-
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64;osx-arm64</RuntimeIdentifiers>
6-
<ImplicitUsings>enable</ImplicitUsings>
7-
<Nullable>enable</Nullable>
8-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64;osx-arm64</RuntimeIdentifiers>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<PlatformTarget>AnyCPU</PlatformTarget>
9+
</PropertyGroup>
910

10-
<PropertyGroup>
11-
<IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">true</IsWindows>
12-
<IsOSX Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">true</IsOSX>
13-
<IsLinux Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">true</IsLinux>
14-
</PropertyGroup>
11+
<PropertyGroup Condition="'$(RuntimeIdentifier)' == 'win-x64'">
12+
<DefineConstants>Windows</DefineConstants>
13+
<IsWindows>true</IsWindows>
14+
</PropertyGroup>
15+
<PropertyGroup Condition="'$(RuntimeIdentifier)' == 'osx-x64' Or '$(RuntimeIdentifier)' == 'osx-arm64'">
16+
<DefineConstants>OSX</DefineConstants>
17+
<IsOSX>true</IsOSX>
18+
</PropertyGroup>
19+
<PropertyGroup Condition="'$(RuntimeIdentifier)' == 'linux-x64'">
20+
<DefineConstants>Linux</DefineConstants>
21+
<IsLinux>true</IsLinux>
22+
</PropertyGroup>
1523

16-
<PropertyGroup Condition="'$(IsWindows)'=='true'">
17-
<DefineConstants>Windows</DefineConstants>
18-
</PropertyGroup>
19-
<PropertyGroup Condition="'$(IsOSX)'=='true'">
20-
<DefineConstants>OSX</DefineConstants>
21-
</PropertyGroup>
22-
<PropertyGroup Condition="'$(IsLinux)'=='true'">
23-
<DefineConstants>Linux</DefineConstants>
24-
</PropertyGroup>
24+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
25+
<Optimize>false</Optimize>
26+
</PropertyGroup>
2527

26-
<ItemGroup>
27-
<ProjectReference Include="..\StabilityMatrix.Native.Abstractions\StabilityMatrix.Native.Abstractions.csproj" />
28-
</ItemGroup>
29-
30-
<ItemGroup Condition="'$(RuntimeIdentifier)' == 'win-x64'">
31-
<ProjectReference Include="..\StabilityMatrix.Native.Windows\StabilityMatrix.Native.Windows.csproj" />
32-
</ItemGroup>
33-
<ItemGroup Condition="'$(RuntimeIdentifier)' == 'osx-x64' Or '$(RuntimeIdentifier)' == 'osx-arm64'">
34-
<ProjectReference Include="..\StabilityMatrix.Native.macOS\StabilityMatrix.Native.macOS.csproj" />
35-
</ItemGroup>
28+
<ItemGroup>
29+
<ProjectReference Include="..\StabilityMatrix.Native.Abstractions\StabilityMatrix.Native.Abstractions.csproj" />
30+
</ItemGroup>
3631

32+
<ItemGroup Condition="'$(RuntimeIdentifier)' == 'win-x64'">
33+
<ProjectReference Include="..\StabilityMatrix.Native.Windows\StabilityMatrix.Native.Windows.csproj" />
34+
</ItemGroup>
35+
<ItemGroup Condition="'$(RuntimeIdentifier)' == 'osx-x64' Or '$(RuntimeIdentifier)' == 'osx-arm64'">
36+
<ProjectReference Include="..\StabilityMatrix.Native.macOS\StabilityMatrix.Native.macOS.csproj" />
37+
</ItemGroup>
3738
</Project>

0 commit comments

Comments
 (0)