Loaded existing Project into Visual Studio 2013, getting namespace errors - asp.net

I just installed Visual Studio 2013 onto my computer. I had Visual Studio 2010. Now I am trying to load an existing VS2010 project into 2013. When I got to build it, I get 4 namespace errors. The errors say:
The type or namespace name 'WebPages' does not exist in the namespace 'Microsoft.Web' (are you missing an assembly reference?)
The type or namespace name 'DotNetOpenAuth' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'WebPages' does not exist in the namespace 'Microsoft.Web' (are you missing an assembly reference?)
The type or namespace name 'HttpConfiguration' could not be found (are you missing a using directive or an assembly reference?)
Does anyone know why I would be getting these errors? When I type using Microsoft.Web.WebPages.OAuth; at the top of the page, Intellisense finds the package just fine.

Related

Blazor WebAssembly no longer builds successfully

Each time I try to run Blazor WebAssembly, I get this error
/Users/mac/Projects/test412421/test412421/Client/Program.cs(40,40): Error CS0246: The type or namespace name 'App' could not be found (are you missing a using directive or an assembly reference?) (CS0246) (test412421.Client)
Can anyone help? I've re-installed the SDKs and Visual Studio several times

CS0234: Missing Assembly Reference

I have some missing assemblies in my PC, and don't have any idea how to fix it.
When I create a new ASP.NET MVC 4 internet application from template (using VS 2012) everything works fine. As soon as I try to integrate Web API controller I get a missing assembly reference error. For example, when I create application using ASP.NET 4 Web API default template and click "API" on the interface I get Compilation error:
Compiler Error Message: CS0234: The type or namespace name 'Description' does not exist in the namespace 'System.Web.Http' (are you missing an assembly reference?)
I have checked the assembly and everything seems to be fine. It's in version 4.0. I have .NET framework 4.5 installed on my PC. Where should I look for the reason of the issue?
I saw this same error code (different missing reference) when compiling a PCL using msbuild but not when building via Visual Studio:
error CS0234: The type or namespace name 'Storage' does not exist in the namespace 'Windows' (are you missing an assembly reference?)
In my case it was caused by a 'using Windows.Storage;' statement that was not actually referenced by any code in the file. I removed the line and the error was fixed.

SQLite and ICSharp.ZipLib is giving errors during build app in release mode

i am working on windows phone 8 app. I am facing following errors, you can see the name of dlls in mentioned messages which are working in debug mode. But when i am building my app in release mode than these errors are coming. any idea ?
1)The type or namespace name 'ICSharpCode' could not be found (are you missing a using directive or an assembly reference?)
2)The type or namespace name 'Community' could not be found (are you missing a using directive or an assembly reference?)

Building site via devenv.exe works, msbuild fails

I'm on VS2012 Update 3 using TFS2012.
I build the same solution using devenv and msbuild. When I get to the Web Site projects, devenv doesn't report any errors, but msbuild does repeatedly. Sample of the logs for both:
Devenv:
114>------ Build started: Project: C:\...\API\, Configuration: Debug Any CPU ------
114>Could not get dependencies for project reference 'A'Could not get dependencies for project reference 'BusinessLogic' Could not get dependencies for project reference 'BusinessLogic.ASPAgents' Could not get dependencies for project reference 'DataAccessLogicComponents' Could not get dependencies for project reference 'UI'Validating Web Site
114>Building directory '/API/'.
114>
114>Validation Complete
MSBuild:
121>C:\Scrubbed\API.metaproj : warning MSB3274: The primary reference "C:\Scrubbed\PreMVC\A\bin\Release\A.dll" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".
121>C:\Scrubbed\API.metaproj : warning MSB3274: The primary reference "C:\Scrubbed\PreMVC\BusinessLogic\bin\Release\A.Web.BusinessLogic.dll" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".
121>C:\Scrubbed\API.metaproj : warning MSB3275: The primary reference "C:\Scrubbed\PreMVC\BusinessLogic\bin\Release\A.Web.BusinessLogic.dll" could not be resolved because it has an indirect dependency on the assembly "A, Version=0.0.0.15, Culture=neutral, PublicKeyToken=060d385c0c45e767" which was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v /API -p PreMVC\API\ -u -f PrecompiledWeb\API\
121>C:\Scrubbed\PreMVC\API\App_Code\File1.cs(7): error CS0234: The type or namespace name 'BusinessLogic' does not exist in the namespace 'A.Web' (are you missing an assembly reference?) [C:\Scrubbed\API.metaproj]
121>C:\Scrubbed\PreMVC\API\App_Code\File1.cs(8): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'A.Web' (are you missing an assembly reference?) [C:\Scrubbed\API.metaproj]
121>C:\Scrubbed\PreMVC\API\App_Code\File1.cs(12): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'A.Web' (are you missing an assembly reference?) [C:\Scrubbed\API.metaproj]
121>C:\Scrubbed\PreMVC\API\App_Code\File2.cs(7): error CS0234: The type or namespace name 'BusinessLogic' does not exist in the namespace 'A.Web' (are you missing an assembly reference?) [C:\Scrubbed\API.metaproj]
121>C:\Scrubbed\PreMVC\API\App_Code\File2.cs(8): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'A.Web' (are you missing an assembly reference?) [C:\Scrubbed\API.metaproj]
121>C:\Scrubbed\PreMVC\API\App_Code\File2.cs(12): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'A.Web' (are you missing an assembly reference?) [C:\Scrubbed\API.metaproj]
121>C:\Scrubbed\PreMVC\API\App_Code\File3.cs(7): error CS0234: The type or namespace name 'BusinessLogic' does not exist in the namespace 'A.Web' (are you missing an assembly reference?) [C:\Scrubbed\API.metaproj]
121>C:\Scrubbed\PreMVC\API\App_Code\File3.cs(8): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'A.Web' (are you missing an assembly reference?) [C:\Scrubbed\API.metaproj]
121>Done Building Project "C:\Scrubbed\API.metaproj" (Rebuild target(s)) -- FAILED.
Any idea as to why Devenv carries on but MSBuild fails immediately?
I got an answer from a mod on MSDN forums. Basically MSBuild is extremely strict about dependencies where devenv just puts up warnings but carries on.
We ended up getting the go-ahead to move to .NET 4.5 entirely so we fixed the mismatch and ended up moving our build to MSBuild.
Make sure you add project references to the other projects and that they are all using the same version of .NET framework.
Doesn't the warning in your logs tell the story?
"121>C:\Scrubbed\API.metaproj : warning MSB3274: The primary reference "C:\Scrubbed\PreMVC\A\bin\Release\A.dll" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0". "

error CS0246: The type or namespace name 'TModel' could not be found

I'm trying to publish a MVC4 application into appharbor, copying locally System.Web.MVC but still getting this error.
error CS0246: The type or namespace name 'TModel' could not be found (are you missing a using directive or an assembly reference?)
Have you tried to use the NuGet dll - please make sure you're referencing the NuGet dll and not your local system one: https://www.nuget.org/packages/aspnetmvc
Also check out this support issue: http://support.appharbor.com/discussions/problems/1314-error-pushing-mvc4-application

Resources