Click here to Skip to main content
15,888,239 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using xunit for testing my project. I was added all dependencies but i am getting following error.
The type or namespace name 'TestServer' could not be found (are you missing a using directive or an assembly reference?)

My test3.Tests.csproj dependencies

<itemgroup>
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />


What I have tried:

I was retore the project by using dotnet restore. But i am getting same error message.


How can i resolve the problem.Any one try to help me thank you..
Posted
Comments
F-ES Sitecore 5-Dec-18 4:29am    
Do you have the appropriate "using" statements at the top of your code file?
Member 14078144 5-Dec-18 4:53am    
Yes. This are the namespace i am using top of my cs file
using System;
using System.Net.Http;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.TestHost;

1 solution

Try adding this
C#
using Xunit;
after your existing using statements
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900