c# - Dependencies not flowing between dependent projects, causing System.IO.FileNotFoundException -


lets solution has 2 projects:

  • the first called "mainproject" (a .netstandard 2.0 project).
  • the second called "mainprojecttests" (a nunit test project) unit tests each class "mainproject".

the first project (mainproject) has nuget dependency called "dependencyx". obviously, project "mainprojecttests" has reference "mainproject".

so when test runner runs test of "mainprojecttests" calls methods "mainproject" using "dependencyx" i'm getting system.io.filenotfoundexception exception:

system.io.filenotfoundexception : not load file or assembly 'dependencyx, version=1.0.0.0, culture=neutral, publickeytoken=null' or 1 of dependencies.

why getting exception? when add "dependencyx" "mainprojecttests" works fine, seems me not practice... how solve it?

i'm using visual studio mac community 7.2 preview (7.2 build 583)

thanks help.

edit:

tried putting options:

<restoreprojectstyle>packagereference</restoreprojectstyle>  <autogeneratebindingredirects>true</autogeneratebindingredirects> 

in nunit project, getting same result.

this seems known bug regarding .net standard libraries (and maybe in conjunction nunit). filed bug report here seems confirm not intended behaviour. altough there has been no progress on half year.

maybe 1 should file bug in nunit repo after confirming happens when using nunit.

for time beeing you'll need reference libraries used in .net standard project in projects referencing .net standard 1 doing right now.


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -