Namespaces gone missing - VS2022 - visual-studio
Update - seems to be a computer problem? Even when I created a new project, same errors appear immediately. But I did not make any changes to computer.
It is a asp.net core blazor webassembly project. I have been working on it for some days. Today several namespaces went "missing".
What I have tried:
Uninstall the nuget packages and then reinstall didn't solve it.
Restart visual studio didn't help
Reboot computer didn't help
Cleared nuget cache as mentioned here didn't help.
Ran a git restore . to rollback changes didn't help.
Delete bin and obj folder then rebuild didn't help.
donet restore command didn't help
The .csproj file content is:
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
<!--<RunAOTCompilation>true</RunAOTCompilation>-->
<PublishTrimmed>false</PublishTrimmed>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Pages\Index.razor.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Blazored.LocalStorage" Version="4.2.0" />
<PackageReference Include="BlazorWasmAntivirusProtection" Version="1.8.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="6.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="6.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.10" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Shared\BlazorApp.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<ServiceWorker Include="wwwroot\service-worker.js" PublishedContent="wwwroot\service-worker.published.js" />
</ItemGroup>
</Project>
Build output error text:
Rebuild started...
Restored C:\some\path\Shared\BlazorApp.Shared.csproj (in 2 ms).
1>------ Rebuild All started: Project: BlazorApp.Shared, Configuration: Debug Any CPU ------
Restored C:\some\path\Server\BlazorApp.Server.csproj (in 87 ms).
Restored C:\some\path\Client\BlazorApp.Client.csproj (in 87 ms).
1>C:\some\path\Shared\SharedFunctions.cs(51,17,51,18): warning CS0642: Possible mistaken empty statement
1>BlazorApp.Shared -> C:\some\path\Shared\bin\Debug\net6.0\BlazorApp.Shared.dll
1>Done building project "BlazorApp.Shared.csproj".
2>------ Rebuild All started: Project: BlazorApp.Client, Configuration: Debug Any CPU ------
2>C:\some\path\Client\App.razor(1,1,1,45): warning RZ10012: Found markup element with unexpected name 'Router'. If this is intended to be a component, add a #using directive for its namespace.
2>C:\some\path\Client\App.razor(2,5,2,32): warning RZ10012: Found markup element with unexpected name 'Found'. If this is intended to be a component, add a #using directive for its namespace.
2>C:\some\path\Client\App.razor(3,9,3,81): warning RZ10012: Found markup element with unexpected name 'RouteView'. If this is intended to be a component, add a #using directive for its namespace.
2>C:\some\path\Client\App.razor(4,9,4,65): warning RZ10012: Found markup element with unexpected name 'FocusOnNavigate'. If this is intended to be a component, add a #using directive for its namespace.
2>C:\some\path\Client\App.razor(6,5,6,15): warning RZ10012: Found markup element with unexpected name 'NotFound'. If this is intended to be a component, add a #using directive for its namespace.
2>C:\some\path\Client\App.razor(7,9,7,20): warning RZ10012: Found markup element with unexpected name 'PageTitle'. If this is intended to be a component, add a #using directive for its namespace.
2>C:\some\path\Client\App.razor(8,9,8,50): warning RZ10012: Found markup element with unexpected name 'LayoutView'. If this is intended to be a component, add a #using directive for its namespace.
2>C:\some\path\Client\Pages\Counter.razor(3,1,3,12): warning RZ10012: Found markup element with unexpected name 'PageTitle'. If this is intended to be a component, add a #using directive for its namespace.
2>C:\some\path\Client\Pages\FetchData.razor(5,1,5,12): warning RZ10012: Found markup element with unexpected name 'PageTitle'. If this is intended to be a component, add a #using directive for its namespace.
2>C:\some\path\Client\Pages\Index.razor(5,1,5,12): warning RZ10012: Found markup element with unexpected name 'PageTitle'. If this is intended to be a component, add a #using directive for its namespace.
2>C:\some\path\Client\Pages\LogIn.razor(15,1,15,91): warning RZ10012: Found markup element with unexpected name 'EditForm'. If this is intended to be a component, add a #using directive for its namespace.
2>C:\some\path\Client\Pages\LogIn.razor(16,5,16,31): warning RZ10012: Found markup element with unexpected name 'DataAnnotationsValidator'. If this is intended to be a component, add a #using directive for its namespace.
2>C:\some\path\Client\Pages\LogIn.razor(17,5,17,24): warning RZ10012: Found markup element with unexpected name 'ValidationSummary'. If this is intended to be a component, add a #using directive for its namespace.
2>C:\some\path\Client\Pages\LogIn.razor(22,13,22,84): warning RZ10012: Found markup element with unexpected name 'InputText'. If this is intended to be a component, add a #using directive for its namespace.
2>C:\some\path\Client\Pages\LogIn.razor(23,13,23,58): warning RZ10012: Found markup element with unexpected name 'ValidationMessage'. If this is intended to be a component, add a #using directive for its namespace.
2>C:\some\path\Client\Pages\LogIn.razor(30,13,30,104): warning RZ10012: Found markup element with unexpected name 'InputText'. If this is intended to be a component, add a #using directive for its namespace.
2>C:\some\path\Client\Pages\LogIn.razor(31,13,31,60): warning RZ10012: Found markup element with unexpected name 'ValidationMessage'. If this is intended to be a component, add a #using directive for its namespace.
2>C:\some\path\Client\Shared\MainLayout.razor(5,9,5,20): warning RZ10012: Found markup element with unexpected name 'NavMenu'. If this is intended to be a component, add a #using directive for its namespace.
2>C:\some\path\Client\Shared\NavMenu.razor(13,13,13,72): warning RZ10012: Found markup element with unexpected name 'NavLink'. If this is intended to be a component, add a #using directive for its namespace.
2>C:\some\path\Client\Shared\NavMenu.razor(18,13,18,54): warning RZ10012: Found markup element with unexpected name 'NavLink'. If this is intended to be a component, add a #using directive for its namespace.
2>C:\some\path\Client\Shared\NavMenu.razor(23,13,23,56): warning RZ10012: Found markup element with unexpected name 'NavLink'. If this is intended to be a component, add a #using directive for its namespace.
2>C:\some\path\Client\Shared\NavMenu.razor(28,13,28,52): warning RZ10012: Found markup element with unexpected name 'NavLink'. If this is intended to be a component, add a #using directive for its namespace.
2>C:\some\path\Client\Authentication\AuthenticationService.cs(1,7,1,15): error CS0246: The type or namespace name 'Blazored' could not be found (are you missing a using directive or an assembly reference?)
2>C:\some\path\Client\Authentication\AuthenticationService.cs(2,28,2,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\Authentication\AuthStateProvider.cs(1,7,1,15): error CS0246: The type or namespace name 'Blazored' could not be found (are you missing a using directive or an assembly reference?)
2>C:\some\path\Client\Authentication\AuthStateProvider.cs(2,28,2,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\Program.cs(1,7,1,15): error CS0246: The type or namespace name 'Blazored' could not be found (are you missing a using directive or an assembly reference?)
2>C:\some\path\Client\Program.cs(2,28,2,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\Program.cs(3,28,3,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\Program.cs(4,28,4,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\Microsoft.NET.Sdk.Razor.SourceGenerators\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\App_razor.g.cs(11,32,11,42): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(3,28,3,41): error CS0234: The type or namespace name 'Authorization' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(4,28,4,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(5,28,5,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(6,28,6,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(7,28,7,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(8,28,8,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(9,28,9,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\Microsoft.NET.Sdk.Razor.SourceGenerators\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\_Imports_razor.g.cs(11,32,11,42): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(3,28,3,41): error CS0234: The type or namespace name 'Authorization' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(4,28,4,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(5,28,5,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(6,28,6,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(7,28,7,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(8,28,8,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(9,28,9,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\Microsoft.NET.Sdk.Razor.SourceGenerators\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\_Imports_razor.g.cs(110,58,110,68): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\Microsoft.NET.Sdk.Razor.SourceGenerators\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\App_razor.g.cs(110,53,110,63): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\Microsoft.NET.Sdk.Razor.SourceGenerators\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\_Imports_razor.g.cs(113,70,113,80): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\Microsoft.NET.Sdk.Razor.SourceGenerators\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\App_razor.g.cs(113,70,113,80): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\Authentication\AuthStateProvider.cs(9,38,9,65): error CS0246: The type or namespace name 'AuthenticationStateProvider' could not be found (are you missing a using directive or an assembly reference?)
2>C:\some\path\Client\Microsoft.NET.Sdk.Razor.SourceGenerators\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\Shared_SurveyPrompt_razor.g.cs(11,32,11,42): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(3,28,3,41): error CS0234: The type or namespace name 'Authorization' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(4,28,4,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(5,28,5,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(6,28,6,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(7,28,7,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(8,28,8,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(9,28,9,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\Microsoft.NET.Sdk.Razor.SourceGenerators\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\Pages_Counter_razor.g.cs(11,32,11,42): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(3,28,3,41): error CS0234: The type or namespace name 'Authorization' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(4,28,4,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(5,28,5,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(6,28,6,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(7,28,7,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(8,28,8,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(9,28,9,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\Authentication\AuthStateProvider.cs(12,26,12,46): error CS0246: The type or namespace name 'ILocalStorageService' could not be found (are you missing a using directive or an assembly reference?)
2>C:\some\path\Client\Authentication\AuthenticationService.cs(13,26,13,53): error CS0246: The type or namespace name 'AuthenticationStateProvider' could not be found (are you missing a using directive or an assembly reference?)
2>C:\some\path\Client\Authentication\AuthenticationService.cs(14,26,14,46): error CS0246: The type or namespace name 'ILocalStorageService' could not be found (are you missing a using directive or an assembly reference?)
2>C:\some\path\Client\Microsoft.NET.Sdk.Razor.SourceGenerators\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\Shared_MainLayout_razor.g.cs(11,32,11,42): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(3,28,3,41): error CS0234: The type or namespace name 'Authorization' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(4,28,4,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(5,28,5,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(6,28,6,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(7,28,7,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(8,28,8,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(9,28,9,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\Authentication\AuthStateProvider.cs(14,26,14,45): error CS0246: The type or namespace name 'AuthenticationState' could not be found (are you missing a using directive or an assembly reference?)
2>C:\some\path\Client\Microsoft.NET.Sdk.Razor.SourceGenerators\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\Pages_FetchData_razor.g.cs(11,32,11,42): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(3,28,3,41): error CS0234: The type or namespace name 'Authorization' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
2>C:\some\path\Client\_Imports.razor(4,28,4,38): error CS0234: The type or namespace name 'Components' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
You can try to check _Import.razor:
#using System.Net.Http
#using System.Net.Http.Json
#using Microsoft.AspNetCore.Components.Forms
#using Microsoft.AspNetCore.Components.Routing
#using Microsoft.AspNetCore.Components.Web
#using Microsoft.AspNetCore.Components.Web.Virtualization
#using Microsoft.AspNetCore.Components.WebAssembly.Http
#using Microsoft.JSInterop
#using BlazorApp1
#using BlazorApp1.Shared
I get this error if delete these in _Import.razor, maybe it can help you.
Related
Azure DevOps Pipeline Fails When Building Xamarin.iOS project
I have a Pipeline using YAML in Azure DevOps. I have the following task in my YAML file: - task: XamariniOS#2 inputs: solutionFile: '**/*iOS.csproj' configuration: 'Release' packageApp: false runNugetRestore: false I receive the following errors when the Pipeline runs: ASWebAuthenticationSessionBrowser .cs(6,7): error CS0246: The type or namespace name 'AuthenticationServices' could not be found (are you missing a using directive or an assembly reference?) [/Users/vsts/agent/2.158.0/work/1/s/AgentConnectMobile/AgentConnectMobile.iOS/AgentConnectMobile.iOS.csproj] ASWebAuthenticationSessionBrowser .cs(14,9): error CS0246: The type or namespace name 'ASWebAuthenticationSession' could not be found (are you missing a using directive or an assembly reference?) [/Users/vsts/agent/2.158.0/work/1/s/AgentConnectMobile/AgentConnectMobile.iOS/AgentConnectMobile.iOS.csproj] ASWebAuthenticationSessionBrowser .cs(49,72): error CS0246: The type or namespace name 'IASWebAuthenticationPresentationContextProviding' could not be found (are you missing a using directive or an assembly reference?) [/Users/vsts/agent/2.158.0/work/1/s/AgentConnectMobile/AgentConnectMobile.iOS/AgentConnectMobile.iOS.csproj] ASWebAuthenticationSessionBrowser .cs(51,51): error CS0246: The type or namespace name 'ASWebAuthenticationSession' could not be found (are you missing a using directive or an assembly reference?) [/Users/vsts/agent/2.158.0/work/1/s/AgentConnectMobile/AgentConnectMobile.iOS/AgentConnectMobile.iOS.csproj] I'm able to build the iOS project manually successfully in Visual Studio. I have tried removing and re-adding project references but it hasn't seemed to help. My project is setup like the following: Do I need to configure something differently for Azure DevOps?
Is missing a using directive or an assembly reference
I have a xamarin project that uses some components that are not recognized. When I try to compile this project it gives the following error: Error CS0246: The type or namespace name "UIKit" can not be found (is it missing a using directive or an assembly reference?) Error CS0246: The name of the "CoreLocation" type or namespace can not be found (is it missing a using directive or an assembly reference?) Anyone have any ideas to solve this?
Unity3D error CS0246: The type or namespace name could not be found (are you missing a using directive or an assembly reference?)
This is the errors when i build my game for Universal Windows 10 (Unity3D) Unity3D error CS0246: The type or namespace name could not be found (are you missing a using directive or an assembly reference My Question is Unique because it has different Compiler Errors.
Coded UI tests - cannot resolve symbol UITesting
I'm trying to use the assemblies like this in a VS2012 project: using Microsoft.VisualStudio.TestTools.UITesting; using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UITest.Extension; However I get a bunch of red in my tests: I can build and run locally even with this red, but I'd like to get this stuff resolving if possible. My build machine rejects this with the following errors: DashboardTest.cs (7): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?) DashboardTest.cs (9): The type or namespace name 'UITest' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?) UIMap.cs (9): The type or namespace name 'UITest' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?) UIMap.cs (10): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?) UIMap.Designer.cs (19): The type or namespace name 'UITest' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?) UIMap.Designer.cs (20): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?) UIMap.Designer.cs (132): The type or namespace name 'BrowserWindow' could not be found (are you missing a using directive or an assembly reference?) DashboardTest.cs (10): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?) UIMap.cs (12): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?) UIMap.cs (13): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?) UIMap.Designer.cs (22): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?) UIMap.Designer.cs (23): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?) DashboardTest.cs (18): The type or namespace name 'CodedUITest' could not be found (are you missing a using directive or an assembly reference?) DashboardTest.cs (18): The type or namespace name 'CodedUITestAttribute' could not be found (are you missing a using directive or an assembly reference?) Any tips? All references in my test project are set to copy local = true. UPDATE - I got the references working locally by adding a reference to visualStudio.TestTools.UITesting, but the CodedUITest attribute is still red and the build still fails with the same errors.
You need to add references such as in the following attachment:
You need to add a reference to: Microsoft.VisualStudio.QualityTools.CodedUITestFramework
In VS2017 I had to use the Visual Studio Installer to install the "Coded UI Test" component on my build server. It is found on the "Individual Components" tab under the "Debugging and Testing" section.
I had a similar problem but in my case I wanted to use a NuGet called CodedUIDependencies and VS kept trying to use the dlls from Program Files. I finally figured out that the project had a setting in the .csproj that was forcing it to use these files. <IsCodedUITest>True</IsCodedUITest> By changing this to False I could reinstall my Nuget and VS would finally reference the desired dlls.
ASP.NET MVC 3 Project will not compile on build server with ASP.NET MVC 3 installed
I'm having an odd problem on my build server. I'm using the latest version of TeamCity on Windows Server 2008 R2. I used the web platform installer to install ASP.NET MVC on the build server but, my compilation is still failing with messages that it cannot find the System.Web.Mvc.dll. I've verified that it is on the disk at the expected location: (C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies) Here is a selection of the messages: Controllers\AccountController.cs(7, 18): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) Controllers\AccountController.cs(15, 35): error CS0246: The type or namespace name 'Controller' could not be found (are you missing a using directive or an assembly reference?) Controllers\HomeController.cs(5, 18): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) Controllers\HomeController.cs(9, 32): error CS0246: The type or namespace name 'Controller' could not be found (are you missing a using directive or an assembly reference?) Global.asax.cs(5, 18): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) Models\AccountModels.cs(8, 18): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) So what am I missing?
The errors you seem to be inferring that it can't find the correct version of the MVC dll. Is it possible you've installed the MVC (original) or MVC2 instead of the MVC3 from the web platform onto the build server? Edit: Also the file should be in the GAC, (not sure the location on Win Server 2008 but guessing it's similar to Win 7.) C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Web.Mvc\ (then the .Net version folder, mine is v4.0_3.0.0.0)