Skip to content
This repository was archived by the owner on Dec 24, 2020. It is now read-only.

MissingMethodException when mixing beta5 and beta7 packages #119

Closed
stephenstroud opened this issue Aug 11, 2015 · 11 comments
Closed

MissingMethodException when mixing beta5 and beta7 packages #119

stephenstroud opened this issue Aug 11, 2015 · 11 comments

Comments

@stephenstroud
Copy link

Hi @PinpointTownes hope you can help again.

I installed "AspNet.Security.OpenIdConnect.Server": "1.0.0-*" with the required dependencies

"Microsoft.AspNet.Authentication.OAuthBearer": "1.0.0-beta5",
"Microsoft.Framework.Caching.Abstractions": "1.0.0-beta7-11666",
"Microsoft.Framework.WebEncoders.Core": "1.0.0-beta7-11770",
"Microsoft.IdentityModel.Protocols.OpenIdConnect": "2.0.0-beta7-208040923",

However, when adding

"AspNet.Security.OpenIdConnect.Server": "1.0.0-*"
I get the below error. I've installed the latest and previous DNVM runtimes and restored the packages on each one however, I still get the error. Also tried older OpenIdConnect versions.

I tried with:
dnx-clr-win-x86.1.0.0-beta5
dnx-clr-win-x86.1.0.0-beta6
dnx-clr-win-x86.1.0.0-beta7-12331

if I remove "AspNet.Security.OpenIdConnect.Server": "1.0.0-*" it works. Maybe you experienced the same issue, any idea how I could fix this please?

System.MissingMethodException
Method not found: 'Boolean Microsoft.Framework.DependencyInjection.ServiceCollectionExtensions.TryAdd(Microsoft.Framework.DependencyInjection.IServiceCollection, Microsoft.Framework.DependencyInjection.ServiceDescriptor)'.

System.MissingMethodException: Method not found: 'Boolean Microsoft.Framework.DependencyInjection.ServiceCollectionExtensions.TryAdd(Microsoft.Framework.DependencyInjection.IServiceCollection, Microsoft.Framework.DependencyInjection.ServiceDescriptor)'.
at Microsoft.Framework.DependencyInjection.LoggingServiceCollectionExtensions.AddLogging(IServiceCollection services)
at Microsoft.AspNet.Hosting.WebHostBuilder.BuildHostingServices()
at Microsoft.AspNet.Hosting.WebHostBuilder.Build()
at Microsoft.AspNet.Loader.IIS.RuntimeHttpApplication.ApplicationStart(IHttpApplication application)
at Microsoft.AspNet.Loader.IIS.HttpApplicationBase.InvokeApplicationStart(IHttpApplication application)

@kevinchalet
Copy link
Member

You're referencing beta5 and beta7 packages in your project.json: since signatures have changed between beta5 and beta7, packages compiled with older dependencies won't work. You should try to migrate everything to the latest beta7 nightly builds.

Sadly, there's currently a "bug" caused by the fact various ASP.NET 5 packages reference CoreCLR packages that are not on MyGet/NuGet yet, so it might not work ATM: dotnet/aspnetcore#819

We're also impacted by massive naming changes introduced in dotnet/corefx that prevent our CI from working correctly: aspnet/Security#396. That said, this bug shouldn't impact you if you directly use the NuGet package, unless you use RSACryptoServiceProvider in your own code.

@kevinchalet
Copy link
Member

@Eilon hey! Any idea on when the CoreCLR packages will be referenced by the MyGet repository?

@stephenstroud
Copy link
Author

Okay thanks I see, so I'll use Beta6 for now, which version of AspNet.Security.OpenIdConnect.Server will work with Beta6? - forget that I'll wait for the fix and use directly. thanks

@kevinchalet
Copy link
Member

There's no version for beta6 release, but you can try 1.0.0-beta2-0252: it's the last version that targets beta6 nightly builds.

@kevinchalet
Copy link
Member

@stephenstroud FYI, the missing packages are now on the ASP.NET MyGet repository.
I just sent a commit to react to the crypto API changes introduced in CoreFX so it shouldn't be long before AppVeyor uploads a new package to our MyGet repository 😄

@Tratcher is still fixing the referenced to the old crypto packages in the different ASP.NET 5 packages, but using the old ones doesn't cause any issue in AspNet.Security.OpenIdConnect.Server.

@kevinchalet
Copy link
Member

The fixed package is on MyGet (1.0.0-beta2-0299): https://www.myget.org/F/aspnet-contrib/api/v2/package/AspNet.Security.OpenIdConnect.Server/1.0.0-beta2-0299 🎉 🎈

@kevinchalet kevinchalet changed the title Method not found: 'Boolean MissingMethodException when mixing beta5 and beta7 packages Aug 11, 2015
@kevinchalet
Copy link
Member

Okay I've aligned with Beta7 and working nicely, however, with 1.0.0-beta2-0299 I'm getting a Type Load Exception error. System.TypeLoadException Method 'get_IsReadOnly' in type 'Microsoft.AspNet.Loader.IIS.FeatureModel.NestedFeatureCollection' from assembly 'Microsoft.AspNet.Loader.IIS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.

Are you still seeing this bug? I'd bet it's caused by desynchronized
packages: make sure to update everything to the latest beta7 versions.

@stephenstroud
Copy link
Author

@PinpointTownes - This post pls... Yes, everything aligned see here
screen shot 2015-08-12 at 13 47 49
I haven't used * on the end of the dependencies as still causes an issue for MVC - see
aspnet/Mvc#2958

I've also reinstalled the DNX packages and runtimes in line with Beta7.
The error shown is:
screen shot 2015-08-12 at 13 51 41

@kevinchalet
Copy link
Member

This definitely sounds like a versioning issue. Try using floating versions 1.0.0-* (since beta7 has not been released yet). If it still doesn't work, try deleting the bin folder to make sure the VS tooling copies the latest IIS loader.

Does this bug reproduce with WebListener?

@stephenstroud
Copy link
Author

@PinpointTownes The issue was, Although I had changed the project properties to point at Beta7 I found that the Global.json file version was still pointing at Beta5. It tried downloading dnx-coreclr-win-x86.1.0.0-beta7 which didn't exist and failed over to dnx-coreclr-win-x86.1.0.0-beta5. So I ended up using { "sources": [ "src" ] } in there which made the project.lock.json match. Thanks for your help!

@kevinchalet
Copy link
Member

Great, glad you sorted it out! 😄

Feel free to share your thoughts/remarks and don't hesitate to file a new ticket if you still need help.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants