2016-12-14 103 views
0

我是C#的新手,我試圖打開一個解決方案文件並得到一個錯誤,因爲沒有找到」MSBuild.Community.Tasks.Targets「,有誰可以請告訴。我該怎麼解決這個錯誤我檢查了各種解決方案無法獲得這一個固定MSBuild.Community.Tasks.Targets「找不到

下面是錯誤

C:\Users\xxxxx\Desktop\HardwareDriver_R3\HardwareDriver_R3\HardwareDriver_R3\HardwareDrivers\HardwareDrivers.csproj : error : The imported project "C:\Program Files (x86)\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. C:\Users\xxxxx\Desktop\HardwareDriver_R3\HardwareDriver_R3\HardwareDriver_R3\HardwareDrivers\BTCommon.targets 

下面是.csproj的內容:

<?xml version="1.0" encoding="utf-8"?> 
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
    <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> 
    <PropertyGroup> 
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 
    <ProjectGuid>{89347491-E1C1-4604-AD3F-6EDB150A121F}</ProjectGuid> 
    <OutputType>Library</OutputType> 
    <AppDesignerFolder>Properties</AppDesignerFolder> 
    <RootNamespace>HardwareDrivers</RootNamespace> 
    <AssemblyName>HardwareDrivers</AssemblyName> 
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> 
    <FileAlignment>512</FileAlignment> 
    </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> 
    <PlatformTarget>x86</PlatformTarget> 
    <DocumentationFile>bin\Debug\HardwareDrivers.XML</DocumentationFile> 
    <NoWarn>1591</NoWarn> 
    </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="ConfigurationReader, Version=0.1.0.0, Culture=neutral, processorArchitecture=x86"> 
     <SpecificVersion>False</SpecificVersion> 
     <HintPath>lib\ConfigurationReader.dll</HintPath> 
    </Reference> 
    <Reference Include="NationalInstruments.Common, Version=13.0.40.190, Culture=neutral, PublicKeyToken=dc6ad606294fc298, processorArchitecture=MSIL"> 
     <SpecificVersion>False</SpecificVersion> 
     <HintPath>lib\NationalInstruments.Common.dll</HintPath> 
    </Reference> 
    <Reference Include="NationalInstruments.DAQmx, Version=9.9.40.39, Culture=neutral, PublicKeyToken=dc6ad606294fc298, processorArchitecture=x86"> 
     <SpecificVersion>False</SpecificVersion> 
     <HintPath>lib\NationalInstruments.DAQmx.dll</HintPath> 
    </Reference> 
    <Reference Include="OptoMMP2"> 
     <HintPath>lib\OptoMMP2.dll</HintPath> 
    </Reference> 
    <Reference Include="System" /> 
    <Reference Include="System.configuration" /> 
    <Reference Include="System.Core" /> 
    <Reference Include="System.Windows.Forms" /> 
    <Reference Include="System.Xml.Linq" /> 
    <Reference Include="System.Data.DataSetExtensions" /> 
    <Reference Include="Microsoft.CSharp" /> 
    <Reference Include="System.Data" /> 
    <Reference Include="System.Xml" /> 
    </ItemGroup> 
    <ItemGroup> 
    <Compile Include="Counters\CountersFactory.cs" /> 
    <Compile Include="Counters\CountersInterface.cs" /> 
    <Compile Include="Counters\NICounters\NICounters.cs" /> 
    <Compile Include="DigitalIO\DigitalIOBase.cs" /> 
    <Compile Include="DigitalIO\DigitalIOFactory.cs" /> 
    <Compile Include="DigitalIO\IDigitalIO.cs" /> 
    <Compile Include="DigitalIO\IDigitalIOBase.cs" /> 
    <Compile Include="DigitalIO\NIDigitalBase.cs" /> 
    <Compile Include="DigitalIO\NIDigitalIO.cs" /> 
    <Compile Include="DigitalIO\Opto22DigitalBase.cs" /> 
    <Compile Include="DigitalIO\Opto22DigitalIO.cs" /> 
    <Compile Include="Ethernet\EventArgs.cs" /> 
    <Compile Include="Ethernet\IEthernetClient.cs" /> 
    <Compile Include="Ethernet\IEthernetComm.cs" /> 
    <Compile Include="Ethernet\IEthernetServer.cs" /> 
    <Compile Include="Ethernet\VASTEthernetClient.cs" /> 
    <Compile Include="Ethernet\VASTEthernetServer.cs" /> 
    <Compile Include="Properties\AssemblyInfo.cs" /> 
    <Compile Include="Serial\AP4600SerialInterface.cs" /> 
    <Compile Include="Serial\DotNetSerial.cs"> 
     <SubType>Component</SubType> 
    </Compile> 
    <Compile Include="Serial\ISerial.cs" /> 
    <Compile Include="Serial\SerialFactory.cs" /> 
    </ItemGroup> 
    <ItemGroup> 
    <Content Include="AnalogIO\placeholder.txt" /> 
    </ItemGroup> 
    <ItemGroup /> 
    <Import Project="BTCommon.targets" Condition="Exists('BTCommon.targets')" /> 
    <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition="!Exists('BTCommon.targets')" /> 
    <PropertyGroup> 
    <PostBuildEvent> 
    </PostBuildEvent> 
    </PropertyGroup> 
    <PropertyGroup> 
    <PreBuildEvent>copy "$(SolutionDir)HardwareDrivers\lib\ConfigurationReader.dll" "$(SolutionDir)HardwareDrivers\bin\Debug" 
copy "$(SolutionDir)HardwareDrivers\lib\NationalInstruments.Common.dll" "$(SolutionDir)HardwareDrivers\bin\Debug" 
copy "$(SolutionDir)HardwareDrivers\lib\NationalInstruments.Common.Native.dll" "$(SolutionDir)HardwareDrivers\bin\Debug" 
copy "$(SolutionDir)HardwareDrivers\lib\NationalInstruments.Common.xml" "$(SolutionDir)HardwareDrivers\bin\Debug" 
copy "$(SolutionDir)HardwareDrivers\lib\NationalInstruments.DAQmx.dll" "$(SolutionDir)HardwareDrivers\bin\Debug" 
copy "$(SolutionDir)HardwareDrivers\lib\NationalInstruments.MStudioCLM.dll" "$(SolutionDir)HardwareDrivers\bin\Debug" 
copy "$(SolutionDir)HardwareDrivers\lib\NationalInstruments.NiLmClientDLL.dll" "$(SolutionDir)HardwareDrivers\bin\Debug"</PreBuildEvent> 
    </PropertyGroup> 
    <!-- 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

你是否已經安裝了這個:https://github.com/loresoft/msbuildtasks –

+0

是的,我沒有下載這個。但不知道打開sln文件時會出現很多錯誤。也不確定在 – NewLearner

+0

後需要做什麼,你應該與你的團隊或項目作者談談 –

回答

0
  1. 步驟1:卸載這是給錯誤
  2. 步驟2中的項目:重建溶液用於恢復包
  3. 步驟3:清潔溶液
  4. 步驟4:再次重建和問題將會解決。