eclipse / aCute

Eclipse aCute - C# edition in Eclipse IDE
https://projects.eclipse.org/projects/tools.acute
Eclipse Public License 2.0
78 stars 33 forks source link

Dotnet 7.0.100 is installed, and it's on the path, but no available project templates #194

Closed SolicitedPoet2 closed 2 hours ago

SolicitedPoet2 commented 1 year ago

I'm on windows, and I installed dotnet version 7.0.100, at first when it doesn't work I thought it was because it wasn't on the path (even knowing the installer put it automatically on the path), so I tried to find the location of dotnet and put it on the path, it doesn't work either. So I saw the message alongside with the "no available project templates", "see preferences". So I clicked on the ".NET Preferences", and I selected the dotnet executable file and clicked apply. It doesn't work too, apparently it just ignores that I applied the dotnet file. Also: When I select the dotnet, it shows the version below where I put the dotnet location.

Sorry for my english.

NoLyrics commented 1 year ago

The same problem. In command line dotnet --info, dotnet --version and dotnet new work fine; I even can create new project 'console', 'classlib', 'winforms' or others. But when I select dotnet.exe in Eclipse, it can only check the version, but shows me "No available project templates'.

Version: 7.0.101 OS Name: Windows OS Version: 10.0.19045 RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\7.0.101\

I find the line in org\eclipse\acute\dotnetnew\DotnetNewAccessor.java that can generate this problem:

inputLine.matches("--------------------------------- -------------------- ---------- ------------------------------------------------------------------------------------------$")

but my line for dotnet new --list looks like this:

----------------------------------------------- ------------------- ---------- ------------------------------------- ASP.NET Core with React.js and Redux reactredux [C#] Web/MVC/SPA MVC ViewImports viewimports [C#] Web/ASP.NET [C#] Web/ASP.NET

So lines mismatch and "No templates". If only that line was contains in some external config-file, I could fix it by myself. But I can't. And I can't put in this method regular expression like "(-| ){30,}$"

mkmkmk commented 1 year ago

I have the same problem.

dotnet new --list

Warning: use of 'dotnet new --list' is deprecated. Use 'dotnet new list' instead.
For more information, run: 
   dotnet new list -h

These templates matched your input: 

Template Name                                 Short Name           Language    Tags                                 
--------------------------------------------  -------------------  ----------  -------------------------------------
ASP.NET Core Empty                            web                  [C#],F#     Web/Empty                            
ASP.NET Core gRPC Service                     grpc                 [C#]        Web/gRPC                             
ASP.NET Core Web API                          webapi               [C#],F#     Web/WebAPI                           
ASP.NET Core Web App                          webapp,razor         [C#]        Web/MVC/Razor Pages                  
ASP.NET Core Web App (Model-View-Controller)  mvc                  [C#],F#     Web/MVC                              
ASP.NET Core with Angular                     angular              [C#]        Web/MVC/SPA                          
ASP.NET Core with React.js                    react                [C#]        Web/MVC/SPA                          
ASP.NET Core with React.js and Redux          reactredux           [C#]        Web/MVC/SPA                          
Blazor Server App                             blazorserver         [C#]        Web/Blazor                           
Blazor Server App Empty                       blazorserver-empty   [C#]        Web/Blazor/Empty                     
Blazor WebAssembly App                        blazorwasm           [C#]        Web/Blazor/WebAssembly/PWA           
Blazor WebAssembly App Empty                  blazorwasm-empty     [C#]        Web/Blazor/WebAssembly/PWA/Empty     
Class                                         class                [C#],VB     Common                               
Class Library                                 classlib             [C#],F#,VB  Common/Library                       
Console App                                   console              [C#],F#,VB  Common/Console                       
dotnet gitignore file                         gitignore                        Config                               
Dotnet local tool manifest file               tool-manifest                    Config                               
EditorConfig file                             editorconfig                     Config                               
Enum                                          enum                 [C#],VB     Common                    
...

dotnet --info

.NET SDK:
 Version:   7.0.203
 Commit:    5b005c19f5

Runtime Environment:
 OS Name:     debian
 OS Version:  10
 OS Platform: Linux
 RID:         debian.10-x64
 Base Path:   /usr/share/dotnet/sdk/7.0.203/
...
zhugezi5 commented 1 year ago

acute_20230428.zip if you are using the snapshots(http://download.eclipse.org/acute/snapshots) version you can try to replace eclipse/plugins/org.eclipse.acute_0.3.3.202211251846.jar with the attach jar. or just replace the .class in eclipse/plugins/org.eclipse.acute_0.3.3.202211251846.jar/org/eclipse/acute/dotnetnew/ please backup your jar before replacing.

d7d6 commented 1 year ago

[...] I find the line in org\eclipse\acute\dotnetnew\DotnetNewAccessor.java that can generate this problem:

inputLine.matches("--------------------------------- -------------------- ---------- ------------------------------------------------------------------------------------------$")

but my line for dotnet new --list looks like this:

----------------------------------------------- ------------------- ---------- ------------------------------------- ASP.NET Core with React.js and Redux reactredux [C#] Web/MVC/SPA [...]

I tried just to use the very same header separator line returned by the command dotnet new list: this (-------------------------------------------- ------------------- ---------- -------------------------------------) and the templates list is now visible: Screenshot 2023-09-03 131803

mickaelistria commented 1 year ago

Please consider submitting a PR to improve the input line detection.

Fusik commented 11 months ago

Hi, is the template issue repaired? got SDK 3.1 and 7.0 and still no template standard path Program Files\dotnet and fix?

ormorph commented 8 months ago

I tried just to use the very same header separator line returned by the command dotnet new list: this

It's good that you found the reason, but this is not the right solution. The separator changes depending on the version and the selected language, so you need to use a regular expression. For example, line 90 can be changed like this:

--- a/org.eclipse.acute/src/org/eclipse/acute/dotnetnew/DotnetNewAccessor.java
+++ b/org.eclipse.acute/src/org/eclipse/acute/dotnetnew/DotnetNewAccessor.java
@@ -87,7 +87,7 @@ public class DotnetNewAccessor {
                                        }
                                        if(DotnetVersionUtil.getMajorVersionNumber(DotnetVersionUtil.getVersion(AcutePlugin.getDotnetCommand())) >= 5)
                                        {
-                                               if(inputLine.matches("---------------------------------  --------------------  ----------  ------------------------------------------------------------------------------------------$")) { //$NON-NLS-1$
+                                               if(inputLine.matches("^-{30,}(.*)---$")) { //$NON-NLS-1$
                                                        templateListExists = true;
                                                        break;
                                                }
akurtakov commented 2 hours ago

I believe this is fixed (for dotnet 8 at least) in the current snapshots. Please retry.