问题
I am using Visual Studio 2012 RTM on a Win8 box. My VS2012 installs on D: partition.
I am writing a CodedUI test project. This project was originally written with VS2010 and I upgraded it with VS2012.
I referernce the CodedUITestFramework dll of version 11.0 in the project.
And in the *.csproj file, it says
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework,
Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,
processorArchitecture=MSIL" />
The project built successfully. But when I use ILDasm to check the assembly DLL, the manifest shows this:
.assembly extern Microsoft.VisualStudio.QualityTools.CodedUITestFramework
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....:
.ver 10:0:0:0 <======Should be 11:0:0:0 here!!
}
And I noticed that although the test project build successfully, the following error is logged in Windows Eventlog.
(vstest.discoveryengine.x86.exe, PID 8056, Thread 9) Exception thrown when enumerating assembly: Microsoft.VisualStudio.TestTools.Exceptions.EqtDataException: Unable to load the test container 'e:\test.dll' or one of its dependencies. Error details: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
But I don't even have VS2010 installed, where could I have 10.0.0.0 version DLLs?
It will be too depressing if this is a VS2012 bug. It's driving me crazy.
An issue has been created in Microsoft Connect:
https://connect.microsoft.com/VisualStudio/feedback/details/758629/add-dll-reference-bugs-in-visual-studio-2012-version-11-0-50727-1-rtmrel
Any body meet the same issue ??
回答1:
If you look into the UIMap.Designer.cs under UIMap.uitest you will notice it was built with 10.0.*.
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by coded UI test builder.
// Version: 10.0.0.0
...
[GeneratedCode("Coded UITest Builder", "10.0.40219.1")]
Run your codedUI test builder for each uitest you created and generate a UI Action or replace an existing one. This will auto generate a new UIMap.Designer.cs file with the correct version.
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by coded UI test builder.
// Version: 11.0.0.0
...
[GeneratedCode("Coded UITest Builder", "11.0.50727.1")]
回答2:
One reason you might encounter the above error is because you might have named the folder which contains all the files of your automation project with space in between. Suppose you have named the folder as "Test User". In this case you will get the above error. Solution to this is that you move these folders by changing the Local path in VSTS by File -> Source Control -> Workspaces, then select your workspace (it should match your computer name) and click Edit. Create a new folder(Without Space in the folder name) in your machine and map it here.
回答3:
Alex's solution is wrong,
Simply solution is replacing old refence with current version's dll
回答4:
The reason for the Issue is the Microsoft.Services.TestTools.UITesting.Html.dll from CodeFirst has its dependencies based on VS 2010.
Downloading the source code from CodePlex and migrating to VS 2012 and getting the latest Microsoft.Services.TestTools.UITesting.Html.dll resolves the issue and it had worked.
来源:https://stackoverflow.com/questions/12019925/vs2012-failed-to-keep-consistent-dll-version-in-csproj-file-and-assembly-manif