Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions C3D.Extensions.Aspire.sln
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{E1FFCD98
build\nuget.publish.config = build\nuget.publish.config
README.md = README.md
build\RemoveCert.ps1 = build\RemoveCert.ps1
Set-WebApplicationTargetsPath.ps1 = Set-WebApplicationTargetsPath.ps1
build\Test.snk = build\Test.snk
EndProjectSection
EndProject
Expand Down
5 changes: 5 additions & 0 deletions Set-WebApplicationTargetsPath.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$vs_path = vswhere -latest -property installationPath
$vs_version = [System.Version]::Parse($(vswhere -latest -property installationVersion))
$vs_tools_path = "$vs_path\MSBuild\Microsoft\VisualStudio\v$($vs_version.Major).0"
$web_applications_target_path = "$vs_tools_path\WebApplications\Microsoft.WebApplication.targets"
$env:WebApplicationsTargetPath=$web_applications_target_path
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public IISEndPointConfigurator(DistributedApplicationModel appModel,

public void Configure()
{
var appHostConfig = options.Value.ApplicationHostConfig!;
var appHostConfig = options.Value.ApplicationHostConfig ?? ApplicationHostConfigurationExtensions.GetTempConfigFile();
foreach (var project in appModel.Resources.OfType<IISExpressProjectResource>())
{
try
Expand Down
7 changes: 6 additions & 1 deletion src/C3D/Extensions/Aspire/IISExpress/IISExpressOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@ public IEnumerable<ValidationResult> Validate(ValidationContext validationContex
return results;
}

public string? ApplicationHostConfig => SolutionDir is null || SolutionName is null ? null :
public string? ApplicationHostConfig =>
(string.IsNullOrEmpty(SolutionDir) ||
(string.IsNullOrEmpty(SolutionName) ||
SolutionName.IndexOfAny(Path.GetInvalidFileNameChars())!=-1
)
) ? null :
System.IO.Path.Combine(
SolutionDir,
".vs",
Expand Down