0
votes

In my solution, when I try to run the build it has a reference error, but the whole reference is in the project.

Error:

solution\directory\directory2\Configuration\XPTO.cs(1,7): Error CS0246: The type or namespace name 'BoDi' could not be found (are you missing a using directive or an assembly reference?) solution\directory\directory2\Configuration\XPTO.cs(2,17): Error CS0234: The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) solution\directory\directory2\Configuration\XPTO.cs(3,7): Error CS0246: The type or namespace name 'OpenQA' could not be found (are you missing a using directive or an assembly reference?) solution\directory\directory2\Configuration\XPTO.cs(4,7): Error CS0246: The type or namespace name 'OpenQA' could not be found (are you missing a using directive or an assembly reference?) solution\directory\directory2\Configuration\XPTO.cs(7,7): Error CS0246: The type or namespace name 'TechTalk' could not be found (are you missing a using directive or an assembly reference?) solution\directory\directory2\Page Object\XPTO1.cs(2,7): Error CS0246: The type or namespace name 'OpenQA' could not be found (are you missing a using directive or an assembly reference?) solution\directory\directory2\Page Object\XPTO1.cs(3,7): Error CS0246: The type or namespace name 'OpenQA' could not be found (are you missing a using directive or an assembly reference?) solution\directory\directory2\Page Object\XPTO2.cs(2,7): Error CS0246: The type or namespace name 'OpenQA' could not be found (are you missing a using directive or an assembly reference?) solution\directory\directory2\Page Object\XPTO2.cs(3,7): Error CS0246: The type or namespace name 'OpenQA' could not be found (are you missing a using directive or an assembly reference?) solution\directory\directory2\Test\XPTO3.cs(2,17): Error CS0234: The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) solution\directory\directory2\Test\XPTO3.cs(3,7): Error CS0246: The type or namespace name 'OpenQA' could not be found (are you missing a using directive or an assembly reference?)

Project: VS2017 Selenium.WebDriver and Suport 3.13.1 SpecFlow (TechTalk 2.3.2) Microsoft.VisualStudio.TestPlatform... 1.3.2

https://i.imgur.com/MSjfrfm.png and https://i.imgur.com/gqkpHZu.png

Has anyone ever had this problem?

2

2 Answers

2
votes

Check each .csproj file in the solution (for each project). Look for HintPaths for the different packages, and make sure they all point to the correct location.

If some projects in the solution has been moved or copied from other solutions, chances are that the HintPaths are wrong (but may be working fine on your machine).

Example:

<Reference Include="AutoMapper, Version=5.2.0.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
  <HintPath>..\..\packages\AutoMapper.5.2.0\lib\net45\AutoMapper.dll</HintPath>
  <Private>True</Private>
</Reference>
0
votes

I got to work on the same build.

In Nuget Restore, advanced, I inserted a directory to perform the package copying, in a directory packages.

Example: directory \ solution directory \ packages

Then in the msbuild task, advanced, I enabled Nuget Restore

Then the build worked