-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add .NET MAUI Blazor Hybrid + Web App solution template #21867
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
To see the output of each template variation, check out this repo: https://github.com/Eilon/MauiBlazorWebSolution/tree/sample-code It includes every combination of:
So navigate to the appropriate sub-folder, and see what you'd get with this template. To view it in the form of a PR (for easier commenting), go to Eilon/MauiBlazorWebSolution#1 cc @javiercn |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
@@ -15,7 +16,7 @@ public class BaseBuildTest | |||
public const string MauiVersionCurrent = "8.0.0-rc.1.9171"; // this should not be the same as the last release | |||
public const string MauiVersionPrevious = "7.0.86"; // this should not be the same version as the default. aka: MicrosoftMauiPreviousDotNetReleasedVersion in eng/Versions.props | |||
|
|||
char[] invalidChars = { '{', '}', '(', ')', '$', ':', ';', '\"', '\'', ',', '=', '.', '-', }; | |||
char[] invalidChars = { '{', '}', '(', ')', '$', ':', ';', '\"', '\'', ',', '=', '.', '-', ' ', }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was to work around a bug that I need to investigate further. Once I know more I will file a bug about spaces in certain paths. The bug is unrelated to this change, but this change runs into the bug and causes tests to fail.
if (result.Length > 20) | ||
{ | ||
// If the test name is too long, hash it to avoid path length issues | ||
result = result.Substring(0, 15) + Convert.ToString(Math.Abs(string.GetHashCode(result.AsSpan(), StringComparison.Ordinal)), CultureInfo.InvariantCulture); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to work around Windows max_path. Some of the new template tests have extremely long names due to the pattern of using the test name + every parameter as part of the test folder name. This change makes long paths significantly shorter by hashing part of it.
Closing this PR. Use #22234. |
Description of Change
This adds a new template to
dotnet new
and in Visual Studio that creates a solution with .NET MAUI Blazor Hybrid app with a Blazor Web app, which share common code in a Razor Class Library project.Here's what you'll see from the command line:
And from VS you get this template:
With these options:
And here's what the rough layout of files looks like:
And when you run the apps they look the same (because all the UI components are shared) - and include additional sample code for an
IFormFactor
interface to show how to write platform-specific services:Most of the options from the Blazor Web project template are also available in this new template.
Issues Fixed
Fixes #1069