Skip to content

Commit d7d8e15

Browse files
committed
Handle case where SolutionName is not set (or set to *Undefined*)
Fixes #32
1 parent 71717d4 commit d7d8e15

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/C3D/Extensions/Aspire/IISExpress/IISEndPointConfigurator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public IISEndPointConfigurator(DistributedApplicationModel appModel,
2828

2929
public void Configure()
3030
{
31-
var appHostConfig = options.Value.ApplicationHostConfig!;
31+
var appHostConfig = options.Value.ApplicationHostConfig ?? ApplicationHostConfigurationExtensions.GetTempConfigFile();
3232
foreach (var project in appModel.Resources.OfType<IISExpressProjectResource>())
3333
{
3434
try

src/C3D/Extensions/Aspire/IISExpress/IISExpressOptions.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,12 @@ public IEnumerable<ValidationResult> Validate(ValidationContext validationContex
8989
return results;
9090
}
9191

92-
public string? ApplicationHostConfig => SolutionDir is null || SolutionName is null ? null :
92+
public string? ApplicationHostConfig =>
93+
(string.IsNullOrEmpty(SolutionDir) ||
94+
(string.IsNullOrEmpty(SolutionName) ||
95+
SolutionName.IndexOfAny(Path.GetInvalidFileNameChars())!=-1
96+
)
97+
) ? null :
9398
System.IO.Path.Combine(
9499
SolutionDir,
95100
".vs",

0 commit comments

Comments
 (0)