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
64 changes: 64 additions & 0 deletions src/Assets/TestProjects/BlazorWasmHosted50/BlazorWasmHosted50.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.0.0
MinimumVisualStudioVersion = 16.0.0.0
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorWasmHosted50.Server", "Server\BlazorWasmHosted50.Server.csproj", "{CA47C471-41C9-4BEC-8B8D-3E777A0CF32D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorWasmHosted50.Client", "Client\BlazorWasmHosted50.Client.csproj", "{CDAA3973-2E20-4D5A-936A-BC87CBE71125}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorWasmHosted50.Shared", "Shared\BlazorWasmHosted50.Shared.csproj", "{E441FD26-40C6-4365-9CE8-85A1A503AB92}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{CDAA3973-2E20-4D5A-936A-BC87CBE71125}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CDAA3973-2E20-4D5A-936A-BC87CBE71125}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CDAA3973-2E20-4D5A-936A-BC87CBE71125}.Debug|x64.ActiveCfg = Debug|Any CPU
{CDAA3973-2E20-4D5A-936A-BC87CBE71125}.Debug|x64.Build.0 = Debug|Any CPU
{CDAA3973-2E20-4D5A-936A-BC87CBE71125}.Debug|x86.ActiveCfg = Debug|Any CPU
{CDAA3973-2E20-4D5A-936A-BC87CBE71125}.Debug|x86.Build.0 = Debug|Any CPU
{CDAA3973-2E20-4D5A-936A-BC87CBE71125}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CDAA3973-2E20-4D5A-936A-BC87CBE71125}.Release|Any CPU.Build.0 = Release|Any CPU
{CDAA3973-2E20-4D5A-936A-BC87CBE71125}.Release|x64.ActiveCfg = Release|Any CPU
{CDAA3973-2E20-4D5A-936A-BC87CBE71125}.Release|x64.Build.0 = Release|Any CPU
{CDAA3973-2E20-4D5A-936A-BC87CBE71125}.Release|x86.ActiveCfg = Release|Any CPU
{CDAA3973-2E20-4D5A-936A-BC87CBE71125}.Release|x86.Build.0 = Release|Any CPU
{CA47C471-41C9-4BEC-8B8D-3E777A0CF32D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CA47C471-41C9-4BEC-8B8D-3E777A0CF32D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CA47C471-41C9-4BEC-8B8D-3E777A0CF32D}.Debug|x64.ActiveCfg = Debug|Any CPU
{CA47C471-41C9-4BEC-8B8D-3E777A0CF32D}.Debug|x64.Build.0 = Debug|Any CPU
{CA47C471-41C9-4BEC-8B8D-3E777A0CF32D}.Debug|x86.ActiveCfg = Debug|Any CPU
{CA47C471-41C9-4BEC-8B8D-3E777A0CF32D}.Debug|x86.Build.0 = Debug|Any CPU
{CA47C471-41C9-4BEC-8B8D-3E777A0CF32D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CA47C471-41C9-4BEC-8B8D-3E777A0CF32D}.Release|Any CPU.Build.0 = Release|Any CPU
{CA47C471-41C9-4BEC-8B8D-3E777A0CF32D}.Release|x64.ActiveCfg = Release|Any CPU
{CA47C471-41C9-4BEC-8B8D-3E777A0CF32D}.Release|x64.Build.0 = Release|Any CPU
{CA47C471-41C9-4BEC-8B8D-3E777A0CF32D}.Release|x86.ActiveCfg = Release|Any CPU
{CA47C471-41C9-4BEC-8B8D-3E777A0CF32D}.Release|x86.Build.0 = Release|Any CPU
{E441FD26-40C6-4365-9CE8-85A1A503AB92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E441FD26-40C6-4365-9CE8-85A1A503AB92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E441FD26-40C6-4365-9CE8-85A1A503AB92}.Debug|x64.ActiveCfg = Debug|Any CPU
{E441FD26-40C6-4365-9CE8-85A1A503AB92}.Debug|x64.Build.0 = Debug|Any CPU
{E441FD26-40C6-4365-9CE8-85A1A503AB92}.Debug|x86.ActiveCfg = Debug|Any CPU
{E441FD26-40C6-4365-9CE8-85A1A503AB92}.Debug|x86.Build.0 = Debug|Any CPU
{E441FD26-40C6-4365-9CE8-85A1A503AB92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E441FD26-40C6-4365-9CE8-85A1A503AB92}.Release|Any CPU.Build.0 = Release|Any CPU
{E441FD26-40C6-4365-9CE8-85A1A503AB92}.Release|x64.ActiveCfg = Release|Any CPU
{E441FD26-40C6-4365-9CE8-85A1A503AB92}.Release|x64.Build.0 = Release|Any CPU
{E441FD26-40C6-4365-9CE8-85A1A503AB92}.Release|x86.ActiveCfg = Release|Any CPU
{E441FD26-40C6-4365-9CE8-85A1A503AB92}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B980EE58-B568-44DD-B940-B7C784882467}
EndGlobalSection
EndGlobal
10 changes: 10 additions & 0 deletions src/Assets/TestProjects/BlazorWasmHosted50/Client/App.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
</Found>
<NotFound>
<LayoutView Layout="@typeof(MainLayout)">
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.14" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.14" PrivateAssets="all" />
<PackageReference Include="System.Net.Http.Json" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Shared\BlazorWasmHosted50.Shared.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@page "/"

<h1>Hello, world!</h1>

Welcome to your new app.

<SurveyPrompt Title="How is Blazor working for you?" />
22 changes: 22 additions & 0 deletions src/Assets/TestProjects/BlazorWasmHosted50/Client/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.Net.Http;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Text;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

namespace BlazorWasmHosted50.Client
{
public class Program
{
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
await builder.Build().RunAsync();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@inherits LayoutComponentBase

<div class="page">
<div class="main">
<div class="top-row px-4">
<a href="http://blazor.net" target="_blank" class="ml-md-auto">About</a>
</div>

<div class="content px-4">
@Body
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
.page {
position: relative;
display: flex;
flex-direction: column;
}

.main {
flex: 1;
}

.sidebar {
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}

.top-row {
background-color: #f7f7f7;
border-bottom: 1px solid #d6d5d5;
justify-content: flex-end;
height: 3.5rem;
display: flex;
align-items: center;
}

.top-row ::deep a, .top-row .btn-link {
white-space: nowrap;
margin-left: 1.5rem;
}

.top-row a:first-child {
overflow: hidden;
text-overflow: ellipsis;
}

@media (max-width: 640.98px) {
.top-row:not(.auth) {
display: none;
}

.top-row.auth {
justify-content: space-between;
}

.top-row a, .top-row .btn-link {
margin-left: 0;
}
}

@media (min-width: 641px) {
.page {
flex-direction: row;
}

.sidebar {
width: 250px;
height: 100vh;
position: sticky;
top: 0;
}

.top-row {
position: sticky;
top: 0;
z-index: 1;
}

.main > div {
padding-left: 2rem !important;
padding-right: 1.5rem !important;
}
}
10 changes: 10 additions & 0 deletions src/Assets/TestProjects/BlazorWasmHosted50/Client/_Imports.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@using System.Net.Http
@using System.Net.Http.Json
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.AspNetCore.Components.WebAssembly.Http
@using Microsoft.JSInterop
@using BlazorWasmHosted50.Client
@using BlazorWasmHosted50.Client.Shared
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>

<head>
<base href="/" />
<link href="css/app.css" rel="stylesheet" />
<link href="BlazorWasmHosted50.Client.styles.css" rel="stylesheet" />
</head>

<body>
<div id="app">Loading...</div>

<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.webassembly.js"></script>
</body>

</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="5.0.14" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Client\BlazorWasmHosted50.Client.csproj" />
<ProjectReference Include="..\Shared\BlazorWasmHosted50.Shared.csproj" />
</ItemGroup>


</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using BlazorWasmHosted50.Shared;

namespace BlazorWasmHosted50.Server.Controllers
{
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};

private readonly ILogger<WeatherForecastController> _logger;

public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
}

[HttpGet]
public IEnumerable<WeatherForecast> Get()
{
var rng = new Random();
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateTime.Now.AddDays(index),
TemperatureC = rng.Next(-20, 55),
Summary = Summaries[rng.Next(Summaries.Length)]
})
.ToArray();
}
}
}
26 changes: 26 additions & 0 deletions src/Assets/TestProjects/BlazorWasmHosted50/Server/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

namespace BlazorWasmHosted50.Server
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}

public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:3082",
"sslPort": 44342
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"BlazorWasmHosted50.Server": {
"commandName": "Project",
"dotnetRunMessages": "true",
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
Loading