Skip to content

FileLoadException on IServiceCollection.AddReact() in beta6 #153

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

Closed
TomGroeneboer opened this issue Aug 6, 2015 · 9 comments
Closed

FileLoadException on IServiceCollection.AddReact() in beta6 #153

TomGroeneboer opened this issue Aug 6, 2015 · 9 comments

Comments

@TomGroeneboer
Copy link

Hi guys,

I'm getting a FileLoadException on services.AddReact() in the ConfigureServices method. Does someone else have this problem? And knows how to fix it? :D

Thanks!

@TomGroeneboer
Copy link
Author

I see that there were updates to project.json 2 days ago regarding to beta6, but this isn't pushed to NuGet yet, right? Maybe that's the problem?

@Daniel15
Copy link
Member

Daniel15 commented Aug 6, 2015

What's the full message and stack trace for the exception?

@TomGroeneboer
Copy link
Author

Stacktrace:

at React.AspNet.ReactServiceCollectionExtensions.AddReact(IServiceCollection services)
at React.Startup.ConfigureServices(IServiceCollection services) in F:\React\Startup.cs:line 12

Error message:
Could not load file or assembly 'React, Version=1.5.0.0, Culture=neutral, PublicKeyToken=9aed67b161f7db78' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)

@TomGroeneboer
Copy link
Author

I saw you updated the package to version 1.5.4, I still have the problem with that one...

@Daniel15
Copy link
Member

Daniel15 commented Aug 7, 2015

That is really strange as the library is strongly-named, so an "A strongly-named assembly is required" error doesn't really make sense. Do you get that error on a brand new ASP.NET 5 site? I can't replicate it on a new site in Visual Studio. What .NET version are you using?

@TomGroeneboer
Copy link
Author

Yeah true, it is really strange. I'm currently using the clr-x86-beta6 .net version. I'm creating an empty ASP.NET application (because we don't use MVC).

@jongalloway
Copy link

I'm seeing the same error with 1.5.4 with ASP.NET 5 beta7.

I run into the same issue going through the basic walkthrough on ASP.NET MVC 5 (.NET 4.x) using the 1.5.4 version.

Error message:
System.IO.FileLoadException was unhandled by user code
FileName=React, Version=1.5.0.0, Culture=neutral, PublicKeyToken=9aed67b161f7db78
FusionLog=""
HResult=-2146234300
Message=Could not load file or assembly 'React, Version=1.5.0.0, Culture=neutral, PublicKeyToken=9aed67b161f7db78' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)
Source=React.AspNet
StackTrace:
at React.AspNet.ReactServiceCollectionExtensions.AddReact(IServiceCollection services)
at React.Startup.ConfigureServices(IServiceCollection services) in d:\Users\Jon\documents\visual studio 14\Projects\React\src\React\Startup.cs:line 75
InnerException:
HResult=-2146234300
Message=A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)
InnerException:

@Daniel15
Copy link
Member

This is really strange. I just posted in the ASP.NET home repo (dotnet/aspnetcore#923) to see if the ASP.NET team have any ideas.

Edit: Looks like there's an issue at dotnet/aspnetcore#800 for it

Note that the error message says it can't find 1.5.0.0 while the version number is 1.5.4.

This is expected, I only set AssemblyVersion to Major.Minor (eg. 1.5) as bugfix releases are API-compatible, so you can upgrade 1.5.3 to 1.5.4 without needing an assembly binding for code that was compiled against 1.5.3.

@Daniel15
Copy link
Member

At the moment it looks like this happens if the site is called "React", as it conflicts with ReactJS.NET's assembly name (which is also called "React"). Give your site another name and this won't happen any more :) Let's follow up in dotnet/aspnetcore#800.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants