JohnnyBravo75
JohnnyBravo75

Reputation: 353

Visual Studio Online - The type or namespace name xxx does not exist in the namespace yyy

I have a solution in VS 2013, and use VS Online. Locally, I can build the solution (.NET 4.5) without any problem, but in VisualStudioOnline, I get a build error. I´m not using any Nuget packages.

When I check-in and Visual Studio Online is building, I get errors like this:

The type or namespace name 'Commands' does not exist in the namespace 'DataPipeline' (are you missing an assembly reference?)

This ist one of my type/namespace. The type exists in this namespace and is used in other projects in the solution as well. Could it be possible that this project is build too early and the types are not found, because the referenced assembly is not existing (but I would assume a different error message)? The "missing" project is the only one which is build as x86.

What is wrong an where can I check out more details? Where can I check/modify the build order?

This are the namespaces in the class:

using DataPipeline; 
using DataPipeline.Commands; 
using DataPipeline.Formatters; 
using DataPipeline.Helper; 

I get 3 build errors on these namespaces:

DataPipeline.Commands; 
DataPipeline.Formatters; 
DataPipeline.Helper;

"DataPipeline" is not listed in the errors, but it is in the same project like the namespaces which are not found.

Build started 9/16/2015 8:15:27 PM. 1>Project "C:\a\6d58edb1\DataBridge\DataBridge.sln" on node 1 (default targets). 1>ValidateSolutionConfiguration: Building solution configuration "debug|any cpu". ValidateProjects: The project "DataBridge.Pipeline" is not selected for building in solution configuration "Debug|Any CPU". 1>Project "C:\a\6d58edb1\DataBridge\DataBridge.sln" (1) is building "C:\a\6d58edb1\DataBridge\DataBridge.Test\DataBridge.Test.csproj" (2) on node 1 (default targets). 2>PrepareForBuild: Creating directory "bin\Debug\". 1>Project "C:\a\6d58edb1\DataBridge\DataBridge.sln" (1) is building "C:\a\6d58edb1\DataBridge\DataBridge.Common\DataBridge.Common.csproj" (3) on node 2 (default targets). 3>PrepareForBuild: Creating directory "bin\Debug\". 1>Project "C:\a\6d58edb1\DataBridge\DataBridge.sln" (1) is building "C:\a\6d58edb1\DataBridge\DataBridge.Service\DataBridge.Service.csproj" (4) on node 1 (default targets). 4>PrepareForBuild: Creating directory "..\DataBridge.Control\bin\Debug\service\". 4>Project "C:\a\6d58edb1\DataBridge\DataBridge.Service\DataBridge.Service.csproj" (4) is building "C:\a\6d58edb1\DataBridge\DataBridge.Runtime\DataBridge.Runtime.csproj" (5) on node 1 (default targets). 5>PrepareForBuild: Creating directory "bin\Debug\". 1>Project "C:\a\6d58edb1\DataBridge\DataBridge.sln" (1) is building "C:\a\6d58edb1\DataBridge\DataBridge.Console\DataBridge.Console.csproj" (6) on node 1 (default targets). 6>PrepareForBuild: Creating directory "bin\Debug\". GenerateBindingRedirects: No suggested binding redirects from ResolveAssemblyReferences.

CoreCompile: C:\Program Files (x86)\MSBuild\12.0\bin\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /platform:anycpu32bitpreferred /errorreport:prompt /warn:4 /define:DEBUG;TRACE /highentropyva+ /reference:C:\a\6d58edb1\DataBridge\DataBridge.Common\bin\Debug\DataBridge.Common.dll /reference:C:\a\6d58edb1\DataBridge\Reference\Ionic.Zip.dll /reference:C:\a\6d58edb1\DataBridge\Reference\log4net\log4net.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\mscorlib.dll" /reference:C:\a\6d58edb1\DataBridge\Reference\Quartz\ClientProfile\Quartz.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Net.Http.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Xml.Linq.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\DataBridge.Runtime.exe /subsystemversion:6.00 /target:exe /utf8output HeartbeatJob.cs Configuration\EmailInfo.cs Configuration\PipelineInfo.cs DataBridgeManager.cs Configuration\SystemInfo.cs RemoteLogListener.cs MailJob.cs Program.cs Configuration\DataBridgeInfo.cs DataBridge.cs Properties\AssemblyInfo.cs "C:\Users\buildguest\AppData\Local\Temp.NETFramework,Version=v4.5.AssemblyAttributes.cs"

[error]DataBridge.Runtime\DataBridgeManager.cs(6,20): Error CS0234: The type or namespace name 'Commands' does not exist in the namespace

'DataPipeline' (are you missing an assembly reference?) 5>DataBridgeManager.cs(6,20): error CS0234: The type or namespace name 'Commands' does not exist in the namespace 'DataPipeline' (are you missing an assembly reference?) [C:\a\6d58edb1\DataBridge\DataBridge.Runtime\DataBridge.Runtime.csproj]

[error]DataBridge.Runtime\DataBridgeManager.cs(7,20): Error CS0234: The type or namespace name 'Formatters' does not exist in the

namespace 'DataPipeline' (are you missing an assembly reference?) 5>DataBridgeManager.cs(7,20): error CS0234: The type or namespace name 'Formatters' does not exist in the namespace 'DataPipeline' (are you missing an assembly reference?) [C:\a\6d58edb1\DataBridge\DataBridge.Runtime\DataBridge.Runtime.csproj]

[error]DataBridge.Runtime\DataBridgeManager.cs(69,17): Error CS0246: The type or namespace name 'Pipeline' could not be found (are you

missing a using directive or an assembly reference?) 5>DataBridgeManager.cs(69,17): error CS0246: The type or namespace name 'Pipeline' could not be found (are you missing a using directive or an assembly reference?) [C:\a\6d58edb1\DataBridge\DataBridge.Runtime\DataBridge.Runtime.csproj] 5>Done Building Project "C:\a\6d58edb1\DataBridge\DataBridge.Runtime\DataBridge.Runtime.csproj" (default targets) -- FAILED. 4>Done Building Project "C:\a\6d58edb1\DataBridge\DataBridge.Service\DataBridge.Service.csproj" (default targets) -- FAILED.

Upvotes: 0

Views: 1847

Answers (2)

Vicky - MSFT
Vicky - MSFT

Reputation: 5010

I can reproduce your issue when the project is not selected to Build. So, open the Configuration Manager, be sure Build is checked for DataBridge.Pipeline project. Check in the entire solution, and re-queue the build. You should be able to get a success build this time.

enter image description here

Upvotes: 1

ΩmegaMan
ΩmegaMan

Reputation: 31576

Could it be possible that this project is build too early and the types are not found,

Look at the build log to determine what is building and in what order. If that is the case, and the project depends on a different project(s) here are the steps to make sure the dependent project is built

  1. From the file menu open up the menu item Project->Project Dependencies (or type Project Dependencies into the Quick Launch.
  2. When that screen comes up go to the top level projects and select the projects for build which depend on other projects.
  3. Rebuild, if failure check dependencies and start over at step 1.

Upvotes: 1

Related Questions