Skip to content

Test templates fixes#4043

Merged
DamianEdwards merged 9 commits intomainfrom
damianedwards/template-fixes
May 2, 2024
Merged

Test templates fixes#4043
DamianEdwards merged 9 commits intomainfrom
damianedwards/template-fixes

Conversation

@DamianEdwards
Copy link
Copy Markdown
Member

@DamianEdwards DamianEdwards commented May 1, 2024

This appears to fix #4025
For #4024 I think the targets change I make here fixes that but I haven't fully verified that as it's a bit trickier to do so locally.

Fixes #4025
Fixes #4024
Fixes #4056
Fixes #3981

Microsoft Reviewers: Open in CodeFlow

@ghost ghost added the area-templates label May 1, 2024
@radical
Copy link
Copy Markdown
Member

radical commented May 1, 2024

I tried:

diff --git a/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireStarterApplication.1.Tests/WebTests.cs b/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireStarterApplication.1.Tests/WebTests.cs
index a0a114dde..bf183ff63 100644
--- a/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireStarterApplication.1.Tests/WebTests.cs
+++ b/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireStarterApplication.1.Tests/WebTests.cs
@@ -17,7 +17,7 @@ public class WebTests
     public async Task GetWebResourceRootReturnsOkStatusCode()
     {
         // Arrange
-        var appHost = await DistributedApplicationTestingBuilder.CreateAsync<Projects.AspireStarterApplication._1_AppHost>();
+        var appHost = await DistributedApplicationTestingBuilder.CreateAsync<Projects.AspireStarterApplication__1_AppHost>();
         await using var app = await appHost.BuildAsync();
         await app.StartAsync();

.. essentially use to the className variation which would always change . to _, and thus be safe.

.. which fixes #4025 . For #4024, the targets need to be updated to handle the case of .N and instead of replacing that with _N use __N.

But there is yet another case, aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞ which fails with:
/private/var/folders/dj/z2lsb9l9087356sgyzrlklvr0000gn/T/testroot/aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞/aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.AppHost/aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.AppHost.csproj(13,51): error MSB4025: The project file could not be loaded. An error occurred while parsing EntityName. Line 13, position 51.

.. and the relevant lines:

    <ProjectReference Include="../aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.ApiService/aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.ApiService.csproj" />
    <ProjectReference Include="../aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.Web/aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.Web.csproj" />

.. & is causing the invalid xml. I got this case from @joeloff .

@DamianEdwards
Copy link
Copy Markdown
Member Author

Hmm so the template engine's default form transform doesn't auto-XML-encode in .csproj files? Wouldn't all other templates that have project references based on the name have the same issue too then?

@radical
Copy link
Copy Markdown
Member

radical commented May 1, 2024

Hmm so the template engine's default form transform doesn't auto-XML-encode in .csproj files? Wouldn't all other templates that have project references based on the name have the same issue too then?

Yeah. I can't even create a blazor project with that name.

 $ dotnet new blazor -o "aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞"
The template "Blazor Web App" was created successfully.
This template contains technologies from parties other than Microsoft, see https://aka.ms/aspnetcore/8.0-third-party-notices for details.

Processing post-creation actions...
Restoring /private/tmp/test/aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞/aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.csproj:
/private/tmp/test/aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞/aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.csproj(7,36): error MSB4025: The project file could not be loaded. An error occurred while parsing EntityName. Line 7, position 36.
Restore failed.
Post action failed.
Manual instructions: Run 'dotnet restore'

@joeloff is there an existing way to get a xml-encoded transformation of the string in the template?

If I remove the & from the name then I can create aspire-starter project but it fails to build:

/private/tmp/test/aspire 龦唉丂荳◎℉㐁ᠭᠤ སྲིད خەل ꌠ ᥕ᧞/aspire 龦唉丂荳◎℉㐁ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.AppHost/obj/Debug/net8.0/Aspire/references/aspire_龦唉丂荳◎℉㐁ᠭᠤ_སྲིད_خەل_ꌠ_ᥕ᧞_Web.ProjectMetadata.g.cs(8,25): error CS151
4: { expected [/private/tmp/test/aspire 龦唉丂荳◎℉㐁ᠭᠤ སྲིད خەل ꌠ ᥕ᧞/aspire 龦唉丂荳◎℉㐁ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.AppHost/aspire 龦唉丂荳◎℉㐁ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.AppHost.csproj]
/private/tmp/test/aspire 龦唉丂荳◎℉㐁ᠭᠤ སྲིད خەل ꌠ ᥕ᧞/aspire 龦唉丂荳◎℉㐁ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.AppHost/obj/Debug/net8.0/Aspire/references/_AppHost.ProjectMetadata.g.cs(8,25): error CS1514: { expected [/private/tmp/tes
t/aspire 龦唉丂荳◎℉㐁ᠭᠤ སྲིད خەل ꌠ ᥕ᧞/aspire 龦唉丂荳◎℉㐁ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.AppHost/aspire 龦唉丂荳◎℉㐁ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.AppHost.csproj]

And this is because the code we generate is:

public class aspire_    UNs%    !94-$_frQ_.D_ _U_AppHost
{
    private aspire_     UNs%    !94-$_frQ_.D_ _U_AppHost() { }
    public static string ProjectPath => """/private/tmp/test/aspire     UNs%    !94-$ frQ .D   U/aspire         UNs%    !94-$ frQ .D   U.AppHost""";
}

.. and this is what the template engine used:

var apiService = builder.AddProject<Projects.aspire_龦唉丂荳___㐁ᠭᠤ_སྲིད_خەل_ꌠ_ᥕ__ApiService>("apiservice");

@radical
Copy link
Copy Markdown
Member

radical commented May 1, 2024

xmlEncode transform:

https://github.com/dotnet/templating/blob/a325ffa18edd1590f9b340cf83d51d8eb567ebdc/docs/Value-Forms.md?plain=1#L12-L31

In my source, the value "Hi there" should be replaced by a user supplied value, but, &quot;Hi there&quot; should be as well. The user value should be XML encoded for the latter and not for the former. The below snippet from template.json shows how to accomplish this.

{
  ...
  "symbols": {
    "example": {
      "type": "parameter",
      "dataType": "string",
      "replaces": "\"Hi there\"",
      "forms": {
        "global": [ "encode" ]
      }
    }
  },
  "forms": {
    "encode": {
      "identifier": "xmlEncode"
    }
  }
}

@radical
Copy link
Copy Markdown
Member

radical commented May 1, 2024

diff --git a/src/Aspire.ProjectTemplates/templates/aspire-starter/.template.config/template.json b/src/Aspire.ProjectTemplates/templates/aspire-starter/.template.config/template.json
index 652ddb0dd..67d70c756 100644
--- a/src/Aspire.ProjectTemplates/templates/aspire-starter/.template.config/template.json
+++ b/src/Aspire.ProjectTemplates/templates/aspire-starter/.template.config/template.json
@@ -344,6 +344,13 @@
       "datatype": "bool",
       "defaultValue": "false",
       "description": "Whether to turn off HTTPS."
+    },
+    "XmlEncodedProjectName": {
+      "type": "derived",
+      "datatype": "string",
+      "replaces": "XmlEncodedProjectName",
+      "valueSource": "name",
+      "valueTransform": "xmlEncode"
     }
   },
   "primaryOutputs": [
diff --git a/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireStarterApplication.1.ApiService/AspireStarterApplication.1.ApiService.csproj b/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireS>
index f7812db4b..3b56d6e4b 100644
--- a/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireStarterApplication.1.ApiService/AspireStarterApplication.1.ApiService.csproj
+++ b/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireStarterApplication.1.ApiService/AspireStarterApplication.1.ApiService.csproj
@@ -7,7 +7,7 @@
   </PropertyGroup>

   <ItemGroup>
-    <ProjectReference Include="..\AspireStarterApplication.1.ServiceDefaults\AspireStarterApplication.1.ServiceDefaults.csproj" />
+    <ProjectReference Include="..\XmlEncodedProjectName.ServiceDefaults\XmlEncodedProjectName.ServiceDefaults.csproj" />
   </ItemGroup>

 </Project>
diff --git a/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireStarterApplication.1.AppHost/AspireStarterApplication.1.AppHost.csproj b/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireStarter>
index 4652b02ef..40434d256 100644
--- a/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireStarterApplication.1.AppHost/AspireStarterApplication.1.AppHost.csproj
+++ b/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireStarterApplication.1.AppHost/AspireStarterApplication.1.AppHost.csproj
@@ -10,8 +10,8 @@
   </PropertyGroup>

   <ItemGroup>
-    <ProjectReference Include="..\AspireStarterApplication.1.ApiService\AspireStarterApplication.1.ApiService.csproj" />
-    <ProjectReference Include="..\AspireStarterApplication.1.Web\AspireStarterApplication.1.Web.csproj" />
+    <ProjectReference Include="..\XmlEncodedProjectName.ApiService\XmlEncodedProjectName.ApiService.csproj" />
+    <ProjectReference Include="..\XmlEncodedProjectName.Web\XmlEncodedProjectName.Web.csproj" />
   </ItemGroup>

   <ItemGroup>

.. this results in a fixed: <ProjectReference Include="../aspire 龦唉丂荳◎℉㐁&amp;ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.ServiceDefaults/aspire 龦唉丂荳◎℉㐁&amp;ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.ServiceDefaults.csproj" />

@DamianEdwards
Copy link
Copy Markdown
Member Author

@radical I tried applying your suggested change locally and ran into issues with the .sln file not working apparently. All the paths and names look correct, but I get the sense this might never have worked properly in any template judging from how much of the logging doesn't even seem to support the unicode chars:

dotnet new aspire-starter -t MSTest -o "aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞"
The template ".NET Aspire Starter Application" was created successfully.
This template contains technologies from parties other than Microsoft, see https://aka.ms/dotnet/aspire/8.0-third-party-notices for details.

Processing post-creation actions...
Restoring D:\src\local\Aspire\aspire ????????&?? ???? ??? ? ??\aspire ????????&?? ???? ??? ? ??.sln:
C:\Program Files\dotnet\sdk\8.0.300-preview.24203.14\NuGet.targets(414,5): error MSB3202: The project file "D:\src\local\Aspir
e\aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞\aspire 龦唉丂è³â—Žâ„‰î€¹ã&á ­á ¤ སྲིད خەل ꌠ ᥕ᧞.AppHost\aspire 龦唉
丂è³â—Žâ„‰î€¹ã&á ­á ¤ སྲིད خەل ꌠ ᥕ᧞.AppHost.csproj" was not found. [D:\src\local\Aspire\aspire 龦唉丂荳◎℉㐁&ᠭ
ᠤ སྲིད خەل ꌠ ᥕ᧞\aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.sln]
C:\Program Files\dotnet\sdk\8.0.300-preview.24203.14\NuGet.targets(414,5): error MSB3202: The project file "D:\src\local\Aspir
e\aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞\aspire 龦唉丂è³â—Žâ„‰î€¹ã&á ­á ¤ སྲིད خەل ꌠ ᥕ᧞.ServiceDefaults\aspir
e 龦唉丂è³â—Žâ„‰î€¹ã&á ­á ¤ སྲིད خەل ꌠ ᥕ᧞.ServiceDefaults.csproj" was not found. [D:\src\local\Aspire\a
spire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞\aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.sln]
C:\Program Files\dotnet\sdk\8.0.300-preview.24203.14\NuGet.targets(414,5): error MSB3202: The project file "D:\src\local\Aspir
e\aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞\aspire 龦唉丂è³â—Žâ„‰î€¹ã&á ­á ¤ སྲིད خەل ꌠ ᥕ᧞.ApiService\aspire 龦
唉丂è³â—Žâ„‰î€¹ã&á ­á ¤ སྲིད خەل ꌠ ᥕ᧞.ApiService.csproj" was not found. [D:\src\local\Aspire\aspire 龦唉丂荳
◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞\aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.sln]
C:\Program Files\dotnet\sdk\8.0.300-preview.24203.14\NuGet.targets(414,5): error MSB3202: The project file "D:\src\local\Aspir
e\aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞\aspire 龦唉丂è³â—Žâ„‰î€¹ã&á ­á ¤ སྲིད خەل ꌠ ᥕ᧞.Tests\aspire 龦唉ä¸
‚è³â—Žâ„‰î€¹ã&á ­á ¤ སྲིད خەل ꌠ ᥕ᧞.Tests.csproj" was not found. [D:\src\local\Aspire\aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲ
ིད خەل ꌠ ᥕ᧞\aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.sln]
C:\Program Files\dotnet\sdk\8.0.300-preview.24203.14\NuGet.targets(414,5): error MSB3202: The project file "D:\src\local\Aspir
e\aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞\aspire 龦唉丂è³â—Žâ„‰î€¹ã&á ­á ¤ སྲིད خەل ꌠ ᥕ᧞.Web\aspire 龦唉丂è
³â—Žâ„‰î€¹ã&á ­á ¤ སྲིད خەل ꌠ ᥕ᧞.Web.csproj" was not found. [D:\src\local\Aspire\aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خ
ەل ꌠ ᥕ᧞\aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.sln]
Restore failed.
Restoring D:\src\local\Aspire\aspire ????????&?? ???? ??? ? ??\aspire ????????&?? ???? ??? ? ??.AppHost\aspire ????????&?? ???? ??? ? ??.AppHost.csproj:
  Determining projects to restore...
  Restored D:\src\local\Aspire\aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞\aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.ApiService\aspire 龦唉丂荳◎℉㐁&ᠭᠤ
   སྲིད خەل ꌠ ᥕ᧞.ApiService.csproj (in 490 ms).
  Restored D:\src\local\Aspire\aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞\aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.ServiceDefaults\aspire 龦唉丂荳◎℉
  㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.ServiceDefaults.csproj (in 490 ms).
  Restored D:\src\local\Aspire\aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞\aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.Web\aspire 龦唉丂 荳◎℉㐁&ᠭᠤ སྲིད خ
  ەل ꌠ ᥕ᧞.Web.csproj (in 490 ms).
  Restored D:\src\local\Aspire\aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞\aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.AppHost\aspire 龦 唉丂荳◎℉㐁&ᠭᠤ སྲ
  ིད خەل ꌠ ᥕ᧞.AppHost.csproj (in 490 ms).
Restore succeeded.
Restoring D:\src\local\Aspire\aspire ????????&?? ???? ??? ? ??\aspire ????????&?? ???? ??? ? ??.ServiceDefaults\aspire ????????&?? ???? ??? ? ??.ServiceDefaults.csproj:
  Determining projects to restore...
  All projects are up-to-date for restore.
Restore succeeded.
Restoring D:\src\local\Aspire\aspire ????????&?? ???? ??? ? ??\aspire ????????&?? ???? ??? ? ??.ApiService\aspire ????????&?? ???? ??? ? ??.ApiService.csproj:
  Determining projects to restore...
  All projects are up-to-date for restore.
Restore succeeded.
Restoring D:\src\local\Aspire\aspire ????????&?? ???? ??? ? ??\aspire ????????&?? ???? ??? ? ??.Web\aspire ????????&?? ???? ??? ? ??.Web.csproj:
  Determining projects to restore...
  All projects are up-to-date for restore.
Restore succeeded.
Restoring D:\src\local\Aspire\aspire ????????&?? ???? ??? ? ??\aspire ????????&?? ???? ??? ? ??.Tests\aspire ????????&?? ???? ??? ? ??.Tests.csproj:
  Determining projects to restore...
  Restored D:\src\local\Aspire\aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞\aspire 龦唉丂荳◎℉㐁&ᠭᠤ སྲིད خەل ꌠ ᥕ᧞.Tests\aspire 龦唉 丂荳◎℉㐁&ᠭᠤ སྲིད
   خەل ꌠ ᥕ᧞.Tests.csproj (in 152 ms).
  4 of 5 projects are up-to-date for restore.
Restore succeeded.
Post action failed.
Manual instructions: Run 'dotnet restore'

@radical
Copy link
Copy Markdown
Member

radical commented May 1, 2024

Maybe we can skip the case where the name has characters needing to be xml encoded for now. But other than that we should get unicode chars working, right?

@DamianEdwards
Copy link
Copy Markdown
Member Author

@radical I'm not sure we fully understand exactly what's supported though, e.g. that example you gave results in C# errors:

image

@DamianEdwards
Copy link
Copy Markdown
Member Author

The encoding for XML part actually seemed to work fine:
image

@radical
Copy link
Copy Markdown
Member

radical commented May 1, 2024

Starter template works with this on macOS: https://gist.github.com/radical/840d12dcf55ca52d867ed8cb2aeafa34

  • stash the template-generated classname in a property in the .csproj
  • Use that stashed value in the classname generated in Hosting.targets
  • And remove Encoding="unicode" from WriteLinesToFile to let it default to utf-8

@radical
Copy link
Copy Markdown
Member

radical commented May 1, 2024

It has scope for cleanup of course :D

@DamianEdwards
Copy link
Copy Markdown
Member Author

DamianEdwards commented May 1, 2024

@radical are you saying it works with something like dotnet new aspire-starter -t mstest -o "aspire 龦唉丂荳◎"? Because I'm still seeing errors including C# and .sln file parsing. The latest changes I added go with the other suggestion you made regarding have a regex symbol in the .template.json that matches what our targets do for the generated class name. That seems to fix #4024 and #4025 but these extended character examples all seem to result in issues that aren't with our template.

@radical
Copy link
Copy Markdown
Member

radical commented May 1, 2024

In my tests I didn't use -o "aspire 龦唉丂荳◎", instead I'm creating a aspire 龦唉丂荳◎ directory and then running dotnet new aspire-starter in that.

https://gist.githubusercontent.com/radical/b0b191a6255f42445c382167534d74ea/raw/e3b904dd6b3ca8482bfc53f6fc6e14b1ad2b26f8/aspire-starter-with-unicode-chars-in-name

But I did try -o "aspire 龦唉丂荳◎" and that works fine too. Also, my patch has changed a bit to handle the case where the project doesn't have the new property.

https://gist.github.com/radical/fa68b403ddfa165b725a1fc42901ab69

(Also, the new property is something that we can probably remove by doing similar transformation as yours for the project name)

@DamianEdwards
Copy link
Copy Markdown
Member Author

Hmm I'm trying to figure out what I'm missing in my changes so far then. We definitely don't want a property in the generated project file, so any idea what I should change to get it working?

@DamianEdwards
Copy link
Copy Markdown
Member Author

@radical can you share all the files from the project created with your changes? I'm a bit confused how yours is working as mine seems to be producing the files I expect (names and content) but I then hit C# errors and the solution saying the projects don't exist, but if I copy the path of the projects in the .sln file and do a dir on them, they're there 🤷

@radical
Copy link
Copy Markdown
Member

radical commented May 1, 2024

@radical
Copy link
Copy Markdown
Member

radical commented May 1, 2024

I haven't tried this on windows yet, btw.

@DamianEdwards
Copy link
Copy Markdown
Member Author

DamianEdwards commented May 1, 2024

hmm i can't open that zip, WIndows says it's invalid :sad:

Nevermind, 7zip works

@DamianEdwards
Copy link
Copy Markdown
Member Author

DamianEdwards commented May 1, 2024

ok yeah, that fails on Windows 😄

image

@DamianEdwards DamianEdwards marked this pull request as ready for review May 1, 2024 23:09
@DamianEdwards
Copy link
Copy Markdown
Member Author

@radical Based on what we just figured out I'm marking this ready for review as it does fix the issues logged and it seems Windows doesn't support project names with unicode chars anyway.

@radical
Copy link
Copy Markdown
Member

radical commented May 1, 2024

ok yeah, that fails on Windows 😄

interesting! fyi, I'm pushing my changes to #3270 but it has workload tests also. The templates relevant changes are in src/Aspire.ProjectTemplates/, and src/Aspire.Hosting.AppHost/, which you can overwrite with yours to run the tests.

@radical Based on what we just figured out I'm marking this ready for review as it does fix the issues logged and it seems Windows doesn't support project names with unicode chars anyway.

Fair enough. I'll try on windows too, and see if anything is doable but all that can be in separate PR anyway.

@radical
Copy link
Copy Markdown
Member

radical commented May 2, 2024

ok yeah, that fails on Windows 😄

Not for this PR, but I think chcp.com 65001 would be needed in cmd to build the project, or powershell.

@radical
Copy link
Copy Markdown
Member

radical commented May 2, 2024

I tried the changes here with the workload tests, and they passed.

@DamianEdwards DamianEdwards changed the title Trying to fix starter template sourceName Test templates fixes May 2, 2024
@DamianEdwards DamianEdwards force-pushed the damianedwards/template-fixes branch from ed1250c to 0e8c88b Compare May 2, 2024 17:39
@DamianEdwards DamianEdwards requested a review from phenning May 2, 2024 17:39
@DamianEdwards DamianEdwards enabled auto-merge (squash) May 2, 2024 18:10
@DamianEdwards DamianEdwards requested a review from radical May 2, 2024 18:19
@DamianEdwards DamianEdwards requested a review from radical May 2, 2024 21:47
@radical
Copy link
Copy Markdown
Member

radical commented May 2, 2024

Thank you for being patient, @DamianEdwards!

@DamianEdwards DamianEdwards merged commit 8910393 into main May 2, 2024
@DamianEdwards DamianEdwards deleted the damianedwards/template-fixes branch May 2, 2024 23:25
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

2 participants