2012-04-20 81 views
1

我們有一個Visual Studio 2010 SP1 Framework 4.0解決方案和一個包含單元測試的C#項目。Visual Studio 2010 SP1到11 Beta - 單元測試項目無法加載

我卸載了VS2010並在Windows 7操作系統中安裝了VS11 Beta。我試圖連接出TFS,做了一個「最新」,一切正常。除了我們的單元測試項目沒有打開。其項目文件會自動檢出,但項目本身旁會顯示「加載失敗」警告。並在此下寫道:「該項目不能轉換」。如果撤消簽出,該警告將更改爲「該項目需要用戶輸入」。

是否有這個問題的具體原因或解決方案,還是因爲VS11仍處於測試階段?

謝謝。

這裏是我的csproj文件:

<?xml version="1.0" encoding="utf-8"?> 
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
    <PropertyGroup> 
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 
    <ProductVersion> 
    </ProductVersion> 
    <SchemaVersion>2.0</SchemaVersion> 
    <ProjectGuid>{7FD06E47-4783-494F-ACB1-256DAB8C0736}</ProjectGuid> 
    <OutputType>Library</OutputType> 
    <AppDesignerFolder>Properties</AppDesignerFolder> 
    <RootNamespace>MyProject_TEST</RootNamespace> 
    <AssemblyName>MyProject_TEST</AssemblyName> 
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> 
    <FileAlignment>512</FileAlignment> 
    <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> 
    <SccProjectName>SAK</SccProjectName> 
    <SccLocalPath>SAK</SccLocalPath> 
    <SccAuxPath>SAK</SccAuxPath> 
    <SccProvider>SAK</SccProvider> 
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> 
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> 
    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath> 
    <IsCodedUITest>False</IsCodedUITest> 
    <TestProjectType>WebTest</TestProjectType> 
    <FileUpgradeFlags>0</FileUpgradeFlags> 
    <OldToolsVersion>4.0</OldToolsVersion> 
    <UpgradeBackupLocation>D:\Projects\Work\MyProject\Backup2\</UpgradeBackupLocation> 
    </PropertyGroup> 
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> 
    <DebugSymbols>true</DebugSymbols> 
    <DebugType>full</DebugType> 
    <Optimize>false</Optimize> 
    <OutputPath>bin\Debug\</OutputPath> 
    <DefineConstants>DEBUG;TRACE</DefineConstants> 
    <ErrorReport>prompt</ErrorReport> 
    <WarningLevel>4</WarningLevel> 
    </PropertyGroup> 
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> 
    <DebugType>pdbonly</DebugType> 
    <Optimize>true</Optimize> 
    <OutputPath>bin\Release\</OutputPath> 
    <DefineConstants>TRACE</DefineConstants> 
    <ErrorReport>prompt</ErrorReport> 
    <WarningLevel>4</WarningLevel> 
    </PropertyGroup> 
    <ItemGroup> 
    <Reference Include="Enocta_DataLayer, Version=1.0.0.161, Culture=neutral, processorArchitecture=MSIL"> 
     <SpecificVersion>False</SpecificVersion> 
     <HintPath>..\MyProject_COMMON\assemblies\MyProject_DataLayer.dll</HintPath> 
    </Reference> 
    <Reference Include="Enocta_Utils, Version=1.0.0.161, Culture=neutral, processorArchitecture=MSIL"> 
     <SpecificVersion>False</SpecificVersion> 
     <HintPath>..\MyProject_COMMON\assemblies\MyProject_Utils.dll</HintPath> 
    </Reference> 
    <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> 
    <Reference Include="Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 
    <Reference Include="Microsoft.VisualStudio.Zip, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> 
    <Reference Include="System" /> 
    <Reference Include="System.configuration" /> 
    <Reference Include="System.Core"> 
     <RequiredTargetFramework>3.5</RequiredTargetFramework> 
    </Reference> 
    <Reference Include="System.Data" /> 
    <Reference Include="System.Data.DataSetExtensions" /> 
    <Reference Include="System.Drawing" /> 
    <Reference Include="System.Web" /> 
    <Reference Include="System.Web.Extensions" /> 
    <Reference Include="System.XML" /> 
    <Reference Include="System.Xml.Linq" /> 
    </ItemGroup> 
    <ItemGroup> 
    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies"> 
     <Visible>False</Visible> 
    </CodeAnalysisDependentAssemblyPaths> 
    </ItemGroup> 
    <ItemGroup> 
    <Compile Include="[my cs files here].cs" /> 
    </ItemGroup> 
    <ItemGroup> 
    <ProjectReference Include="..\MyProject_COMMON\MyProject_Common.csproj"> 
     <Project>{8EC6C7D7-C89A-4D61-8AE6-32186F3080F1}</Project> 
     <Name>MyProject_Common</Name> 
    </ProjectReference> 
    <ProjectReference Include="..\MyProject_DBHANDLER\MyProject_DBHandler.csproj"> 
     <Project>{5C4BBE2F-5C21-4649-B894-B9F7AD3FB619}</Project> 
     <Name>MyProject_DBHandler</Name> 
    </ProjectReference> 
    <ProjectReference Include="..\MyProject_WebCommon\MyProject_WebCommon.csproj"> 
     <Project>{549106FD-93DC-4E0B-89BF-1CD41E20762D}</Project> 
     <Name>MyProject_WebCommon</Name> 
    </ProjectReference> 
    </ItemGroup> 
    <ItemGroup> 
    <None Include="App.config" /> 
    </ItemGroup> 
    <Choose> 
    <When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'"> 
     <ItemGroup> 
     <Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> 
      <Private>False</Private> 
     </Reference> 
     <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> 
      <Private>False</Private> 
     </Reference> 
     <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> 
      <Private>False</Private> 
     </Reference> 
     <Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> 
      <Private>False</Private> 
     </Reference> 
     </ItemGroup> 
    </When> 
    </Choose> 
    <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" /> 
    <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> 
    <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
     Other similar extension points exist, see Microsoft.Common.targets. 
    <Target Name="BeforeBuild"> 
    </Target> 
    <Target Name="AfterBuild"> 
    </Target> 
    --> 
</Project> 
+0

共享項目文件可能會有用。我已經升級了許多C#單元測試項目,沒有任何問題。 – 2012-04-23 22:41:17

+0

我得到的是同樣的東西,但有一個服務項目 – 2012-05-11 08:30:34

回答

1

我剛剛花了30分鐘,類似的錯誤 - 在2011年VS我有這樣的工作,然後偉大的測試項目中我加了一些Web性能測試和項目不再想要加載「項目需要用戶輸入」是錯誤。

我繼續前進,開始修改項目文件,看看有什麼問題。 我註釋掉東西,直到剩下的唯一一行是<Reference Include="System" />並且項目開始加載(註釋掉每個文件包含,每個引用添加,所有內容)。最終的csproj文件是類似於一個基本WebTest的項目:

<?xml version="1.0" encoding="utf-8"?> 
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
    <PropertyGroup> 
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 
    <ProductVersion> 
    </ProductVersion> 
    <SchemaVersion>2.0</SchemaVersion> 
    <ProjectGuid>2188741d-638d-4305-b777-db258128221e</ProjectGuid> 
    <OutputType>Library</OutputType> 
    <AppDesignerFolder>Properties</AppDesignerFolder> 
    <RootNamespace>WebAndLoadTestProject2</RootNamespace> 
    <AssemblyName>WebAndLoadTestProject2</AssemblyName> 
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> 
    <FileAlignment>512</FileAlignment> 
    <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> 
    <TestProjectType>WebTest</TestProjectType> 
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> 
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> 
    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath> 
    <IsCodedUITest>False</IsCodedUITest> 
    </PropertyGroup> 
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> 
    <DebugSymbols>true</DebugSymbols> 
    <DebugType>full</DebugType> 
    <Optimize>false</Optimize> 
    <OutputPath>bin\Debug\</OutputPath> 
    <DefineConstants>DEBUG;TRACE</DefineConstants> 
    <ErrorReport>prompt</ErrorReport> 
    <WarningLevel>4</WarningLevel> 
    </PropertyGroup> 
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> 
    <DebugType>pdbonly</DebugType> 
    <Optimize>true</Optimize> 
    <OutputPath>bin\Release\</OutputPath> 
    <DefineConstants>TRACE</DefineConstants> 
    <ErrorReport>prompt</ErrorReport> 
    <WarningLevel>4</WarningLevel> 
    </PropertyGroup> 
    <ItemGroup> 
    <Reference Include="System" /> 
    </ItemGroup> 
    <ItemGroup> 
    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies"> 
     <Visible>False</Visible> 
    </CodeAnalysisDependentAssemblyPaths> 
    </ItemGroup> 
    <ItemGroup> 
    <Compile Include="Properties\AssemblyInfo.cs" /> 
    </ItemGroup> 
    <Choose> 
    <When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'"> 
     <ItemGroup> 
     <Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> 
      <Private>False</Private> 
     </Reference> 
     <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> 
      <Private>False</Private> 
     </Reference> 
     <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> 
      <Private>False</Private> 
     </Reference> 
     <Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> 
      <Private>False</Private> 
     </Reference> 
     </ItemGroup> 
    </When> 
    </Choose> 
    <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" /> 
    <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> 
    <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
     Other similar extension points exist, see Microsoft.Common.targets. 
    <Target Name="BeforeBuild"> 
    </Target> 
    <Target Name="AfterBuild"> 
    </Target> 
    --> 
</Project> 

之後,我開始以取消我自己包括和文件 - 我做到了一行行檢查,以查看該項目是否仍然加載(試圖趕上罪魁禍首)。 我這樣做,直到項目文件再次等於原來的(不想加載)。令人驚訝的是,現在項目加載沒有問題...

我想這是VS VS 2011的解決方案,但我不知道 - 希望在發佈的版本,這不會發生。

因此,請從csproj文件中註釋項目特定的內容 - 測試它是否加載,然後取消註釋,並希望它可以正常工作。讓我知道它是如何工作的。

+0

謝謝你的回答和努力。 – 2012-06-11 08:07:29

0

我發現問題出在Web負載測試。打開你的項目文件,(不幸的是)放棄你的web負載測試,並且你的測試項目能夠成功運行。

我們有一個負載測試,沒有被使用,所以這沒有問題。但如果這不是你的情況,這個問題仍然存在。我希望這個問題在VS2012的最終版本中得到解決。

相關問題