Open thomiel opened 7 months ago
The default value for the target framework does not seem to apply in other case, considering the default target framework is 8.0 but does not include '-gtk'. There may be some configuration they have based on the OS that changes the TFM but I do not see any logic for that in their repo. I'm not familiar with how to use these templates, where would that logic be @dotnet/templating-engine-maintainers ?
Triage: It kind of sounds the template is not correctly installed and a different copy is being picked up. I might try fully uninstalling it. You can also run dotnet new gtkapp -d
to get diagnostic information. @thomiel
Sorry to keep you waiting for an answer so long, but finally I have prepared a dockerfile (FROM mcr.microsoft.com/dotnet/sdk:8.0) to allow you to easily and reproducably confirm the behavior. On a WSL2 or Linux machine:
git clone https://github.com/Thomas-Mielke-Software/GtkSharp-Docker
cd GtkSharp-Docker
docker build -t gtksharp-env .
docker run -i --rm -t gtksharp-env bash
grep "<TargetFramework>net6.0</TargetFramework>" *
I really wonder where the logic to set the target framework is on Linux...
Describe the bug
I have got a project template:
dotnet new on Linux results in:
On Windows:
SDK installed on both OSes is 8.0.203.
I would expect that both
dotnet new
s lead to the same .csproj file.To Reproduce
Find the complete template here.
Exceptions (if any)
On windows the correct
<TargetFramework>net8.0-gtk</TargetFramework>
is inserted in the .csproj file.Further technical details
Include the output of
dotnet --info
:The IDE (VS / VS Code/ VS4Mac) you're running on, and its version:
only bash
verbosity diag output:
Note: I was trying to understand how the gtk workload of GtkSharp works, when I stumbled upon the strange bug. I didn't find any reference to .NET in the solution (apart from a VersionGreaterThanOrEquals parameter in the WorkloadManifest.targets file), so I'd assume it's a problem in the SDKs CLI tool.