Avalonia.FuncUI icon indicating copy to clipboard operation
Avalonia.FuncUI copied to clipboard

Full template fails to run for project names containing '-'

Open bisen2 opened this issue 5 years ago • 2 comments

It seems like using the funcui.full template fails when the project name contains a "-" in it. For example, if I run

PS> dotnet new funcui.full -o test-app
PS> cd .\test-app\
PS> dotnet run

It throws a FileNotFoundException: Could not load file or assembly "test_app, Culture=neutral, PublicKeyToken=null". If you run the same commands but use test_app for the project name, it runs as you would expect.

Obviously this is not a big deal, users can just use underscores in project names, but I figured I would bring it to your attention.

bisen2 avatar Apr 15 '21 02:04 bisen2

Are you sure this has nothing to do with the terminal that was used? It works here (windows ps atm). What os, terminal were you using?

Windows Terminal
Version: 1.11.2921.0
PS E:\Programming\Fsharp> $PSVersionTable.PSVersion
Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      19041  1320
PS E:\Programming\Fsharp> dotnet new funcui.full -o test-app
PS E:\Programming\Fsharp> ls
    Directory: E:\Programming\Fsharp
Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
....
d-----        12/14/2021   23:18 PM                test-app
....

This might be a dead (non)issue, maybe removal needed seems user issue

P-Louw avatar Dec 12 '21 01:12 P-Louw

It fails when you do dotnet run.

It's caused by this line in Program.fs:

this.Styles.Load "avares://test_app/Styles.xaml"

"test_app" doesn't match the generated fsproj filename/resulting assembly name "test-app".

iminashi avatar Dec 12 '21 08:12 iminashi

Closing this as it is an old issue and can easily be worked around by changing the name.

JordanMarr avatar Jan 22 '23 16:01 JordanMarr