question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Blazor server side: dotnet run fails with InvalidOperationException on MacOS

See original GitHub issue

Describe the bug

dotnet run fails with the follwing exception on MacOS for blazorserverside projects

System.InvalidOperationException: Could not load the embedded file manifest 'Microsoft.Extensions.FileProviders.Embedded.Manifest.xml' for assembly 'Microsoft.AspNetCore.Components.Server'.
   at Microsoft.Extensions.FileProviders.Embedded.Manifest.ManifestParser.Parse(Assembly assembly, String name)
   at Microsoft.Extensions.FileProviders.ManifestEmbeddedFileProvider..ctor(Assembly assembly)
   at Microsoft.AspNetCore.Components.Server.ConfigureStaticFilesOptions.PostConfigure(String name, StaticFileOptions options)
   at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name)
   at Microsoft.Extensions.Options.OptionsManager`1.<>c__DisplayClass5_0.<Get>b__0()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.get_Value()
   at Microsoft.Extensions.Options.OptionsCache`1.GetOrAdd(String name, Func`1 createOptions)
   at Microsoft.Extensions.Options.OptionsManager`1.Get(String name)
   at Microsoft.Extensions.Options.OptionsManager`1.get_Value()
   at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware..ctor(RequestDelegate next, IWebHostEnvironment hostingEnv, IOptions`1 options, ILoggerFactory loggerFactory)
--- End of stack trace from previous location where exception was thrown ---

To Reproduce

Steps to reproduce the behavior:

  1. Get the latest preview4 sdk from core-sdk
  2. dotnet new blazorserverside
  3. dotnet run

Expected behavior

The app runs successfully

Additional context

Note: This doesn't happen for client-side blazor projects.

.NET Core SDK (reflecting any global.json):
 Version:   3.0.100-preview4-011216
 Commit:    19c844a865

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.14
 OS Platform: Darwin
 RID:         osx.10.14-x64
 Base Path:   /usr/local/share/dotnet/sdk/3.0.100-preview4-011216/

Host (useful for support):
  Version: 3.0.0-preview4-27613-07
  Commit:  5c329c85ae

cc @danroth27 @rynowak

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
danroth27commented, Apr 26, 2019

@guardrex it will be released with preview 5, but you can try out a nightly build.

Daniel Roth

2reactions
kattungacommented, Apr 19, 2019

Same problem in linux

SDK de .NET Core (reflejando cualquier global.json):
 Version:   3.0.100-preview4-011223
 Commit:    118dd862c8

Entorno de tiempo de ejecución:
 OS Name:     ubuntu
 OS Version:  16.04
 OS Platform: Linux
 RID:         ubuntu.16.04-x64
 Base Path:   /snap/dotnet-sdk/36/sdk/3.0.100-preview4-011223/

Host (useful for support):
  Version: 3.0.0-preview4-27615-11
  Commit:  ee54d4cbd2

.NET Core SDKs installed:
  3.0.100-preview4-011223 [/snap/dotnet-sdk/36/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.0.0-preview4-19216-03 [/snap/dotnet-sdk/36/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.0.0-preview4-27615-11 [/snap/dotnet-sdk/36/shared/Microsoft.NETCore.App]

Is there any workaround?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Blazor server side: dotnet run fails with ...
Describe the bug dotnet run fails with the follwing exception on MacOS for blazorserverside projects System.InvalidOperationException: Could ...
Read more >
c# - Blazor Server - System.InvalidOperationException is ...
I'm developing a application on Blazor Server (.NET 6). This exception occur a lot of times. But this exception occur in each page...
Read more >
Blazor server app won't run reliably from Mac Visual Studio
I have a Blazor server app in Mac Visual Studio 2019. ... If it doesn't work with dotnet run, then there is an...
Read more >
Blazor FAQ - Troubleshooting
While upgrading Blazor applications, you many encounter these issues. You have to do the following changes to properly run the application: Update all...
Read more >
Handle errors in ASP.NET Core Blazor apps
This article describes how Blazor manages unhandled exceptions and how to develop apps that detect and handle errors.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found