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

Failed to reflect on the current domain's Assemblies while searching for plugins #172

Open
simonsag opened this issue Aug 7, 2015 · 19 comments

Comments

@simonsag
Copy link

simonsag commented Aug 7, 2015

Hi,

I am using Umbraco web application, using MVC 4. I have installed the package to try to get the social networking login authentication works. I gone through step by step. As soon as I tried to click on the redirection /authentication/redirect/Facebook/ for example, the following error is thrown:

untitled

I do not know how I am going to solve the issue.. because I cannot yet update to MVC5 since Umbraco does not support it yet.

Does anybody has a solution?

thank you.

@PureKrome
Copy link
Member

ref #144 and #168

@simonsag
Copy link
Author

simonsag commented Aug 7, 2015

Hi PureKrome,

I didn't actually understood exactly what I should suppose to do. Also, I have started to begin it from scratch and installed DotNetOAuth and also Microsoft.WebPages.OAtuh Library.. but again, the same error is occurring :/

Could not load file or assembly 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Any help please?

Thank you in advance.

@PureKrome
Copy link
Member

Problem is related to those 2 issues, which is the fact that the code uses reflection to auto find any custom providers (eg. custom dll that is for linked in or steam or whatever..).

Now, the reflection is finding some of the mvc-simple-authentication libraries ... which have a dependency on the razor 3. and you don't have that.

so you either need to update to razor 3+ or maybe try assembly redirect bindings.

question: what version of razor do you have installed? (check your packages.config file).

@phillip-haydon
Copy link
Member

Which package did you install. If if you installed the latest package you probably forced your project to upgrade to MVC 5

You should install this one: http://www.nuget.org/packages/SimpleAuthentication.Mvc4/

@simonsag
Copy link
Author

simonsag commented Aug 7, 2015

As I told you, I tried to create a new MVC application and try to replicate it on my Umbraco project.. and after a get the references from OAuth etc.. I got again the same error.

If I want again to use your package, what should I do exactly? Please.

@simonsag
Copy link
Author

simonsag commented Aug 7, 2015

Razor version: 2.0.30506.0

@PureKrome
Copy link
Member

@simonsag did you try using SimpleAuthentication.MVC4 ?

Install-Package SimpleAuthentication.Mvc4

@simonsag
Copy link
Author

simonsag commented Aug 7, 2015

Yes, but it was throwing an error and does not let me install it.. and then I installed through Nuget Manager...and not from console..

@PureKrome
Copy link
Member

what was the error? (screen shot)?

what version of MVC did you try and install when you did File->New Project thingy?

@simonsag
Copy link
Author

simonsag commented Aug 7, 2015

just a normal MVC4 project.. since it has the social networking already incorporated..

@PureKrome
Copy link
Member

screen shot please.

@simonsag
Copy link
Author

simonsag commented Aug 7, 2015

No errors. now. but I installed this one.

untitled

@PureKrome
Copy link
Member

... and .... did you get any runtime errors?

@simonsag
Copy link
Author

simonsag commented Aug 7, 2015

let me check again.. because I have tried on another replica project

@PureKrome
Copy link
Member

FWIW, I just did the following:-

  • File -> New Project -> ASP.NET Web Application -> Empty
  • Install-Package Microsoft.AspNet.Mvc -Version 4.0.40804 (most recent version of MVC4)
  • Install-Package SimpleAuthentication.Mvc4

and the installs worked. I need to wire stuff up, which i didn't bother .. but just wanted to check that the nugets can install ok.

@simonsag
Copy link
Author

simonsag commented Aug 7, 2015

The same error :/

Even my umbraco CMS, has stopped working when I installed AutoFac and AutoFac MVC 4 Integration

@simonsag
Copy link
Author

simonsag commented Aug 7, 2015

This is where I am doing the dependency injection..which when debug, it is accessing it.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.Mvc;
using Autofac;
using Autofac.Integration.Mvc;
using SimpleAuthentication.Core;
using SimpleAuthentication.Mvc;
using SimpleAuthentication.Mvc.Caching;
using Umbraco.Forms.Mvc;

namespace App_Code
{
public class Global : Umbraco.Web.UmbracoApplication
{
protected override void OnApplicationStarted(object sender, EventArgs e)
{
base.OnApplicationStarted(sender, e);

        var builder = new ContainerBuilder();

        builder.RegisterType<MyAuthenticationCallbackProvider>().As<IAuthenticationCallbackProvider>();
        builder.RegisterControllers(typeof(MvcApplication).Assembly);
        builder.RegisterControllers(typeof(SimpleAuthenticationController).Assembly);
        builder.RegisterType<CookieCache>().As<ICache>();

        var container = builder.Build();
        DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
    }
}

}

@phillip-haydon
Copy link
Member

App_Code?

That's a Web Site project... We have never tested it with a Web Site, and if it doesn't work in a Web Site project, we would never support it anyway. It's a feature that should have been removed from Visual Studio a long time ago.

@simonsag
Copy link
Author

simonsag commented Aug 7, 2015

I am using Umbraco...as a CMS platform..It should not make a difference..In the App_code.. there is only my own classes.

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