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

System.Io.FileLoadException: BCrypt.Net-Next #45

Closed
Revyn112 opened this issue Sep 20, 2019 · 7 comments
Closed

System.Io.FileLoadException: BCrypt.Net-Next #45

Revyn112 opened this issue Sep 20, 2019 · 7 comments
Assignees

Comments

@Revyn112
Copy link

With the update of netcore 3.0 to version v3.0.0-rc1 BCrypt.Net-Next gives sometimes this error:

Unhandled Exception: System.IO.FileLoadException - System.IO.FileLoadException: Could not load file or assembly 'BCrypt.Net-Next, Version=3.1.3.0, Culture=neutral, Publi
cKeyToken=1e11be04b6288443'. An operation is not legal in the current state. (0x80131509)
File name: 'BCrypt.Net-Next, Version=3.1.3.0, Culture=neutral, PublicKeyToken=1e11be04b6288443'
 ---> System.InvalidOperationException: AssemblyLoadContext is unloading or was already unloaded.
   at System.Runtime.Loader.AssemblyLoadContext.VerifyIsAlive()
   at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
   at AltV.Net.Host.ResourceAssemblyLoadContext.Load(AssemblyName assemblyName)
   at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingLoad(AssemblyName assemblyName)
   at System.Runtime.Loader.AssemblyLoadContext.Resolve(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName)
   at Services.ConnectService.GetAccountByCredentialsAsync(String username, String password)
@ChrisMcKee
Copy link
Collaborator

That's an odd one. Any specifics of the solution or a small repro would be handy.

Ill release a new build later with support for 3
https://stackoverflow.com/questions/58019224/could-not-load-file-or-assembly

Looks like 3 will be as much fun as 1 and 2 😂

@ChrisMcKee ChrisMcKee self-assigned this Sep 21, 2019
@ChrisMcKee
Copy link
Collaborator

https://www.nuget.org/packages/BCrypt.Net-Next/3.2.0

I've built 3.2 against netstandard 2.1 for NetCore3; tests pass on my test rig, but the automated ci (appveyor) doesnt support the RC yet.

@Revyn112
Copy link
Author

Its hard to reproduce, because this error comes only sometimes, after a restart of the application there is mostly no problem.

@Revyn112
Copy link
Author

I'll test it and provide feedback ;)

@ChrisMcKee
Copy link
Collaborator

ChrisMcKee commented Sep 21, 2019

Thanks also note the SO mention.

You must use exactly the same .NET Core, ASP.NET Core, etc. Make sure all packages from dotnet or aspnet are rc1 as for now. If some dependencies (including direct and indirect) in your project depend on any 2.2 packages that are from dotnet or aspnet and has a 3.0 new version, reference them as 3.0 rc1 version from your own project explicitly.

I know my machine was a hot mess of previews when I was dealing with DNX/V1/V2 😆

@Revyn112
Copy link
Author

Hi Chris,

we found out, that the problem is not related to BCrypt itself :D but thanks for your fast answer and netcore 3 support!

Issue:
FabianTerhorst/coreclr-module#58

@ChrisMcKee
Copy link
Collaborator

Cool; the type of exception seemed unlikely to be related, but hell you never know with a major release.
On the upside you pushed me to sort the netstandard 2.1 bit 👍

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

No branches or pull requests

2 participants