Skip to content
Open
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: 1 addition & 1 deletion Directory.Build.Override.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<_IncludeWindows></_IncludeWindows>
<_IncludeTizen></_IncludeTizen>
<_IncludeGtk>true</_IncludeGtk>
<_IncludeAndroid>true</_IncludeAndroid>
<_IncludeAndroid>false</_IncludeAndroid>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making this change may cause CI/CD to cease functioning.

Therefore, I believe it would be preferable either to modify the CI/CD setup accordingly

sed -i 's/_IncludeAndroid>true/_IncludeAndroid>/g' Directory.Build.Override.props

# .github/workflows/build-gtk.yml
- sed -i 's/_IncludeAndroid>true/_IncludeAndroid>/g' Directory.Build.Override.props 
+ sed -i 's/_IncludeAndroid>/_IncludeAndroid>/g' Directory.Build.Override.props

or revert this change.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok i changed it because VS 2022 would'nt like to install an old Android SDK or something

<_IncludeIos></_IncludeIos>
<_IncludeMacCatalyst></_IncludeMacCatalyst>
<_IncludeMacOS></_IncludeMacOS>
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
<_MauiBuildTasksLocation Condition="'$(_MauiBuildTasksLocation)' == ''">$(MSBuildThisFileDirectory).buildtasks\</_MauiBuildTasksLocation>
<_MauiAOTProfileLocation>$(MauiSrcDirectory)Controls\src\Build.Tasks\nuget\buildTransitive\netstandard2.0\</_MauiAOTProfileLocation>
<StrongNamerKeyFile>$(MauiRootDirectory)eng/microsoft.maui.controls.snk</StrongNamerKeyFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<DebugType>portable</DebugType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
Expand Down
3 changes: 3 additions & 0 deletions Microsoft.Maui.Gtk.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
"src\\BlazorWebView\\src\\Gtk\\Microsoft.AspNetCore.Components.WebView.Gtk.csproj",
"src\\BlazorWebView\\src\\Maui\\Microsoft.AspNetCore.Components.WebView.Maui.csproj",
"src\\Compatibility\\Core\\src\\Compatibility.csproj",
"src\\Controls\\Foldable\\src\\Controls.Foldable.csproj",
"src\\Controls\\Maps\\src\\Controls.Maps.csproj",
"src\\Controls\\samples\\Controls.Sample.Gtk\\Controls.Sample.Gtk.csproj",
"src\\Controls\\samples\\Controls.Sample\\Maui.Controls.Sample.csproj",
"src\\Controls\\src\\Build.Tasks\\Controls.Build.Tasks.csproj",
"src\\Controls\\src\\Core\\Controls.Core.csproj",
"src\\Controls\\src\\Xaml\\Controls.Xaml.csproj",
"src\\Core\\maps\\src\\Maps.csproj",
"src\\Core\\src\\Core.csproj",
"src\\Essentials\\src\\Essentials.csproj",
"src\\Graphics\\samples\\GraphicsTester.Gtk\\GraphicsTester.Gtk.csproj",
Expand Down
1 change: 1 addition & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" protocolVersion="3" />
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" protocolVersion="3" />
<add key="benchmark-dotnet-prerelease" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/benchmark-dotnet-prerelease/nuget/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<MicrosoftAspNetCoreMetadataPackageVersion>8.0.0</MicrosoftAspNetCoreMetadataPackageVersion>
<MicrosoftJSInteropPackageVersion>8.0.0</MicrosoftJSInteropPackageVersion>
<!-- Other packages -->
<MicrosoftCodeAnalysisNetAnalyzersVersion>8.0.0</MicrosoftCodeAnalysisNetAnalyzersVersion>
<MicrosoftCodeAnalysisNetAnalyzersVersion>9.0.0</MicrosoftCodeAnalysisNetAnalyzersVersion>
<MicrosoftCodeAnalysisPublicApiAnalyzersVersion>3.3.4</MicrosoftCodeAnalysisPublicApiAnalyzersVersion>
<MicrosoftCodeAnalysisBannedApiAnalyzersVersion>3.3.4</MicrosoftCodeAnalysisBannedApiAnalyzersVersion>
<SystemNumericsVectorsVersion>4.5.0</SystemNumericsVectorsVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(_MauiDotNetTfm);$(MauiPlatforms)</TargetFrameworks>
<TargetFrameworks>$(_MauiDotNetTfm)</TargetFrameworks>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason for deleting the platform?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like a mismatch from compiler, i can try to reproduce it and show you the error message

Copy link
Author

@TenEniunlsl TenEniunlsl Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Visual Studio i got messages like that
image

thats the Text, sry it's in German and everyone it's the same with another Project, you can scroll down there is one i have translated

Problem beim Projekt "Graphics.Skia" während des letzten Vorgangs: Der Wert der Eigenschaft "TargetFrameworks" ist zwischen Zielframeworks inkonsistent. Diese Eigenschaft muss identisch sein, damit die NuGet-Wiederherstellung ordnungsgemäß funktioniert. Der Wert "netstandard2.1;netstandard2.0;net8.0;net8.0-gtk;;net7.0;" aus der Debug|AnyCPU|netstandard2.1-Konfiguration wird verwendet, andere Zielframeworks wählen möglicherweise keine NuGet-Objekte aus.. Sie müssen möglicherweise die Projektmappe neu laden, nachdem Sie das Problem behoben haben. 
Problem beim Projekt "Maps" während des letzten Vorgangs: Der Wert der Eigenschaft "TargetFrameworks" ist zwischen Zielframeworks inkonsistent. Diese Eigenschaft muss identisch sein, damit die NuGet-Wiederherstellung ordnungsgemäß funktioniert. Der Wert "netstandard2.1;netstandard2.0;net8.0;net8.0-gtk;" aus der Debug|AnyCPU|netstandard2.1-Konfiguration wird verwendet, andere Zielframeworks wählen möglicherweise keine NuGet-Objekte aus.. Sie müssen möglicherweise die Projektmappe neu laden, nachdem Sie das Problem behoben haben. 
Problem beim Projekt "Controls.Xaml" während des letzten Vorgangs: Der Wert der Eigenschaft "TargetFrameworks" ist zwischen Zielframeworks inkonsistent. Diese Eigenschaft muss identisch sein, damit die NuGet-Wiederherstellung ordnungsgemäß funktioniert. Der Wert "netstandard2.1;netstandard2.0;net8.0;net8.0-gtk;net8.0-android;" aus der Debug|AnyCPU|netstandard2.1-Konfiguration wird verwendet, andere Zielframeworks wählen möglicherweise keine NuGet-Objekte aus.. Sie müssen möglicherweise die Projektmappe neu laden, nachdem Sie das Problem behoben haben. 
Problem beim Projekt "Controls.Foldable" während des letzten Vorgangs: Der Wert der Eigenschaft "TargetFrameworks" ist zwischen Zielframeworks inkonsistent. Diese Eigenschaft muss identisch sein, damit die NuGet-Wiederherstellung ordnungsgemäß funktioniert. Der Wert "net8.0;net8.0-gtk;net8.0-android;" aus der Debug|AnyCPU|net8.0-Konfiguration wird verwendet, andere Zielframeworks wählen möglicherweise keine NuGet-Objekte aus.. Sie müssen möglicherweise die Projektmappe neu laden, nachdem Sie das Problem behoben haben. 
Problem beim Projekt "Microsoft.AspNetCore.Components.WebView.Maui" während des letzten Vorgangs: Der Wert der Eigenschaft "TargetFrameworks" ist zwischen Zielframeworks inkonsistent. Diese Eigenschaft muss identisch sein, damit die NuGet-Wiederherstellung ordnungsgemäß funktioniert. Der Wert "net8.0;net8.0-gtk;" aus der Debug|AnyCPU|net8.0-Konfiguration wird verwendet, andere Zielframeworks wählen möglicherweise keine NuGet-Objekte aus.. Sie müssen möglicherweise die Projektmappe neu laden, nachdem Sie das Problem behoben haben. 
Problem beim Projekt "Maui.Controls.Sample" während des letzten Vorgangs: Der Wert der Eigenschaft "TargetFrameworks" ist zwischen Zielframeworks inkonsistent. Diese Eigenschaft muss identisch sein, damit die NuGet-Wiederherstellung ordnungsgemäß funktioniert. Der Wert "net8.0-gtk;net8.0-android;;net8.0" aus der Debug|AnyCPU|net8.0-gtk-Konfiguration wird verwendet, andere Zielframeworks wählen möglicherweise keine NuGet-Objekte aus.. Sie müssen möglicherweise die Projektmappe neu laden, nachdem Sie das Problem behoben haben. 
Problem beim Projekt "Compatibility" während des letzten Vorgangs: Der Wert der Eigenschaft "TargetFrameworks" ist zwischen Zielframeworks inkonsistent. Diese Eigenschaft muss identisch sein, damit die NuGet-Wiederherstellung ordnungsgemäß funktioniert. Der Wert "netstandard2.1;netstandard2.0;net8.0;net8.0-gtk;net8.0-android;" aus der Debug|AnyCPU|netstandard2.1-Konfiguration wird verwendet, andere Zielframeworks wählen möglicherweise keine NuGet-Objekte aus.. Sie müssen möglicherweise die Projektmappe neu laden, nachdem Sie das Problem behoben haben. 
Problem beim Projekt "Core" während des letzten Vorgangs: Der Wert der Eigenschaft "TargetFrameworks" ist zwischen Zielframeworks inkonsistent. Diese Eigenschaft muss identisch sein, damit die NuGet-Wiederherstellung ordnungsgemäß funktioniert. Der Wert "netstandard2.1;netstandard2.0;net8.0;net8.0-gtk;net8.0-android;" aus der Debug|AnyCPU|netstandard2.1-Konfiguration wird verwendet, andere Zielframeworks wählen möglicherweise keine NuGet-Objekte aus.. Sie müssen möglicherweise die Projektmappe neu laden, nachdem Sie das Problem behoben haben. 
Problem beim Projekt "Graphics" während des letzten Vorgangs: Der Wert der Eigenschaft "TargetFrameworks" ist zwischen Zielframeworks inkonsistent. Diese Eigenschaft muss identisch sein, damit die NuGet-Wiederherstellung ordnungsgemäß funktioniert. Der Wert "netstandard2.1;netstandard2.0;net8.0;net8.0-gtk;net8.0-android;;net7.0;net7.0-android;" aus der Debug|AnyCPU|netstandard2.1-Konfiguration wird verwendet, andere Zielframeworks wählen möglicherweise keine NuGet-Objekte aus.. Sie müssen möglicherweise die Projektmappe neu laden, nachdem Sie das Problem behoben haben. 
Problem beim Projekt "Essentials" während des letzten Vorgangs: Der Wert der Eigenschaft "TargetFrameworks" ist zwischen Zielframeworks inkonsistent. Diese Eigenschaft muss identisch sein, damit die NuGet-Wiederherstellung ordnungsgemäß funktioniert. Der Wert "netstandard2.1;netstandard2.0;net8.0;net8.0-gtk;net8.0-android;;net7.0;net7.0-android;" aus der Debug|AnyCPU|netstandard2.1-Konfiguration wird verwendet, andere Zielframeworks wählen möglicherweise keine NuGet-Objekte aus.. Sie müssen möglicherweise die Projektmappe neu laden, nachdem Sie das Problem behoben haben. 
Problem beim Projekt "Controls.Core" während des letzten Vorgangs: Der Wert der Eigenschaft "TargetFrameworks" ist zwischen Zielframeworks inkonsistent. Diese Eigenschaft muss identisch sein, damit die NuGet-Wiederherstellung ordnungsgemäß funktioniert. Der Wert "netstandard2.1;netstandard2.0;net8.0;net8.0-gtk;net8.0-android;" aus der Debug|AnyCPU|netstandard2.1-Konfiguration wird verwendet, andere Zielframeworks wählen möglicherweise keine NuGet-Objekte aus.. Sie müssen möglicherweise die Projektmappe neu laden, nachdem Sie das Problem behoben haben.

Issue in Graphics.Skia project during last operation: The value of the TargetFrameworks property is inconsistent between target frameworks. This property must be the same for NuGet restore to work properly. The value "netstandard2.1;netstandard2.0;net8.0;net8.0-gtk;;net7.0;" from the Debug|AnyCPU|netstandard2.1 configuration is used, other target frameworks may not select NuGet objects. You may need to reload the solution after resolving the issue.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any suggestions?

<Nullable>enable</Nullable>
<DefineConstants>$(DefineConstants);WEBVIEW2_MAUI</DefineConstants>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"profiles": {
"Controls.Sample.Gtk": {
"commandName": "Project"
},
"WSL": {
"commandName": "WSL2",
"distributionName": ""
}
}
}
14 changes: 7 additions & 7 deletions src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,24 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Console" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<!--<PackageReference Include="Microsoft.Maui.Graphics.Skia" />-->
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.1.0" />
</ItemGroup>

<ItemGroup Condition=" '$(UseMaui)' != 'true' ">
<PackageReference Include="Microsoft.Extensions.Configuration" />
<PackageReference Include="Microsoft.Extensions.Logging" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<!--<ItemGroup>
<ProjectReference
Include="..\..\..\Controls\src\Core\Controls.SourceGen.csproj"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false"/>
</ItemGroup>
</ItemGroup>-->

<ItemGroup>
<ProjectReference Include="..\..\..\BlazorWebView\samples\MauiRazorClassLibrarySample\MauiRazorClassLibrarySample.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
"Windows Machine": {
"commandName": "MsixPackage",
"nativeDebugging": true
},
"WSL": {
"commandName": "WSL2",
"distributionName": "",
"environmentVariables": {
"DISPLAY": "127.0.0.1:0.0",
"DOTNET_ENVIRONMENT": "Development"
}
}
}
}
27 changes: 5 additions & 22 deletions src/Core/src/Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="Microsoft.Extensions.Logging" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
<PackageReference Include="WebkitGtkSharp" Version="3.24.24.95" />
<ProjectReference Include="..\..\Graphics\src\Graphics\Graphics.csproj" />
<PackageReference Include="System.Numerics.Vectors" Condition="$(TargetFramework.StartsWith('netstandard'))" />
</ItemGroup>
Expand Down Expand Up @@ -75,32 +76,14 @@

<Import Project="$(MauiRootDirectory)eng/ReplaceText.targets" />

<Target Name="_GenerateBundledVersions"
BeforeTargets="Build;AssignTargetPaths"
DependsOnTargets="SetVersions"
Inputs="$(MSBuildProjectFile);$(MauiRootDirectory)eng\Versions.props;nuget\buildTransitive\GtkSharp.Maui.Core.BundledVersions.in.targets"
Outputs="$(IntermediateOutputPath)GtkSharp.Maui.Core.BundledVersions.targets">
<Target Name="_GenerateBundledVersions" BeforeTargets="Build;AssignTargetPaths" DependsOnTargets="SetVersions" Inputs="$(MSBuildProjectFile);$(MauiRootDirectory)eng\Versions.props;nuget\buildTransitive\GtkSharp.Maui.Core.BundledVersions.in.targets" Outputs="$(IntermediateOutputPath)GtkSharp.Maui.Core.BundledVersions.targets">
<ItemGroup>
<_ValuesToReplace Include="VERSION" PropertyName="PackageReferenceVersion" />
</ItemGroup>
<Copy
SourceFiles="nuget\buildTransitive\GtkSharp.Maui.Core.BundledVersions.in.targets"
DestinationFiles="$(IntermediateOutputPath)GtkSharp.Maui.Core.BundledVersions.targets"
/>
<ReplaceText
Input="$(IntermediateOutputPath)GtkSharp.Maui.Core.BundledVersions.targets"
Output="$(IntermediateOutputPath)GtkSharp.Maui.Core.BundledVersions.targets"
OldValue="@%(_ValuesToReplace.Identity)@"
NewValue="$(%(_ValuesToReplace.PropertyName))"
/>
<Copy SourceFiles="nuget\buildTransitive\GtkSharp.Maui.Core.BundledVersions.in.targets" DestinationFiles="$(IntermediateOutputPath)GtkSharp.Maui.Core.BundledVersions.targets" />
<ReplaceText Input="$(IntermediateOutputPath)GtkSharp.Maui.Core.BundledVersions.targets" Output="$(IntermediateOutputPath)GtkSharp.Maui.Core.BundledVersions.targets" OldValue="@%(_ValuesToReplace.Identity)@" NewValue="$(%(_ValuesToReplace.PropertyName))" />
<ItemGroup>
<None
Include="$(IntermediateOutputPath)GtkSharp.Maui.Core.BundledVersions.targets"
Link="nuget\buildTransitive\GtkSharp.Maui.Core.BundledVersions.targets"
Pack="true"
PackagePath="buildTransitive"
Visible="false"
/>
<None Include="$(IntermediateOutputPath)GtkSharp.Maui.Core.BundledVersions.targets" Link="nuget\buildTransitive\GtkSharp.Maui.Core.BundledVersions.targets" Pack="true" PackagePath="buildTransitive" Visible="false" />
<FileWrites Include="$(IntermediateOutputPath)GtkSharp.Maui.Core.BundledVersions.targets" />
</ItemGroup>
</Target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.Maui.Storage;
using NativeImage = Gdk.Pixbuf;

namespace Microsoft.Maui
Expand All @@ -23,40 +25,71 @@ public partial class FileImageSourceService
return FromResult(null);

var filename = imageSource.File;
var pureFilename = Path.GetFileNameWithoutExtension(imageSource.File);
var ext = Path.GetExtension(imageSource.File);

NativeImage? TryLoadFile(string file)
int scaleInt = (int)Math.Round(scale * 100);
string scaledFilename = $"{pureFilename}.scale-{scaleInt}{ext}";

var rgxMatchScaling = new Regex(@"scale-(\d+)");

NativeImage? TryLoadFile()
{
if (File.Exists(file))
if (File.Exists(filename))
return new NativeImage(filename);

if (File.Exists(scaledFilename))
return new(scaledFilename);

var files = Directory.GetFiles(AppContext.BaseDirectory, "*"+ext).Select(x => Path.GetFileName(x)).ToArray();
files = files.Where(x => x.StartsWith(pureFilename) && rgxMatchScaling.IsMatch(x)).ToArray();

if (files.Length == 0) return null;

var scaling = files.Where(x => rgxMatchScaling.IsMatch(x)).ToDictionary(x => int.Parse(rgxMatchScaling.Match(x).Groups[1].Value), y => y);
var closestScale = scaling.Keys.OrderBy(s => Math.Abs(s - scaleInt)).FirstOrDefault();
var res = scaling[closestScale];

if (res != null) return new(Path.Combine(AppContext.BaseDirectory, res));

return null;
}

NativeImage? TryLoadResource(string file)
NativeImage? TryLoadEmbededMauiImage()
{
var baseName = $"MauiGTK.MauiImages.{pureFilename}";

foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
{
var names = assembly.GetManifestResourceNames();
var res = names.FirstOrDefault(r => r.EndsWith($".{file}"));
names = names.Where(x => x.Contains(baseName, StringComparison.InvariantCulture) && x.EndsWith(ext)).ToArray();

if (names.Length == 0) continue;

var scaledFullqualifiedName = names.FirstOrDefault(x => x.Contains(scaledFilename, StringComparison.InvariantCulture));

if (res != null)
if (scaledFullqualifiedName != null)
{
return new(assembly, res);
return new(assembly, scaledFullqualifiedName);
}

var scaling = names.Where(x => rgxMatchScaling.IsMatch(x)).ToDictionary(x => int.Parse(rgxMatchScaling.Match(x).Groups[1].Value), y => y);
var closestScale = scaling.Keys.OrderBy(s => Math.Abs(s - scaleInt)).FirstOrDefault();
var res = scaling[closestScale];

if (res != null) return new(assembly, res);
}

return default;

}

try
{
var image = TryLoadFile(filename);
var image = TryLoadFile();

if (image == null)
{
image = TryLoadResource(filename);

image = TryLoadEmbededMauiImage();
}

if (image == null)
Expand All @@ -77,6 +110,7 @@ public partial class FileImageSourceService
static Task<IImageSourceServiceResult<NativeImage>?> FromResult(IImageSourceServiceResult<NativeImage>? result) =>
Task.FromResult(result);


}

}
4 changes: 4 additions & 0 deletions src/Essentials/src/Essentials.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@
<Compile Include="**\*.Gtk.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
<Compile Include="**\*.Gtk.*.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="GdkSharp" Version="3.24.24.95" />
<PackageReference Include="GtkSharp" Version="3.24.24.95" />
</ItemGroup>
<!-- <ItemGroup Condition=" '$(TargetPlatformIdentifier)' == 'macos' ">
<Compile Include="**\*.macos.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
<Compile Include="**\*.macos.*.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
Expand Down
9 changes: 6 additions & 3 deletions src/Graphics/src/Graphics.Gtk/Graphics.Gtk.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk/">
<Project Sdk="Microsoft.NET.Sdk/">

<PropertyGroup>
<TargetFrameworks>netstandard2.1;netstandard2.0;$(_MauiDotNetTfm)-gtk</TargetFrameworks>
Expand All @@ -12,8 +12,11 @@
<ItemGroup>
<ProjectReference Include="..\Graphics\Graphics.csproj" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.Contains('-gtk')) != 'true'">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason for removing the platform specification here as well?

Copy link
Author

@TenEniunlsl TenEniunlsl Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i have asked the same question here

<ItemGroup Condition="$(TargetFramework.Contains('-gtk')) != 'true'"> <PackageReference Include="GtkSharp" /> </ItemGroup>

For me it doesn't make sense to include GtkSharp if it isn't a -gtk project and also it would'nt compile

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion it should look like

<ItemGroup Condition="$(TargetFrameworks.Contains('-gtk')) == 'True'"> <PackageReference Include="CairoSharp" Version="3.24.24.95" /> <PackageReference Include="GtkSharp" Version="3.24.24.95" /> <PackageReference Include="GdkSharp" Version="3.24.24.95" /> <PackageReference Include="PangoSharp" Version="3.24.24.95" /> </ItemGroup>

There was n s missing in TargetFrameworks and it should be "== True", correct me if i'm wrong

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into it on my end, and it seems that MSBuild is case-insensitive.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe i will try it, as i changed the workload i had read it is case sensitive

but it should'nt != it should ==

<PackageReference Include="GtkSharp" />
<ItemGroup Condition="$(TargetFrameworks.Contains('-gtk')) == 'True'">
<PackageReference Include="CairoSharp" Version="3.24.24.95" />
<PackageReference Include="GtkSharp" Version="3.24.24.95" />
<PackageReference Include="GdkSharp" Version="3.24.24.95" />
<PackageReference Include="PangoSharp" Version="3.24.24.95" />
</ItemGroup>

</Project>