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 on builder.Build() #587

Closed
damooooooooooh opened this issue Oct 17, 2014 · 2 comments
Closed

System.IO.FileLoadException on builder.Build() #587

damooooooooooh opened this issue Oct 17, 2014 · 2 comments

Comments

@damooooooooooh
Copy link

After upgrading to Web Api 2.2 I get the following issue on calling IContainer container = builder.Build();

An exception of type 'System.IO.FileLoadException' occurred in Autofac.dll but was not handled in user code

Additional information: Could not load file or assembly 'Autofac.Integration.WebApi, Version=3.0.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I am using
Autofac.WebApi2 3.4.0
System.Web.Http 5.2.2.0

@tillig
Copy link
Member

tillig commented Oct 17, 2014

Add a binding redirect to your web.config to redirect requests for version 3.0.0.0 to 3.4.0.0. Sometimes NuGet forgets to add it for you.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="Autofac.Integration.WebApi"
                                  publicKeyToken="17863af14b0044da"
                                  culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-3.4.0.0"
                                 newVersion="3.4.0.0" />
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>

@damooooooooooh
Copy link
Author

Just the ticket. Thanks!

Sent from my iPhone

On 17 Oct 2014, at 23:07, Travis Illig notifications@github.com wrote:

Add a binding redirect to your web.config to redirect requests for version 3.0.0.0 to 3.4.0.0. Sometimes NuGet forgets to add it for you.

— Reply to this email directly or view it on GitHub.

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

2 participants