mardi 7 juillet 2020

Unable to create instance of class MyTestClass.RunTests. Error: System.IO.FileNotFoundException: Could not load file or assembly

My full error is: Unable to create instance of class MyTestClass.RunTests. Error: System.IO.FileNotFoundException: Could not load file or assembly 'RhinoCommon, Version=7.0.20168.13070, Culture=neutral, PublicKeyToken=552281e97c755530' or one of its dependencies. The system cannot find the erfile specified..

I have installed the pre-release NuGet package RhinoCommon for my project. I have installed version 7.0.20168.13075, but when I run my tests it insists it is looking for 7.0.20168.13070. If I check the packages.config file for the project, it is the correct version. However in the .csproj file it reads;

  <Reference Include="Rhino.UI, Version=7.0.20168.13070, Culture=neutral, PublicKeyToken=552281e97c755530, processorArchitecture=MSIL">
      <HintPath>..\packages\RhinoCommon.7.0.20168.13075-wip\lib\net45\Rhino.UI.dll</HintPath>
    </Reference>
    <Reference Include="RhinoCommon, Version=7.0.20168.13070, Culture=neutral, PublicKeyToken=552281e97c755530, processorArchitecture=MSIL">
      <HintPath>..\packages\RhinoCommon.7.0.20168.13075-wip\lib\net45\RhinoCommon.dll</HintPath>

As you can see it is trying to reference the version it says it is, but it makes the test fail. Oddly enough it still builds, which I don't understand.

I have tried manually changing the Version= to the correct version but that didn't seem to change anything, Ialso just tried removing the Version= and all info after that, but to no avail. If someone could help me with this silly error that would be fantastic! :)

Aucun commentaire:

Enregistrer un commentaire