Skip to content

Commit

Permalink
Make ampersands work *more* in net9-only blazor-solution template
Browse files Browse the repository at this point in the history
Fixes #23105

(Note: This isn't a complete fix because there seem to be issues in other parts of the product. They are tracked separately via dotnet/aspnetcore#56765).
  • Loading branch information
Eilon committed Jul 12, 2024
1 parent 4784931 commit da76906
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@
]
}
},
"XmlEncodedAppNameParam": {
"type": "derived",
"valueSource": "name",
"valueTransform": "encode",
"replaces": "XmlEncodedAppName"
},
"defaultAppId":{
"type": "generated",
"generator": "join",
Expand Down Expand Up @@ -448,5 +454,10 @@
"description": "Whether to generate an explicit Program class and Main method instead of top-level statements."
}
},
"defaultName": "MauiApp1"
"forms": {
"encode": {
"identifier": "xmlEncode"
}
},
"defaultName": "MauiApp1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\MauiApp.1.Shared\MauiApp.1.Shared.csproj" />
<ProjectReference Include="..\XmlEncodedAppName.Shared\XmlEncodedAppName.Shared.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>${DefaultNetCoreTargetFramework}</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId Condition="'$(IndividualLocalAuth)' == 'True'">aspnet-MauiApp.1-53bc9b9d-9d6a-45d4-8429-2a2761773502</UserSecretsId>
<UserSecretsId Condition="'$(IndividualLocalAuth)' == 'True'">aspnet-XmlEncodedAppName-53bc9b9d-9d6a-45d4-8429-2a2761773502</UserSecretsId>
<NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile>
</PropertyGroup>

Expand All @@ -16,8 +16,8 @@
<!--#endif -->
<!--#if (UseWebAssembly || IndividualLocalAuth) -->
<ItemGroup>
<ProjectReference Include="..\MauiApp.1.Web.Client\MauiApp.1.Web.Client.csproj" Condition="'$(UseWebAssembly)' == 'True'" />
<ProjectReference Include="..\MauiApp.1.Shared\MauiApp.1.Shared.csproj" Condition="'$(UseWebAssembly)' != 'True'" />
<ProjectReference Include="..\XmlEncodedAppName.Web.Client\XmlEncodedAppName.Web.Client.csproj" Condition="'$(UseWebAssembly)' == 'True'" />
<ProjectReference Include="..\XmlEncodedAppName.Shared\XmlEncodedAppName.Shared.csproj" Condition="'$(UseWebAssembly)' != 'True'" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="MS_COMPONENTS_WEBASSEMBLY_SERVER_VERSION" Condition="'$(UseWebAssembly)' == 'True'" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="${MicrosoftAspNetCoreDiagnosticsEntityFrameworkCoreVersion}" Condition="'$(IndividualLocalAuth)' == 'True'" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="${MicrosoftAspNetCoreIdentityEntityFrameworkCoreVersion}" Condition="'$(IndividualLocalAuth)' == 'True'" />
Expand All @@ -27,7 +27,7 @@
</ItemGroup>
<!--#else -->
<ItemGroup>
<ProjectReference Include="..\MauiApp.1.Shared\MauiApp.1.Shared.csproj" />
<ProjectReference Include="..\XmlEncodedAppName.Shared\XmlEncodedAppName.Shared.csproj" />
</ItemGroup>
<!--#endif -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MauiApp._1"
xmlns:shared="clr-namespace:MauiApp._1.Shared;assembly=MauiApp.1.Shared"
xmlns:shared="clr-namespace:MauiApp._1.Shared;assembly=XmlEncodedAppName.Shared"
x:Class="MauiApp._1.MainPage"
BackgroundColor="{DynamicResource PageBackgroundColor}">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<Nullable>enable</Nullable>

<!-- Display name -->
<ApplicationTitle>MauiApp.1</ApplicationTitle>
<ApplicationTitle>XmlEncodedAppName</ApplicationTitle>

<!-- App Identifier -->
<ApplicationId>com.companyname.mauiapp</ApplicationId>
Expand Down Expand Up @@ -64,7 +64,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\MauiApp.1.Shared\MauiApp.1.Shared.csproj" />
<ProjectReference Include="..\XmlEncodedAppName.Shared\XmlEncodedAppName.Shared.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="maui-application-id-placeholder" version="0.0.0" api-version="8" xmlns="http://tizen.org/ns/packages">
<profile name="common" />
<ui-application appid="maui-application-id-placeholder" exec="MauiApp.1.dll" multiple="false" nodisplay="false" taskmanage="true" type="dotnet" launch_mode="single">
<ui-application appid="maui-application-id-placeholder" exec="XmlEncodedAppName.dll" multiple="false" nodisplay="false" taskmanage="true" type="dotnet" launch_mode="single">
<label>maui-application-title-placeholder</label>
<icon>maui-appicon-placeholder</icon>
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MauiApp.1.WinUI.app"/>
<assemblyIdentity version="1.0.0.0" name="XmlEncodedAppName.WinUI.app"/>

<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ public void BuildMauiBlazorWebSolution(string framework, string config, string a
{
const string templateShortName = "maui-blazor-web";

var solutionProjectDir = TestDirectory;
var solutionProjectDir = TestDirectory + " & More";

var webAppProjectDir = Path.Combine(TestDirectory, Path.GetFileName(solutionProjectDir) + ".Web");
var webAppProjectDir = Path.Combine(solutionProjectDir, Path.GetFileName(solutionProjectDir) + ".Web");
var webAppProjectFile = Path.Combine(webAppProjectDir, $"{Path.GetFileName(webAppProjectDir)}.csproj");

var mauiAppProjectDir = Path.Combine(TestDirectory, Path.GetFileName(solutionProjectDir));
var mauiAppProjectDir = Path.Combine(solutionProjectDir, Path.GetFileName(solutionProjectDir));
var mauiAppProjectFile = Path.Combine(mauiAppProjectDir, $"{Path.GetFileName(mauiAppProjectDir)}.csproj");

TestContext.WriteLine($"Creating project in {solutionProjectDir}");
Expand Down

0 comments on commit da76906

Please sign in to comment.