Cant add extent reports to existing code | Selenium C# Forum
mai Posted on 24/12/2018
I am trying to add extentreport libraries using nuGet package to an existing project Visual studio automation code we have at work. Unfortunately it is not getting added .. We have older selenium verison 2.47

The error I get is: Microsoft.AspNet.Razor.2.0.30506.0 failed to uninstall. restart visual studio to finish the process

even when I restart visual studio none of the references get added.

I have even tried to add them manually from folder to references. It seems there may be conflicts.
What versions of selenium and .net need to be installed for extent report to get added or what are it's requirements for it to be installed

mai Replied on 24/12/2018

I think I know why it doesn't work . I guess I need to upgrade .net version

>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3274: The primary reference "ExtentReports" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".

gunjan Replied on 26/12/2018

Is it working now?

mai Replied on 26/12/2018

Hi Gunjan
I updated .net so don't get the same error but  I am getting an exception now on this line:

ExtentTest test = rep.CreateTest("LoginTest");

(Note: rep is not null)
This is the exception:
An exception of type 'System.IO.FileNotFoundException' occurred in Test.dll but was not handled in user code

I have added this code to "Coded ui test method" not "Nunit test method"

Does it only work with nunit ?

gunjan Replied on 26/12/2018

Can you share the entire code

mai Replied on 27/12/2018

It works now Gunjan, you can close this query now