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

Cannot get FsUnit.Xunit working in VS 2012 #3

Closed
PatrickMcDonald opened this issue Sep 6, 2012 · 2 comments
Closed

Cannot get FsUnit.Xunit working in VS 2012 #3

PatrickMcDonald opened this issue Sep 6, 2012 · 2 comments

Comments

@PatrickMcDonald
Copy link

  1. Create a new F# Library project
  2. From Package Manager Console, Install-Package FsUnit.xUnit
  3. Run Test(s) (using TestDriven.NET)

------ Test started: Assembly: Library1.dll ------

Test 'Library1.Tests.Given a LightBulb that has had its state set to true.when I convert it to a string it becomes "On".' failed:
System.IO.FileLoadException : Could not load file or assembly 'NHamcrest, Version=1.2.1.0, Culture=neutral, PublicKeyToken=31c3ea0b6fcf8c4a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at Library1.Tests.Given a LightBulb that has had its state set to true.when I convert it to a string it becomes "On".()

Test 'Library1.Tests.Given a LightBulb that has had its state set to true.when I ask whether it is On it answers true.' failed:
System.IO.FileLoadException : Could not load file or assembly 'NHamcrest, Version=1.2.1.0, Culture=neutral, PublicKeyToken=31c3ea0b6fcf8c4a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at Library1.Tests.Given a LightBulb that has had its state set to true.when I ask whether it is On it answers true.()

0 passed, 2 failed, 0 skipped, took 2.01 seconds (xUnit.net 1.9.1 build 1600).

@dmohl
Copy link
Contributor

dmohl commented Sep 6, 2012

Unfortunately, I wasn't able to recreate this issue after following steps 1 and 2 then running the tests with xunit.gui.clr4.exe (I don't currently have TestDriven.NET installed). Do the sample tests run correctly for you with xunit.gui.clr4.exe, but not with TestDriven.NET?

@PatrickMcDonald
Copy link
Author

Thanks Dan,

I found the problem, I had version 1.2.0 of NHamcrest.dll on my path (installed by an old version of Gallio) and MSBuild was falling over.

Weirdly, Visual Studio 2010 didn't have a problem with this

There was a conflict between "NHamcrest, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31c3ea0b6fcf8c4a" and "NHamcrest, Version=1.2.1.0, Culture=neutral, PublicKeyToken=31c3ea0b6fcf8c4a".
    "NHamcrest, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31c3ea0b6fcf8c4a" was chosen because it was primary and "NHamcrest, Version=1.2.1.0, Culture=neutral, PublicKeyToken=31c3ea0b6fcf8c4a" was not.
    References which depend on "NHamcrest, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31c3ea0b6fcf8c4a" [C:\Program Files\Gallio\bin\NHamcrest.dll].
        C:\Program Files\Gallio\bin\NHamcrest.dll
          Project file item includes which caused reference "C:\Program Files\Gallio\bin\NHamcrest.dll".
            NHamcrest, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31c3ea0b6fcf8c4a
    References which depend on "NHamcrest, Version=1.2.1.0, Culture=neutral, PublicKeyToken=31c3ea0b6fcf8c4a" [C:\Work\temp\Library1\packages\FsUnit.xUnit.1.1.0.1\Lib\Net40\NHamcrest.dll].
        C:\Work\temp\Library1\packages\FsUnit.xUnit.1.1.0.1\Lib\Net40\FsUnit.Xunit.dll
          Project file item includes which caused reference "C:\Work\temp\Library1\packages\FsUnit.xUnit.1.1.0.1\Lib\Net40\FsUnit.Xunit.dll".
            FsUnit.Xunit
        C:\Work\temp\Library1\packages\FsUnit.xUnit.1.1.0.1\Lib\Net40\FsUnit.CustomMatchers.dll
          Project file item includes which caused reference "C:\Work\temp\Library1\packages\FsUnit.xUnit.1.1.0.1\Lib\Net40\FsUnit.CustomMatchers.dll".
            FsUnit.Xunit
            FsUnit.CustomMatchers

sergey-tihon added a commit that referenced this issue Feb 18, 2018
Removes (first) condition for target frameworks in project files.
sergey-tihon pushed a commit that referenced this issue Nov 2, 2019
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