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

Upgrading dependencies seems to cause issues #73

Closed
MarkDaviesEsendex opened this issue Nov 23, 2016 · 1 comment
Closed

Upgrading dependencies seems to cause issues #73

MarkDaviesEsendex opened this issue Nov 23, 2016 · 1 comment

Comments

@MarkDaviesEsendex
Copy link

Going back to pull-request #71 I have managed to recreate a similar issue, I have created a repository here

When running the test I get the error message:

System.IO.FileLoadException : Could not load file or assembly 'System.IO.Abstractions, Version=1.4.0.86, Culture=neutral, PublicKeyToken=d480b5b72fb413da' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at PactNet.Infrastructure.Logging.LocalRollingLogFileMessageHandler..ctor(String logFilePath)
at PactNet.Infrastructure.Logging.LocalLogProvider.AddLogger(String logDir, String loggerNameSeed, String logFileNameTemplate) in C:\projects\pact-net\PactNet\Infrastructure\Logging\LocalLogProvider.cs:line 36
at PactNet.Infrastructure.Logging.LocalLogProvider.AddLogger(String logDir, String loggerNameSeed, String logFileNameTemplate) in C:\projects\pact-net\PactNet\Infrastructure\Logging\LocalLogProvider.cs:line 37
at PactNet.Infrastructure.Logging.LocalLogProvider.AddLogger(String logDir, String loggerNameSeed, String logFileNameTemplate) in C:\projects\pact-net\PactNet\Infrastructure\Logging\LocalLogProvider.cs:line 37
at PactNet.Infrastructure.Logging.LocalLogProvider.AddLogger(String logDir, String loggerNameSeed, String logFileNameTemplate) in C:\projects\pact-net\PactNet\Infrastructure\Logging\LocalLogProvider.cs:line 37
at PactNet.Mocks.MockHttpService.Nancy.NancyHttpHost..ctor(Uri baseUri, String providerName, PactConfig config, Boolean bindOnAllAdapters) in C:\projects\pact-net\PactNet\Mocks\MockHttpService\Nancy\NancyHttpHost.cs:line 27
at PactNet.Mocks.MockHttpService.MockProviderService.<>c__DisplayClass13_0.<.ctor>b__0(Uri baseUri) in C:\projects\pact-net\PactNet\Mocks\MockHttpService\MockProviderService.cs:line 45
at PactNet.Mocks.MockHttpService.MockProviderService.Start() in C:\projects\pact-net\PactNet\Mocks\MockHttpService\MockProviderService.cs:line 129
at PactNet.PactBuilder.MockService(Int32 port, JsonSerializerSettings jsonSerializerSettings, Boolean enableSsl, Boolean bindOnAllAdapters) in C:\projects\pact-net\PactNet\PactBuilder.cs:line 78
at PactNet.PactBuilder.MockService(Int32 port, Boolean enableSsl, Boolean bindOnAllAdapters) in C:\projects\pact-net\PactNet\PactBuilder.cs:line 58
at PactNetTests.ContractTest.SetUp()

@neilcampbell
Copy link
Member

neilcampbell commented Nov 25, 2016

OK, so I have worked out why this is happening for only System.IO.Abstractions.
Basically it is because the assembly binding redirect is not being added to the app.config when installing the latest package.

This should happen automatically however it is not, because from version 2.0.0.124 (of System.IO.Abstractions see TestableIO/System.IO.Abstractions#178) the assembly has not been correctly signed. As such the binding redirect will not be auto created on package install and the result is that runtime exception.

The System.IO.Abstractions team are looking into this now (see TestableIO/System.IO.Abstractions#182), however in the meantime you will just need to add the correct binding redirect manually.

Something like the below should work.

<dependentAssembly>
  <assemblyIdentity name="System.IO.Abstractions" publicKeyToken="d480b5b72fb413da" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-2.0.0.138" newVersion="2.0.0.138" />
</dependentAssembly>

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