Skip to content

Commit de9d1b5

Browse files
committed
Add project files.
1 parent 5115c2c commit de9d1b5

File tree

13 files changed

+218
-0
lines changed

13 files changed

+218
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.6.33723.286
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DoesntWorkInBlazorWasm", "BlazorWasmIssueWithArrayInitializationWithRelevantPrimitives\DoesntWorkInBlazorWasm.csproj", "{F9E4F58D-AD16-463B-B52C-65A934D1C0FD}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorksInConsole", "WorksInNonMono\WorksInConsole.csproj", "{D44B020C-4B7E-4BA5-A426-9715FBAE094E}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{F9E4F58D-AD16-463B-B52C-65A934D1C0FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{F9E4F58D-AD16-463B-B52C-65A934D1C0FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{F9E4F58D-AD16-463B-B52C-65A934D1C0FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{F9E4F58D-AD16-463B-B52C-65A934D1C0FD}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{D44B020C-4B7E-4BA5-A426-9715FBAE094E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{D44B020C-4B7E-4BA5-A426-9715FBAE094E}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{D44B020C-4B7E-4BA5-A426-9715FBAE094E}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{D44B020C-4B7E-4BA5-A426-9715FBAE094E}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {AA7EFBF5-8071-4864-9E38-C5B876F39AEE}
30+
EndGlobalSection
31+
EndGlobal
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Router AppAssembly="@typeof(App).Assembly">
2+
<Found Context="routeData">
3+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
4+
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
5+
</Found>
6+
<NotFound>
7+
<PageTitle>Not found</PageTitle>
8+
<LayoutView Layout="@typeof(MainLayout)">
9+
<p role="alert">Sorry, there's nothing at this address.</p>
10+
</LayoutView>
11+
</NotFound>
12+
</Router>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net7.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.5" />
11+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.5" PrivateAssets="all" />
12+
</ItemGroup>
13+
14+
</Project>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@inherits LayoutComponentBase
2+
3+
<main>
4+
@Body
5+
</main>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using DoesntWorkInBlazorWasm;
2+
using Microsoft.AspNetCore.Components.Web;
3+
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
4+
5+
var builder = WebAssemblyHostBuilder.CreateDefault(args);
6+
builder.RootComponents.Add<App>("#app");
7+
builder.RootComponents.Add<HeadOutlet>("head::after");
8+
9+
await builder.Build().RunAsync();
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"iisSettings": {
3+
"iisExpress": {
4+
"applicationUrl": "http://localhost:46998",
5+
"sslPort": 44308
6+
}
7+
},
8+
"profiles": {
9+
"http": {
10+
"commandName": "Project",
11+
"dotnetRunMessages": true,
12+
"launchBrowser": true,
13+
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
14+
"applicationUrl": "http://localhost:5220",
15+
"environmentVariables": {
16+
"ASPNETCORE_ENVIRONMENT": "Development"
17+
}
18+
},
19+
"https": {
20+
"commandName": "Project",
21+
"dotnetRunMessages": true,
22+
"launchBrowser": true,
23+
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
24+
"applicationUrl": "https://localhost:7219;http://localhost:5220",
25+
"environmentVariables": {
26+
"ASPNETCORE_ENVIRONMENT": "Development"
27+
}
28+
},
29+
"IIS Express": {
30+
"commandName": "IISExpress",
31+
"launchBrowser": true,
32+
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
33+
"environmentVariables": {
34+
"ASPNETCORE_ENVIRONMENT": "Development"
35+
}
36+
}
37+
}
38+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@using System.Net.Http
2+
@using System.Net.Http.Json
3+
@using Microsoft.AspNetCore.Components.Routing
4+
@using Microsoft.AspNetCore.Components.Web
5+
@using Microsoft.AspNetCore.Components.WebAssembly.Http
6+
@using Microsoft.JSInterop
7+
@using DoesntWorkInBlazorWasm
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@page "/"
2+
3+
<h1>Hello, world!</h1>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
namespace DoesntWorkInBlazorWasm.wwwroot.Pages;
2+
3+
public partial class Index
4+
{
5+
protected override void OnInitialized()
6+
{
7+
ReadOnlySpan<MyEnum> myEnums = new[]
8+
{
9+
MyEnum.A,
10+
MyEnum.B,
11+
MyEnum.C
12+
};
13+
Console.WriteLine(string.Join(", ", myEnums.ToArray()));
14+
base.OnInitialized();
15+
}
16+
17+
enum MyEnum
18+
{
19+
A,
20+
B,
21+
C
22+
}
23+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
h1:focus {
2+
outline: none;
3+
}
4+
5+
#blazor-error-ui {
6+
background: lightyellow;
7+
bottom: 0;
8+
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
9+
display: none;
10+
left: 0;
11+
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
12+
position: fixed;
13+
width: 100%;
14+
z-index: 1000;
15+
}
16+
17+
#blazor-error-ui .dismiss {
18+
cursor: pointer;
19+
position: absolute;
20+
right: 0.75rem;
21+
top: 0.5rem;
22+
}
23+
24+
.blazor-error-boundary {
25+
background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIG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DI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
26+
padding: 1rem 1rem 1rem 3.7rem;
27+
color: white;
28+
}
29+
30+
.blazor-error-boundary::after {
31+
content: "An error has occurred."
32+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<title>BlazorWasmIssueWithArrayInitializationWithRelevantPrimitives</title>
7+
<base href="/" />
8+
<link href="css/app.css" rel="stylesheet" />
9+
10+
<!-- If you add any scoped CSS files, uncomment the following to load them
11+
<link href="BlazorWasmIssueWithArrayInitializationWithRelevantPrimitives.styles.css" rel="stylesheet" /> -->
12+
</head>
13+
14+
<body>
15+
<div id="app">Loading...</div>
16+
17+
<div id="blazor-error-ui">
18+
An unhandled error has occurred.
19+
<a href="" class="reload">Reload</a>
20+
<a class="dismiss">🗙</a>
21+
</div>
22+
<script src="_framework/blazor.webassembly.js"></script>
23+
</body>
24+
25+
</html>

WorksInNonMono/Program.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ReadOnlySpan<MyEnum> myEnums = new[] { MyEnum.A, MyEnum.B, MyEnum.C };
2+
Console.WriteLine(string.Join(", ", myEnums.ToArray()));
3+
4+
enum MyEnum
5+
{
6+
A,
7+
B,
8+
C
9+
}

WorksInNonMono/WorksInConsole.csproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net7.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
</Project>

0 commit comments

Comments
 (0)