Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use dotnet script.cs with -- to avoid CLI expanding .rsp file
Per feedback, the simpler approach is to use 'dotnet script.cs -- @response.rsp'
where the '--' tells dotnet CLI to pass arguments directly to the script without
interpretation. This avoids the CLI expanding the .rsp file and hitting command
line limits.

The script still needs to be built once (dotnet does this automatically when
running .cs files), so we keep the build step to ensure it's compiled before use.

Co-authored-by: DamianEdwards <[email protected]>
  • Loading branch information
Copilot and DamianEdwards committed Dec 16, 2025
commit 3e135ea57974b5e41ec80b2d77fd37dda50fe3f0
8 changes: 3 additions & 5 deletions src/Aspire.ProjectTemplates/Aspire.ProjectTemplates.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@
<VersionMajorMinor>$(VersionMajor).$(VersionMinor)</VersionMajorMinor>
<_RspFilePath>$(IntermediateOutputPath)replace-text-args.rsp</_RspFilePath>
<_ReplaceTextScriptPath>$(RepoRoot)tools/scripts/replace-text.cs</_ReplaceTextScriptPath>
<_ReplaceTextExePath>$(RepoRoot)artifacts/bin/replace-text/Debug/replace-text</_ReplaceTextExePath>
<_ReplaceTextExePath Condition="'$(OS)' == 'Windows_NT'">$(_ReplaceTextExePath).exe</_ReplaceTextExePath>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -139,14 +137,14 @@
Overwrite="true"
WriteOnlyWhenDifferent="true" />

<!-- Build the script to an executable -->
<!-- Build the script to ensure it's compiled (required for dotnet to run it with arguments) -->
<Exec Command="dotnet build &quot;$(_ReplaceTextScriptPath)&quot; -o &quot;$(RepoRoot)artifacts/bin/replace-text/Debug&quot;"
WorkingDirectory="$(MSBuildThisFileDirectory)"
StandardOutputImportance="Low"
StandardErrorImportance="Normal" />

<!-- Execute the compiled script with the .rsp file -->
<Exec Command="&quot;$(_ReplaceTextExePath)&quot; @&quot;$(_RspFilePath)&quot;"
<!-- Execute the script with the .rsp file, using double dash to pass arguments directly to the script -->
<Exec Command="dotnet &quot;$(_ReplaceTextScriptPath)&quot; -- @&quot;$(_RspFilePath)&quot;"
WorkingDirectory="$(MSBuildThisFileDirectory)"
StandardOutputImportance="Normal"
StandardErrorImportance="Normal" />
Expand Down
Loading