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

C# template doesn't compile #2619

Closed
kztk-m opened this issue Feb 16, 2024 · 4 comments · Fixed by #2628
Closed

C# template doesn't compile #2619

kztk-m opened this issue Feb 16, 2024 · 4 comments · Fixed by #2628
Labels
Milestone

Comments

@kztk-m
Copy link

kztk-m commented Feb 16, 2024

Expected Behavior

Projects generated by dotnet new etoapp compile.

Actual Behavior

dotnet build fails due to the error "error CS0246: The type or namespace name 'Form' could not be found" in MainForm.cs.

It seems to me that this behavior is caused by 1c353b7, which removes some usings in favor of global using. The commit also removed the using declarations from the template code, but it seems to me that neither the nuget nor the .csproj files in the template sets up global usings for the code.

To be clear, I was not troubled with making the generated compile itself; I can add using Eto.Forms and some other usings in the generated .cs files to remove the errors.

Steps to Reproduce the Problem

  1. dotnet new install Eto.Forms.Templates to install the latest template (2.8.2).
  2. mkdir SomeProj and cd SomeProj
  3. dotnet new etoapp
  4. dotnet build SomeProj, which fails with the above-mentioned error.

Specifications

  • Version: 2.8.2
  • Platform(s): Mac
  • Operating System(s): macOS 14.1
@cwensley
Copy link
Member

Hey @kztk-m,

Thanks for reporting the issue! Yeah it's an oversight, perhaps I should add some tests for the templates on the CI builds to avoid this in the future.

@cwensley cwensley added the bug label Feb 17, 2024
@cwensley cwensley added this to the 2.8.3 milestone Feb 17, 2024
@photex
Copy link

photex commented Feb 21, 2024

Howdy! I'm entirely new to this project and have hit this issue. For the sake of those like me, would someone be willing to share what usings are missing?

@photex
Copy link

photex commented Feb 21, 2024

Ok, I realize now that the link in the original report shows all the possible missing using statements.

I had to add:

using System; // in Program.cs
using Eto.Forms;
using Eto.Drawing;

@phoyd
Copy link

phoyd commented Feb 29, 2024

This problem seems there even when downgrading to Eto.Forms.Templates::2.8.0. I've downgraded to 2.7.5 now and use https://github.com/dotnet-outdated/dotnet-outdated to upgrade the packages.

cwensley added a commit to cwensley/Eto that referenced this issue Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants