我可以从 here 看到,即命名空间 Visual Studio
应该存在于命名空间 Microsoft
中,但我得到了那个错误,我的测试都没有工作!
The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
我在 Windows 8.1(全部更新)中使用 Visual Studio 2012。
最佳答案
尝试在 TFS 中构建项目时出现此错误。这些步骤修复了它:
上述步骤导致此元素从我的 .csproj 文件中删除:
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
而是添加了这两个:
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.2.1.1\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.2.1.1\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
</Reference>
关于unit-testing - 类型或命名空间名称 'VisualStudio' 在命名空间 'Microsoft' 中不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20259076/