Skip to content
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

Blazor server side: dotnet run fails with InvalidOperationException on MacOS #9402

Closed
ajaybhargavb opened this Issue Apr 15, 2019 · 9 comments

Comments

@ajaybhargavb
Copy link
Member

ajaybhargavb commented Apr 15, 2019

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

@ajaybhargavb

This comment has been minimized.

Copy link
Member Author

ajaybhargavb commented Apr 16, 2019

Reassigning it to @pranavkm as he already has a PR out to fix this.

@ajaybhargavb ajaybhargavb moved this from To do to In progress in Razor Components Apr 16, 2019

@pranavkm pranavkm added the cost: S label Apr 16, 2019

Razor Components automation moved this from In progress to Done Apr 17, 2019

pranavkm added a commit that referenced this issue Apr 17, 2019

Always fully build Components.Server.csproj (#9421)
* Always fully build Components.Server.csproj

* Use pre-built js files instead of building on the fly
* Use a sourcemap file for Debug. .gitignore sourcemap files
* Install nodejs on CodeCheck agents

Fixes #9402
@pranavkm

This comment has been minimized.

Copy link
Member

pranavkm commented Apr 17, 2019

Changes are in. Leaving open for verification.

@kattunga

This comment has been minimized.

Copy link

kattunga commented 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?

@danroth27

This comment has been minimized.

Copy link
Member

danroth27 commented Apr 19, 2019

@kattunga Yes, unfortunately this is a known issue with the Preview 4 release. It will be fixed in the next preview in a couple of weeks. There isn't a known workaround at this time, but if we come up with one we will update the known issues doc accordingly. The client-side Blazor templates should work fine though.

Razor Components automation moved this from In progress to Done Apr 19, 2019

@pranavkm pranavkm added 3 - Done and removed 2 - Working labels Apr 19, 2019

@tn-5

This comment has been minimized.

Copy link

tn-5 commented Apr 19, 2019

[macOS - 3.0.100-preview5-011463]
While it does not give the exception on startup in the latest nightly preview it still does not work. The exception now occurs on the "blazorserverside" template project as soon as one clicks on the counter:
fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
An unhandled exception has occurred while executing the request.
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Extensions.FileProviders.Embedded.Manifest.ManifestFileInfo.EnsureLength()
at Microsoft.Extensions.FileProviders.Embedded.Manifest.ManifestFileInfo.get_Length()
at Microsoft.AspNetCore.StaticFiles.StaticFileContext.LookupFileInfo()
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

@ajaybhargavb

This comment has been minimized.

Copy link
Member Author

ajaybhargavb commented Apr 19, 2019

@tn-5, we are aware of this issue. A fix for this has already been merged #9527. It will be available on an upcoming build.

@tn-5

This comment has been minimized.

Copy link

tn-5 commented Apr 19, 2019

thx

@guardrex

This comment has been minimized.

Copy link
Contributor

guardrex commented Apr 19, 2019

@ajaybhargavb "upcoming build" ... does that mean Pre5, or sooner than that?

@danroth27

This comment has been minimized.

Copy link
Member

danroth27 commented Apr 19, 2019

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

Daniel Roth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.