Missing assembly reference Visual Studio 2012 - visual-studio-2010

I installed Visual Studio 2012 Ultimate and I encounter painful build problems. Solutions cannot build, because of
Error 12 The type or namespace name 'TypeName' does not exist in the namespace 'Framework' (are you missing an assembly reference?)
The assembly is there for sure and is referenced - the only change was new VS - previously I used VS 2010 Ultimate. Also the target framework of both assembly and solution is the same (4.0.3).
Any solutions?
Thank you in advance!

Make sure you have this line included:
using System.Web.UI.WebControls;
If that doesn't help, this link might: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.objectdatasource.typename.aspx

The dll project and its referencing windows/console project should be in two independent folders.If these folders overlap the above problem comes.That means one project folder should not be inside other project folder.This problem coming only in vs2012 and vs2013

Related

Visual Studio Solution DLL error

I have a visual studio solution which works fine on one machine and when I copy the complete same solution to another machine it misses few external dlls.
Both the machine have same configuration and same version of visual studio.
I tried removing reference and adding again.I am able to reference the dll and use code but when I re-build,It gives the same error.Any pointers on what could have gone wrong?
The error message I get is as below
The type or namespace name 'NameSpaceName" could not be found (are you missing a using directive or an assembly reference?)
Also the warning shows.
The primary reference "NameSpaceName" 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".
Both the machine have Visual Studio 2010 installed. It works on one and doesn't work on another machine
The reference you have added to the project is likely not in a subfolder of your project but referenced from the Global Assembly Cache (GAC). Since you probably didn't copy the GAC, this reference is now of a different version. Figure out which (3rd party ?) component is affected and install an older version of that component.
Typically, Visual Studio cannot target .NET 4.5, unless you applied a workaround. In that case, you can go to the project properties, Application and change Target Framework from 4.0 to 4.5.

Visual Studio Nuget dll not found in Release mode

I have a multi-project solution. In fact, some projects happen to be shared by 2 different solutions.
Anyhow, one of these is a test project and uses RhinoMocks. I used NUGET to add this to the project, and the solution is set to enable the download any packages from NUGET.
It builds just fine when in DEBUG mode, but when I put it into RELEASE mode, I get:
Error 1 The type or namespace name 'Rhino' could not be found (are you missing a using directive or an assembly reference?)
I don't think it's limited to RhinoMock, I've occassionally got it with NUNIT too.
Any ideas here?
Thanks

Visual Studio Team Services Build Issues

I am using Visual Studio Team Services as source control and have enabled continuous integration.
My project is an ASP.NET application which used Entity Framework 5. When i checkin the code and the build controller tries to build it, the following errors come up
DataModel\GenomicsTutorDataModel.Context.cs (40): The type or
namespace name 'DbSet' could not be found (are you missing a using
directive or an assembly reference?)
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets
(1578): Could not resolve this reference. Could not locate the
assembly "EntityFramework". Check to make sure the assembly exists on
disk. If this reference is required by your code, you may get
compilation errors.
In my solution i have made system.data.entity CopyLocal = True yet no success.
Any ideas?
May be you are on a 64 bits machine and the TFS server is not?
Try to build your project for Any CPU or x86.
Add the DLL you referenced for System.Data.Entity into a folder in your project or somewhere in a folder in the Source Control and reference to that one. Check this in and try to build your application again.

Web Reference namespace not seen by Visual Studio 2010 compiler after 2.0 to 3.5 project conversion

I'm getting a build error in Visual Studio that's not making any sense:
The type or namespace name 'MyService' does not exist in the namespace 'My.Project' (are you missing an assembly reference?)
The namespace MyService is defined in a Web Reference. In the Object Browser, I can clearly see that namespace and all of the classes defined in it. There are no compile errors for any of the code in the Web Reference.
The code stopped compiling after I changed the framework target from 2.0 to 3.5. Why could the compiler be choking, and how can I go about fixing this? I already tried updating the web reference, but the problem remains. I even tried commenting out the code in the generated "Reference.cs" and copying the code to another code file in the project, and the namespace was still not seen.
My project is referencing the following:
System 2.0.0.0
System.Data 2.0.0.0
System.EnterpriseServices 2.0.0.0
System.Net 3.5.0.0
System.Web.Services 2.0.0.0
System.Xml 2.0.0.0
Update
It isn't just my web service generated code that is having compile problems; for all of the projects converted to .NET 3.5, I cannot reference their namespaces.
I'm still not sure why this is all happening, but I found a workaround; by adding a using Ns = My.Project.MyService to my code, I was able to reference types in the namespace with Ns.MyType.
This is apparently documented as a bug in Visual Studio:
https://connect.microsoft.com/VisualStudio/feedback/details/570557/targeting-net-framework-3-5-actually-targets-3-0-gac
I utilized the workaround documented in the post by copying System.Web.Extensions.dll from C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5 to C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0. Then I restarted Visual Studio.
That alone didn't fix the problem. I had to redo the project conversion from 2.0 to 3.5 after the assembly was copied. After the new conversion, the code compiled as expected. Doing a diff between the project file pre- and post-workaround didn't reveal any substantial differences, so the build errors must have been due to some internal state of Visual Studio.

TFS 2010 Microsoft.Office.Interop Reference Woes

I'm about to go crazy with this problem!
I created a new server on a virtual
machine for TFS.
I have created a new Build
Definition, that when a solution is
checked in from my local machine TFS
is to build my solution using the
default build process template.
On the TFS machine and my local
machine I have MS Office 2010 and
.Net framework 4.0 Installed.
In my project I have a reference to
Microsoft.Office.Interop, etc...
This all build fine on my local
machine.
The problem occurs when the build definition is triggered. The build is run and does it's stuff for a while until it gets to the Microsoft assembly references.
The type or namespace name 'Office'
does not exist in the namespace
'Microsoft' (are you missing an
assembly reference?)
The type or namespace name
'Application' could not be found
(are you missing a using directive
or an assembly reference?)
ETC
The references paths point to the GAC, in case that matters.
Help would be awesome, and you would therefore be awesome by extension.
Regards,
Byron Cobb.
Byron,
If you take the assemblies from the compiled version on your computer create a libs folder at your solution level, then add the dlls for
Microsoft.Office.Interop.Word.dll
Microsoft.Office.Interop.Excel.dll
Microsoft.Vbe.Interop.dll
OFFICE.DLL
Into the libs folder, then remove the reference to your Office Interop and add references to the following assembies in you libs folder, should work a treat, we build without office on our build server.
Regards
Iain

Resources