Running UnitTest project against .Net Standard Library

  • Thread starter Thread starter Gayan19911212
  • Start date Start date
G

Gayan19911212

Guest
Hello,

I have a project names 'A' and it was originally developed in .Net Framework 4.7.1. For this project, there was unit test project 'Test A' was written as well.

Later We have converted this Project A into .Net Standard 2.0 to support Azure functions but Unit Test project remained the same. However, if I run test methods in Project Test A, I get assembly issues.

For example :

Exception thrown: 'System.IO.FileNotFoundException' in A.dll
An exception of type 'System.IO.FileNotFoundException' occurred in A.dll but was not handled in user code
Could not load file or assembly 'System.Drawing.Common, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.

One of the online forum suggested that adding following propertise into the unit test project helps, but it didn't.

<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>

I want to somehow run this .Net Framework unit test project rather than creating new project. I have downgraded .Net Framework in Test A project to 4.6.1. I have also tried to download nuget package for System.Drawing.Common in A Project and that also did not work.

Another assbemly failed to load is SVG.

Please help me out. Thanks

Continue reading...
 
Back
Top