My Visual Studio is missing Microsoft.VisualStudio.QualityTools.UnitTestFramework - visual-studio

I configured now a new computer. Installed VS 2010 and all necessary component, got my running project on that new computer..
Compiling the project shows me that VS 2010 cannot find the reference "Microsoft.VisualStudio.QualityTools.UnitTestFramework".
This assembly is located in
Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies
But VS is not able to find it.
The used project is OK. It can be compiled on my old machine!
Edit:
The error while compiling:
error CS0234: The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

Upgrade of some 2003 code for us was resolved through the following:
Removing the existing broken reference
Updating the project from .Net 3.5 to .Net 4 (not the client version)
Adding the new one from VS2010 OR VS2012
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll
The existing "USING" statement worked without change.
"using Microsoft.VisualStudio.TestTools.UnitTesting;"

I had the same problem.
Old machine:
Windows XP, 32 bit
VS 2010 (32 bit)
New machine:
Windows 7, 64 bit
VS 2010 (32 bit)
I solved it by simply deleting the reference to Microsoft...UnitTestFramework, and adding the new one, which was here:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll
I did not need to change the target .NET framework version.

Check that your project is not marked for X64 platform in a mixed solution configuration (right click the solution -> Configuration Manager option). After changing the platform for the test project from X64 to Any CPU the assemblies were recognized and it worked.

Forget to mark this as solved:
What I did:
Uninstalled VS 2008 and VS2010 including all updates - Installed VS2008 full, VS2010 full Now it works! The cause is still unknown!

Staggering: 7 years on, still an issue
The solution that worked for me (Visual Studio 2017, Pro) was to delete the reference from the list (see image below) and then re-add it.

No Solution, just some hints:
// using Microsoft.VisualStudio.QualityTools.UnitTestFramework
// Path: %ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll
You also need to check the versions. There are two out by now (10.1.0.0 and 10.0.0.0) A wrong will result in such an error.#
All versions of the unity-framework can be found at Codeplex. unity.codeplaex.com

Compile against the .DotNet4 Framework 4 instead of the .DotNet4 Framework 4 Client Profile might also solve the problem.

I was getting the same problem, but found that in the references it was set as GAC, so I removed this and put it in the BIN folder. When it was on one server it was fine but that was because it was registered on that machine and not the other

I believe your problem is that you have a project that was created on a machine with VS2010 SP1 installed and you are running on a machine with VS2010 (no SP). I recently had to change machines and my IS department installed an image on the new machine with VS2010, just like I asked.
When I pulled my code down out of source control, all of a sudden I couldn't run the unit tests because
"Could not locate the assembly "Microsoft.VisualStudio.QualityTools.UnitTestFramework"
Then I remembered that I had installed SP1 on my old machine. So I installed VS2010 SP1 on the new machine and magically the problem went away.
So try downloading and installing SP1

I had the same problem, too. It was caused by an config file automatically generated for the unit test dll, I didn't notice.
The app.cfg - file content was:
<?xml version="1.0"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.UnitTestFramework" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-10.1.0.0" newVersion="10.1.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
I have just removed that app.cfg file and everything worked fine without any other changes again.

I had same problem.
You need to change target framework of your project from ".Net Framework 4 Client Profile" to ".Net Framework 4"
It worked for me.

I had the same problem in an old project targeting DotNet Framework 2; updating it to DotNet Framework 3.5 solved it for me.

Related

ionic2 with visual studio MSB3644 error when starting new project

Am using visual studio 2015 but whenever i begin a new ion ionic2 project an error
MSB3644 The reference assemblies for framework ".NETFramework,Version=v4.0" were not found.
To resolve this, install the SDK or Targeting Pack for
this framework version or retarget your application to a version of the framework for
which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved
from the Global Assembly Cache (GAC) and will be used in place of reference assemblies.
Therefore your assembly may not be correctly targeted for the framework you intend.
After a research on the error i found out This link and This link but am using windows 10 on a 32 bit computer with program files folder and without the program filesx86 folder
Am not using any server and also a newbie to visual studio
I have also checked and
C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0. is there
I also found out you need to add
msbuild -p:FrameworkPathOverride="C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.
But am not sure where am supposed to add it
Can someone help me on this issue
But am not sure where am supposed to add it
Please run "Msbuild Command Prompt for VS2015"
Go to the folder of project
run the msbuild command
msbuild -p:FrameworkPathOverride="C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0"

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.

Could not load file or assembly "Oracle.DataAccess" or one of its dependencies

I am trying to run this web application. I keep getting this error
"Could not load file or assembly "Oracle.DataAccess" or one of its dependencies. An attempt was made to load a program with an incorrect format."
Exception details: System.BadImageFormatException. "Could not load file or assembly "Oracle.DataAccess" or one of its dependencies. An attempt was made to load a program with an incorrect format."
Below are the things that I already tried.
replaced all the oracle dll's with 32 bit oracle dll i.e 2.112.3.0
I have 32 bit client installed on 64 bit machine. The operating system is windows 7.
compile each individual project individually. Deleted all the oracle dependent files dll and then added the 2.112.3.0 dll's individually and then compiled each project
Register the 32 bit dll on GAC using this statement
gacutil /i %ORA_HOME4%\odp.net\bin\4\Oracle.DataAccess.dll
gacutil /i %ORA_HOME4%\asp.net\bin\4\oracle.web.dll
for the above two statements, I copied the gacutil.exe from c:\Program Files(x86)\Microsoft sdk\windows\v7.0A\Bin\NETFX4.0 Tools\X64
to C:\ drive and then
I executed the above two statement:
gacutil /i %ORA_HOME4%\odp.net\bin\4\Oracle.DataAccess.dll
gacutil /i %ORA_HOME4%\asp.net\bin\4\oracle.web.dll
when I executed the above two statements, I didn't get any message, I executed them in Dos windows under administrator privilege.
I also deleted all the Temporary ASP.net files from this location
c:\windows\Microsoft.Net\V4.0.30319\temporary ASP.net files
I also changed the web application build Platform target to X86, Originally, it was at "ANy CPU". out of frustration, I also tried changing the platform target to X64 and then I got the error message saying
" Cold not load file or assemble . webapp" or one of its dependencies. An attempt was made to load a program with an incorrect format.
I don't have IIS installed on my computer, I am running this application in visual studio 2010 so I think it will be using the inbuilt IIS that comes with visual studio.
I spend lot of hours resolving this issue, but still getting the same error again and again.
Try this: Open IIS Manager, change application pool's advance setting, change Enable 32 bit Application to false.
I found the solution with following steps:
remove the Oracle.DataAcces.dll reference,
and add a fresh reference to:
C:\windows\assembly\GAC\Oracle.DataAccess\X.XXX.X.XX__89b483f429c47342/oracle.dataaccess.dll
Make local copy= false.
Hope it helps
You may need to enable 32-bit applications in your AppPool.
Go to > 'Application Pool' in IIS => right click your app pool => advance setting => 'enable 32 bit application' to true.
Please don't forget to restart your app pool and your corresponding application pointing to that app pool.
If you are using IIS Express and VS 2017:
Go to the Web Application Properties > Web Tab > Servers Section > And change the Bitness to x64.
Had the issue again when i moved from one machine to another and had everything reinstalled. In my case, i'm using both 32bit and 64bit Oracle ODP.NET installs.
When listing the assemblies on my new machine i ended up with the following list
C:\oracle\product\11.2.0\X64\odp.net\bin\4>gacutil /l|findstr Oracle.DataAccess
Oracle.DataAccess, Version=2.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=AMD64
Policy.2.102.Oracle.DataAccess, Version=2.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=AMD64
Policy.2.111.Oracle.DataAccess, Version=2.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=AMD64
Policy.2.112.Oracle.DataAccess, Version=2.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=AMD64
Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=AMD64
Policy.4.112.Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=AMD64
only 64bit DLLs to be seen here.
I couldn't see it from the web.config but the one i was using was a 32bit version.
When checking my old machine with the GACutil, i saw more DLLs, also the X86 ones.
Fixed by reapplying the registration process(both x32/x64 version referenced here)
OraProvCfg.exe /action:gac /providerpath:C:\oracle\product\11.2.0\x32\ODP.NET\bin\4\Oracle.DataAccess.dll
OraProvCfg.exe /action:gac /providerpath:C:\oracle\product\11.2.0\x64\ODP.NET\bin\4\Oracle.DataAccess.dll
after that , Visual Studio was a happy bunny and compiled everything again for me.
I had the same error with Oracle.DataAccess but deploying to Azure Web Sites (azurewebsites.net). For me I had to edit a setting in VS.NET 2019 before publishing to Azure. I ticked the checkbox "Use the 64 bit version of IIS Express for Web sites and projects" which is found under Tools > Options > Projects and Solutions > Web Projects.
In my case the following solved the problem:
Downloading the "32-bit Oracle Data Access Components (ODAC)
with Oracle Developer Tools for Visual Studio" from http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html
Then adding reference oracle.dataaccess.dll to the bin file by browsing the file location or just from the refence list in .NET tab.
In my case, I use VS 2010, Oracle v11 64 bits. I might to publish in 64 bit mode (Setting to "Any Cpu" mode in Web Project configuration) and I might set IIS on Production Server to 32 Bit compability to false (because the the server is 64 bit and I like to take advantage it).
Then to solve the problem "Could not load file or assembly 'Oracle.DataAccess'":
In the Local PC and Server is installed Oracle v11, 64 Bit.
In all Local Dev PC I reference to Oracle.DataAccess.dll (C:\app\user\product\11.2.0\client_1\odp.net\bin\4) which is 64 bit.
In IIS Production Server, I set 32 bit compatibility to False.
The reference in the web project at System.Web.Mvc.dll was the version v3.0.0.1 in the local PC, however in Production is only
instaled MVC version 3.0.0.0. So, the fix was locallly work with MVC
3.0.0.0 and not 3.0.0.1 and publish again on server, and it works.
Also you can download and execute the install.bat file in 'ODAC112030Xcopy.zip' from 64-bit Oracle Data Access Components (ODAC) Downloads. This resolved my problem.
For me everything else was almost ok, but somehow my project settings changed & iisExpress was getting used instead of IISLocal. When I changed & pointed to the virtual directory (in IISLocal), it stared working perfectly again.
I needed a 64-bit version of oracle.dataaccess.dll but this caused problems with other libraries I was using.
[BadImageFormatException: Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
I followed several steps above. Going to advance settings on the projects pool to toggle allow 32bit worked but I wasn't content to leave it like that so i turned it back on.
My project also had references that relied on Elmah and log4net references.
I downloaded the latest version of these and my project was able to build and run fine without messing with the pools's allow 32bit setting.
i Have face the same issue and resolved by replacing the old Oracle.DataAccess.dll with new Oracle.DataAccess.dll(which come with oracle client when install)
in my case the path of new Oracle.DataAccess.dll is
E:\app\Rehman.Rashid\product\11.2.0\client_1\ODP.NET\bin
In my case I had a console application, I just unchecked Prefer 32-bit on Build projet properties tab and then I add this to my app.config:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="2.112.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>

Cannot compile .NET CF project containing Design time attributes without Visual Studio?

I'm working on a .NET Compact Framework 3.5 app. I have an automated build machine that does not have Visual Studio installed, and all has been fine.
I'm trying to a a new solution containing control projects that have DesignTimeAttributes.xmta files. MsBuild on the build machine is failing with cannot find file, C:\Program Files\Microsoft Visual Studio 9.0\SDK\v3.5\Bin\genasm.exe.
I've tried manually adding this directory and it's contents from my dev box to the build machine, but now I'm getting
c:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.CompactFramework.Common.targets(67,9): error : genasm.exe(1) : error There was an error reading arguments. Could not load file or assembly 'Microsoft.CompactFramework.Build.Tasks, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Done executing task "BuildAsmmeta" -- FAILED.
Before I struggle further with this, I thought I'd ask if anyone else out there has gotten a CompactFramework project with design time attributes building on a machine without Visual Studio?
Filburt: I've already installed the Windows SDK, the .NET SDK, and the CF SDK. I realize now that "all has been fine" in the original question doesn't make that clear.
None of the SDK's installed anything into the Microsoft Visual Studio 9.0 directory.
I've given up and installed VS at this point, but thanks for the answer.
You think need to install the Windows .NET Framework SDK on your build machine to obtain the tools that come with Visual Studio.
update
Since you stated you installed all SDKs you could check %ProgramFiles%\Microsoft SDKs\Windows\v6.1\Bin\SetEnv.cmd for any quirks in the PATH settings. I discovered some inconsistencies there for an x64 environment.

Visual Studio 2005 Can't find System assemblies

I have Visual Studio 2008 installed on my machine, but I haven't used it. I did open a dummy project and make sure that version 2.0 is the .NET Framework version I am using, since it is the one that suddenly doesn't work for me.
Here's the warning message I get when I am trying to open an existing Windows 2005 project.
"Namespace or type specified in the project level Imports 'System.Data' doesn't contain any public member or cannot be found."
All of the basic System, System.Data, System.XML assemblies show up in a new project with the yellow exclamation point warning.
Does anyone know how I can solve this issue? Please help!
I would start by downloading and re-installing .NET 2.0 on your system.
You could check the project references and make sure that you have System.Data added to the project.

Resources