Error CS0234 and CS0246 on new project using VS2019 WebApi Template - asp.net-web-api

After create a new project using the default template for MVC Web API and build, we get numerous errors CS0234 and CS0246 such as :
CS0234 The type or namespace name 'Mvc' does not exist in the
namespace 'System.Web'.
AND
CS0246 The type or namespace name 'GlobalFilterCollection' could not
be found
Updating the NutGet Packages or Reinstalling the ASP.NET package do not help.
Opening an existing project of the same type does not throw any errors just new projects.
Thanks for your help

Related

TFS build unable to locate the project file and dlls

I am trying to run a newly created Build in TFS but i am getting an error that :
The project file "D:\Binaries\vsts-agent-win7-x64-2.105.7\_work\1\s\CompanyA.Solution\..\..\..\Users\ihalarnkar=\Documents\Visual Studio 2013\Projects\CompanyA.Project2\CompanyA.Project2\CompanyA.Project2.csproj" was not found.
Also some of the external dlls i am using for those i am getting no reference found. Like :
The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?)
Does it mean i should have all the dlls i have referenced in the solution to be also installed on the tfs server?
How about the solution? Every new project added should be available on the physical drive on the tfs server?
This is the 1st time i am configuring and using DevOps for a SharePoint Provider Hosted app.
Kindly help.
You have a problem with your solution references -- the project reference looks to be for the path ..\..\..\Users\ihalarnkar=\Documents\Visual Studio 2013\Projects\CompanyA.Project2\CompanyA.Project2\CompanyA.Project2.csproj.
You'll need to go through your project files and fix the references.

Visual Studio 2017 New project build gives "The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft'

Whenever I open a new project and simply build it the output box gives me about 7 of these errors. Same thing over and over just different error code. Please help solve my problem.

Solrnet namespace not found when creating a new VS2010 console app

I am getting the following error:
"The type or namespace name 'SolrNet' could not be found (are you missing a using directive or an assembly reference?)"
I have created a new console application in VS2010 and added into program.cs the line
"using SolrNet;"
I've added the project reference to SolrNet.dll version 0.4.0.2002.
Some versions of solr require a reference to system.web but I do not want to do this and I believe this version doesn't have that as a requirement. I've used the object browser and added references to Nhibernate, Castle, Niject and all the other objects.
How can I get my console app to recognise the SolrNet dll?
In the project properties, change the Target Framework from .NET Framework 4 Client Profile to simply .NET Framework 4

Visual Studio 2010 - .Net Framework 4 Console Application

Basically I have added the System.Numerics reference to my project, and have added it to my using statements as below:
However, I am getting the following error:
The type or namespace name 'Numerics' does not exist in the namespace 'System'
This is hopefully a simple one!
Thanks

I keep getting "The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)"

I am running a build via TFS 2010 for my MVC3 project, but it fails with the message;
Controllers\AccountController.cs (5): The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
How do I fix this?
You should install ASP.NET MVC 3 on your TFS build server. Otherwise it won't be able to compile your ASP.NET MVC 3 projects. Once you install it the System.Web.Mvc assembly will be deployed in the GAC and TFS will be able to compile the application.

Resources